mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 21:39:57 +00:00
я попытался 😭
This commit is contained in:
parent
a92bf11e1a
commit
bbb4d4fc27
6 changed files with 141 additions and 38 deletions
|
|
@ -77,7 +77,7 @@ set(scripts
|
|||
i18n_English.rb
|
||||
i18n_Japanese.rb
|
||||
i18n_Language.rb
|
||||
|
||||
Window_TPtL
|
||||
Settings.rb)
|
||||
|
||||
find_program(RUBY_EXE ruby
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ class Game_Map
|
|||
def setup(map_id)
|
||||
# Put map ID in @map_id memory
|
||||
@map_id = map_id
|
||||
puts map_id
|
||||
# Load map from file and set @map
|
||||
@map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
|
||||
# set tile set information in opening instance variables
|
||||
|
|
|
|||
|
|
@ -239,12 +239,6 @@ class Scene_Map
|
|||
end
|
||||
end
|
||||
end
|
||||
# If game over
|
||||
if $game_temp.gameover
|
||||
# Switch to game over screen
|
||||
$scene = Scene_Gameover.new
|
||||
return
|
||||
end
|
||||
# If returning to title screen
|
||||
if $game_temp.to_title
|
||||
# Change to title screen
|
||||
|
|
@ -312,19 +306,6 @@ class Scene_Map
|
|||
$game_temp.player_new_x = $data_system.start_x
|
||||
$game_temp.player_new_y = $data_system.start_y
|
||||
end
|
||||
# debug && F6
|
||||
#if $debug and Input.press?(Input::F6) and $lastpress != 6
|
||||
# $lastpress = 6
|
||||
# Chroma.playAnim("chroma/blank_keyboard.chroma", false);
|
||||
#end
|
||||
#if $debug and Input.press?(Input::F7) and $lastpress != 7
|
||||
# $lastpress = 7
|
||||
# Chroma.playAnim("chroma/Fire_Keyboard.chroma", true);
|
||||
#end
|
||||
#if $debug and Input.press?(Input::F9) and $lastpress != 9
|
||||
# $lastpress = 9
|
||||
# Chroma.playAnim("chroma/Random_Keyboard.chroma", false);
|
||||
#end
|
||||
# If debug mode is ON and F9 key was pressed
|
||||
if Input.press?(Input::F9) && Settings[:debug] == true
|
||||
# Set debug calling flag
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
class Window_MainMenu < Window_Selectable
|
||||
def initialize
|
||||
super(Graphics.width / 2 - 304, 16, 608, 64)
|
||||
|
||||
# Set up menu options
|
||||
@commands = Array.new
|
||||
@commands << 'Fast Travel'
|
||||
|
|
@ -151,22 +150,10 @@ class Window_MainMenu < Window_Selectable
|
|||
$game_temp.window_settings_calling = true
|
||||
@fade_out = true
|
||||
when 3
|
||||
if File.exist?("imstupidcheater.txt")
|
||||
id = File.read("imstupidcheater.txt").strip.to_i
|
||||
x = File.read("imstupidcheater.x").strip.to_i
|
||||
y = File.read("imstupidcheater.y").strip.to_i
|
||||
$game_temp.player_transferring = true
|
||||
$game_temp.player_new_map_id = id
|
||||
$game_temp.player_new_x = x
|
||||
$game_temp.player_new_y = y
|
||||
$game_temp.player_new_direction = 0
|
||||
Graphics.freeze
|
||||
$game_temp.transition_processing = true
|
||||
$game_temp.transition_name = ""
|
||||
@fade_out = true
|
||||
end
|
||||
end
|
||||
return
|
||||
@menu = ::Window_TPtL.new
|
||||
@menu.open
|
||||
@menu.dispose
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
134
scripts/Window_TPtL.rb
Normal file
134
scripts/Window_TPtL.rb
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
# The main menu window
|
||||
class Window_TPtL < Window_Selectable
|
||||
def initialize
|
||||
super(Graphics.width, 64, Graphics.height, 64)
|
||||
@mapinfo = load_data("Data/MapInfos.rxdata")
|
||||
|
||||
@item_max = 262
|
||||
@column_max = @item_max
|
||||
|
||||
# Make invisible by default
|
||||
self.visible = false
|
||||
self.active = false
|
||||
self.back_opacity = 230
|
||||
@fade_in = false
|
||||
@fade_out = false
|
||||
|
||||
# Render menu
|
||||
self.contents = Bitmap.new(width - 32, 32)
|
||||
Language.register_text_sprite(self.class.name + "_contents", self.contents)
|
||||
for i in 0...@item_max
|
||||
draw_item(i, normal_color)
|
||||
end
|
||||
self.z = 9998
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Dispose
|
||||
#--------------------------------------------------------------------------
|
||||
def dispose
|
||||
# Dispose of windows
|
||||
super
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Draw Item
|
||||
# index : item number
|
||||
# color : text color
|
||||
#--------------------------------------------------------------------------
|
||||
def draw_item(index, color)
|
||||
# Set color
|
||||
self.contents.font.color = color
|
||||
|
||||
# Get width of text and cap
|
||||
w = self.width / @item_max
|
||||
|
||||
# Update item
|
||||
rect = Rect.new(w * index, 0, w - 32, 32)
|
||||
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
|
||||
self.contents.draw_text(rect, tr(@mapinfo&.[](index)&.name || "EMPTY"), 1)
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Disable Item
|
||||
# index : item number
|
||||
#--------------------------------------------------------------------------
|
||||
def disable_item(index)
|
||||
draw_item(index, disabled_color)
|
||||
end
|
||||
|
||||
# Open/show the menu
|
||||
def open
|
||||
# redraw in case language has been updated
|
||||
for i in 0...@item_max
|
||||
draw_item(i, normal_color)
|
||||
end
|
||||
self.opacity = 0
|
||||
self.contents_opacity = 0
|
||||
self.visible = true
|
||||
@fade_in = true
|
||||
self.index = 0
|
||||
self.active = true
|
||||
end
|
||||
|
||||
# Update
|
||||
def update
|
||||
super
|
||||
|
||||
# Handle fade-in effect
|
||||
if @fade_in
|
||||
if Input.trigger?(Input::ITEMS)
|
||||
@fade_in = false
|
||||
@fade_out = true
|
||||
else
|
||||
self.opacity += 48
|
||||
self.contents_opacity += 48
|
||||
if self.contents_opacity == 255
|
||||
@fade_in = false
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
# Handle fade-out effect
|
||||
if @fade_out
|
||||
self.opacity -= 48
|
||||
self.contents_opacity -= 48
|
||||
if self.contents_opacity == 0
|
||||
@fade_out = false
|
||||
self.visible = false
|
||||
self.active = false
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
# Don't do anything if not active
|
||||
if !self.active || $game_system.map_interpreter.running?
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
# Cancel menu
|
||||
if Input.trigger?(Input::CANCEL) ||
|
||||
Input.trigger?(Input::MENU) ||
|
||||
Input.trigger?(Input::ITEMS)
|
||||
unless Input.trigger?(Input::ITEMS)
|
||||
$game_system.se_play($data_system.cancel_se)
|
||||
end
|
||||
@fade_out = true
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
# Select menu item
|
||||
if Input.trigger?(Input::ACTION)
|
||||
self.active = false
|
||||
self.opacity = 127
|
||||
$game_temp.player_transferring = true
|
||||
$game_temp.player_new_map_id = @index
|
||||
$game_temp.player_new_x = 0
|
||||
$game_temp.player_new_y = 0
|
||||
$game_temp.player_new_direction = 0
|
||||
Graphics.freeze
|
||||
$game_temp.transition_processing = true
|
||||
$game_temp.transition_name = ""
|
||||
@fade_out = true
|
||||
end
|
||||
end
|
||||
|
|
@ -52,6 +52,7 @@ Window_Message
|
|||
Window_DebugLeft
|
||||
Window_DebugRight
|
||||
Window_MainMenu
|
||||
Window_TPtL
|
||||
|
||||
Interpreter_1
|
||||
Interpreter_2
|
||||
|
|
@ -98,5 +99,4 @@ Credits_Message
|
|||
Particles
|
||||
|
||||
EdText
|
||||
#main
|
||||
Main
|
||||
|
|
|
|||
Loading…
Reference in a new issue