PHP-Code: class Window_Steps < Window_Base def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, "Schritte") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2) endendclass Window_Gold < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) endendclass Window_PlayTime < Window_Base def initialize super(0, 0, 160, 62) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear self.contents.font.color = system_color @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, 0, 120, 32, text, 2) end def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end endendclass Window_MenuStatus < Window_Selectable def initialize super(0, 0, 480, 350) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 80 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 40, y + 80) draw_actor_name(actor, x, y) draw_actor_class(actor, x + 144, y) draw_actor_level(actor, x, y + 32) draw_actor_state(actor, x + 90, y + 32) draw_actor_exp(actor, x, y +50) draw_actor_hp(actor, x + 236, y + 32) draw_actor_sp(actor, x + 236, y + 50) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 80, self.width - 32, 80) end endendclass Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main @map_spriteset = Spriteset_Map.new s1 = "Items" s2 = "Techniken" s3 = "Ausrüstung" s4 = "Status" s5 = "Sichern" s6 = "Aufhören" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s6]) @command_window.index = @menu_index @command_window.x = 480 @command_window.opacity = 180 if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @playtime_window = Window_PlayTime.new @playtime_window.x = 480 @playtime_window.y = 224 - 32 @playtime_window.opacity = 180 @gold_window = Window_Gold.new @gold_window.x = 480 @gold_window.y = 286 - 32 @gold_window.opacity = 180 @steps_window = Window_Steps.new @steps_window.x = 480 @steps_window.y = 318 @steps_window.opacity = 180 @status_window = Window_MenuStatus.new @status_window.x = 0 @status_window.y = 0 @status_window.opacity = 180 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @gold_window.dispose @steps_window.dispose @status_window.dispose @map_spriteset.dispose end def update @map_spriteset.update @command_window.update @playtime_window.update @gold_window.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # skill # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end end def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end endendclass Scene_End def update @command_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(4) return end if Input.trigger?(Input::C) case @command_window.index when 0 command_to_title when 1 command_shutdown when 2 command_cancel end return end end def command_cancel $game_system.se_play($data_system.decision_se) $scene = Scene_Menu.new(4) endend So, letzter €dit
class Window_Steps < Window_Base def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, "Schritte") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2) endendclass Window_Gold < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) endendclass Window_PlayTime < Window_Base def initialize super(0, 0, 160, 62) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear self.contents.font.color = system_color @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, 0, 120, 32, text, 2) end def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end endendclass Window_MenuStatus < Window_Selectable def initialize super(0, 0, 480, 350) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 80 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 40, y + 80) draw_actor_name(actor, x, y) draw_actor_class(actor, x + 144, y) draw_actor_level(actor, x, y + 32) draw_actor_state(actor, x + 90, y + 32) draw_actor_exp(actor, x, y +50) draw_actor_hp(actor, x + 236, y + 32) draw_actor_sp(actor, x + 236, y + 50) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 80, self.width - 32, 80) end endendclass Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main @map_spriteset = Spriteset_Map.new s1 = "Items" s2 = "Techniken" s3 = "Ausrüstung" s4 = "Status" s5 = "Sichern" s6 = "Aufhören" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s6]) @command_window.index = @menu_index @command_window.x = 480 @command_window.opacity = 180 if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @playtime_window = Window_PlayTime.new @playtime_window.x = 480 @playtime_window.y = 224 - 32 @playtime_window.opacity = 180 @gold_window = Window_Gold.new @gold_window.x = 480 @gold_window.y = 286 - 32 @gold_window.opacity = 180 @steps_window = Window_Steps.new @steps_window.x = 480 @steps_window.y = 318 @steps_window.opacity = 180 @status_window = Window_MenuStatus.new @status_window.x = 0 @status_window.y = 0 @status_window.opacity = 180 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @gold_window.dispose @steps_window.dispose @status_window.dispose @map_spriteset.dispose end def update @map_spriteset.update @command_window.update @playtime_window.update @gold_window.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # skill # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end end def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end endendclass Scene_End def update @command_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(4) return end if Input.trigger?(Input::C) case @command_window.index when 0 command_to_title when 1 command_shutdown when 2 command_cancel end return end end def command_cancel $game_system.se_play($data_system.decision_se) $scene = Scene_Menu.new(4) endend
Geändert von SMWma (05.04.2010 um 19:52 Uhr)
Stichwortwolke anzeigen
Foren-Regeln