Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # http://thiagodd.blogspot.com.br
- # [TSDA] Custom Menu 2
- # --> Version 1.0
- # by thiago_d_d
- #
- # -----------------------------------------------------------------------------
- # * Features
- # -----------------------------------------------------------------------------
- # + Just another menu, with an different layout.
- #
- # -----------------------------------------------------------------------------
- # * Install
- # -----------------------------------------------------------------------------
- # Put it in the aditional scripts section.
- # Configure it below
- #===============================================================================
- #===============================================================================
- # TSDA
- #===============================================================================
- module TSDA
- #Vocabulary
- GAME_TIME_SK = "Tempo"
- GAME_STEPS_SK = "Passos"
- GAME_PLACE_SK = "Local"
- #Icons indexes
- GAME_PLACEICON_SK = 153
- GAME_TIMEICON_SK = 188
- GAME_STEPSICON_SK = 48
- GAME_GOLDICON_SK = 205
- end
- #===============================================================================
- # Game_Map
- #===============================================================================
- class Game_Map
- alias menu_skull_init initialize
- #---
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize
- menu_skull_init
- @map_info = load_data("Data/MapInfos.rvdata")
- end
- #--------------------------------------------------------------------------
- # map_name
- #--------------------------------------------------------------------------
- def map_name
- return @map_info[@map_id].name
- end
- end
- #===============================================================================
- # Scene_Menu
- #===============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # start
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
- @gold_window = Window_Gold.new(384, 360)
- @status_window = Window_MenuStatus.new(0, 0)
- @mapname_window = Window_MapName.new(384,0)
- @playtime_window = Window_PlayTimeSteps.new(384,232)
- end
- #--------------------------------------------------------------------------
- # terminate
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @command_window.dispose
- @gold_window.dispose
- @status_window.dispose
- @mapname_window.dispose
- @playtime_window.dispose
- end
- #--------------------------------------------------------------------------
- # update
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @command_window.update
- @gold_window.update
- @status_window.update
- @mapname_window.update
- @playtime_window.update
- if @command_window.active
- update_command_selection
- elsif @status_window.active
- update_actor_selection
- end
- end
- #--------------------------------------------------------------------------
- # create_command_window
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::game_end
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
- @command_window.x = 384
- @command_window.y = 80
- if @menu_index == 4
- @command_window.index = 0
- elsif @menu_index == 5
- @command_window.index = 4
- else
- @command_window.index = @menu_index
- end
- if $game_party.members.size == 0
- @command_window.draw_item(0, false)
- @command_window.draw_item(1, false)
- @command_window.draw_item(2, false)
- @command_window.draw_item(3, false)
- end
- end
- #--------------------------------------------------------------------------
- # update_command_selection
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0
- $scene = Scene_Item.new
- when 1,2,3
- start_actor_selection
- when 4
- $scene = Scene_End.new
- end
- end
- end
- end
- #===============================================================================
- # Window_PlayTime
- #===============================================================================
- class Window_PlayTimeSteps < Window_Base
- include TSDA
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize(x,y)
- super(x,y, 160,WLH * 4 + 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # update
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # refresh
- #--------------------------------------------------------------------------
- def refresh(total_sec = nil)
- self.contents.clear
- self.contents.font.color = system_color
- draw_icon(GAME_TIMEICON_SK, 0, 0, true)
- self.contents.draw_text(26, 0, 94, WLH, GAME_TIME_SK)
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, WLH, 120, WLH, text, 2)
- self.contents.font.color = system_color
- draw_icon(GAME_STEPSICON_SK, 0, WLH * 2, true)
- self.contents.draw_text(26, WLH * 2, 94, WLH, GAME_STEPS_SK)
- self.contents.font.color = normal_color
- self.contents.draw_text(0, WLH * 3, 120, WLH, $game_party.steps, 2)
- end
- end
- #===============================================================================
- # Window_MapName
- #===============================================================================
- class Window_MapName < Window_Base
- include TSDA
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize(x,y)
- super(x,y, 160,WLH * 2 + 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- draw_icon(GAME_PLACEICON_SK, 0, 0, true)
- self.contents.draw_text(26, 0, 94, WLH, GAME_PLACE_SK)
- self.contents.font.color = normal_color
- self.contents.draw_text(0, WLH, 120, WLH, $game_map.map_name, 1)
- end
- end
- #===============================================================================
- # Window_Base
- #===============================================================================
- class Window_Base
- include TSDA
- def draw_currency_value(value, x, y, width)
- draw_icon(GAME_GOLDICON_SK, x, y, true)
- cx = contents.text_size(Vocab::gold).width
- self.contents.font.color = normal_color
- self.contents.draw_text(x, y, width-cx-2, WLH, value, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, width, WLH, Vocab::gold, 2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement