From bbb4d4fc27c6eed908bf42a1d74012384f850da0 Mon Sep 17 00:00:00 2001 From: DepressedTWM Date: Thu, 4 Jun 2026 07:48:18 -0400 Subject: [PATCH] =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=B0?= =?UTF-8?q?=D0=BB=D1=81=D1=8F=20:sob:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/CMakeLists.txt | 2 +- scripts/Game_Map.rb | 1 + scripts/Scene_Map.rb | 19 ------ scripts/Window_MainMenu.rb | 21 ++---- scripts/Window_TPtL.rb | 134 +++++++++++++++++++++++++++++++++++++ scripts/_scripts.txt | 2 +- 6 files changed, 141 insertions(+), 38 deletions(-) create mode 100644 scripts/Window_TPtL.rb diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index bd59b5e..b1bdfcf 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -77,7 +77,7 @@ set(scripts i18n_English.rb i18n_Japanese.rb i18n_Language.rb - + Window_TPtL Settings.rb) find_program(RUBY_EXE ruby diff --git a/scripts/Game_Map.rb b/scripts/Game_Map.rb index 47ec3f0..7e6a484 100644 --- a/scripts/Game_Map.rb +++ b/scripts/Game_Map.rb @@ -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 diff --git a/scripts/Scene_Map.rb b/scripts/Scene_Map.rb index 052417c..1b61a19 100644 --- a/scripts/Scene_Map.rb +++ b/scripts/Scene_Map.rb @@ -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 diff --git a/scripts/Window_MainMenu.rb b/scripts/Window_MainMenu.rb index aaf6602..1c82f16 100644 --- a/scripts/Window_MainMenu.rb +++ b/scripts/Window_MainMenu.rb @@ -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 diff --git a/scripts/Window_TPtL.rb b/scripts/Window_TPtL.rb new file mode 100644 index 0000000..1b8b7dd --- /dev/null +++ b/scripts/Window_TPtL.rb @@ -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 diff --git a/scripts/_scripts.txt b/scripts/_scripts.txt index 225da58..0f80e67 100644 --- a/scripts/_scripts.txt +++ b/scripts/_scripts.txt @@ -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