Cerca nel Forum
Showing results for tags 'Menù per un solo PG'.
Trovato 1 risultato
-
Nome Script: Menù per un solo PG Versione: 1.2 Autore/i: LilBrudder917's Informazioni: Questo script è adatto per chi usa un solo PG nel suo game. Tutte le varie finestre possono essere attivate o disattivate ^^ (potete vedere la differenza dai due screen,una che ha attiva la locazione,e l'altro no) Inoltre,potete inserire un vostro sfondo in basso a destra con un'immagine di 150x60. Istruzioni: Inserite lo script sopra Main. Script: #============================================================================== # Project CMS by lilbrudder917 # Version 1.22 #------------------------------------------------------------------------------ # Overrides Scene_Menu and Window_MenuStatus. Rewrites the "Draw Level" parts of # Window_Base to change settings. Window_PlayTime has been changed in Width. # Rewrites Window_Steps. #============================================================================== #============================================================================== # CONFIGURATION #============================================================================== ItemName = "Inventory" # Default is Item SkillName = "Cast Spell" # Default is Skill EquipName = "Wear" # Default is Equip StatusName = "Status" # Default is Status SaveName = "Save Data" # Default is Save EndName = "Quit Game" # Default is End Game CommandW = 150 # Width of the Command Window Custom_Map = false # If true, you can have a picture as a background. Map_Picture = "mappic" # If Custom_Map = true, this will be the background. Facesets = true # If true and the face file is missing, the actor's #sprite will be used instead FaceIMG = "Face" # Filename for the face image. FFILETYPE = ".png" # Face File Type CornerLogo = true # In the bottom right corner, want a 148x61 icon? LogoIcon = "logoicon" # Name of icon LogoFType = ".png" # Icon File Type #============================================================================= # Scene_Menu Window Add-ons #============================================================================= $MapBG = true # If true, the map will be your background $UseNotes = true # To use Window_Notes, have this true. $UsePTime = true # To use Window_PlayTime, have this true. $UseRTime = true # To use Window_RealTime, have this true. RTHVar = 2 # Variable used for storing hours RTMVar = 3 # Variable used for storing minutes RTAPVar= 4 # Variable used for storing AM/PM RTSVar = 5 # Variable used for storing seconds $TwelClock = true # 12-Hour Clock if true, false = 24-Hour Clock $UseVar = true # To use Window_Variable, have this true. $UseSteps = true # To use Window_Steps, have this true. $UseGold = true # To use Window_Gold, have this true. $UseLoca = true # To use Window_Location, have this true. ############################################################################### # Coordinate Controls # #-----------------------------------------------------------------------------# # Unless you know what you are doing, I don't recommend touching these. # # These are the display settings of Window_MenuStatus. # ############################################################################### ShowName = true # Show Actor's Name? NameX = 135 # Actor_Name X Position NameY = 0 # Actor_Name Y Position ShowClass = true # Show Actor's Class? ClassX = 128 # Actor_Class X Position ClassY = 30 # Actor_Class Y Position ShowLevel = true # Show Actor's Level? LevelX = 0 # Actor_Level X Position LevelY = 139 # Actor_Level Y Position LevelT = "Level" # Custom Title for Level? ShowState = true # Show Actor_State? StateX = 123 # Actor_State X Position StateY = 50 # Actor_State Y Position ShowHP = true # Show HP/MaxHP String? UseBARS = nil # Coming Soon HPX = 0 # Hitpoints String X Position HPY = 100 # Hitpoints String Y Position ShowSP = true # Show SP/MaxSP String? SpecX = 0 # Specpoints String X Position SpecY = 125 # Specpoints String Y Position ShowEXP = true # Show Experience String? ExperX = 0 # Experience String X Position ExperY = 185 # Experience String Y Position CommandX = 488 # Window_Command X Position WINNOTES_X= 2 # Window_Notes X Position WINNOTES_Y= 242 # Window_Notes Y Position RealTimeX = 488 # Window_RealTime X Position RealTimeY = 320 # Window_RealTime Y Position PlayTimeX = 488 # Window_PlayTime X Position PlayTimeY = 224 # Window_PlayTime Y Position VariableX = 243 # Window_Variable X Position VariableY = 66 # Window_Variable Y Position WStepX = 243 # Window_Steps X Position WStepY = 163 # Window_Steps Y Position WGoldX = 243 # Window_Gold X Position WGoldY = 2 # Window_Gold Y Position PLogoX = 490 # Game_Logo X Position PLogoY = 418 # Game_Logo Y Position WMStatusX = 2 # Window_MenuStatus X Position WMStatusY = 2 # Window_MenuStatus Y Position LOCATION_X= 2 LOCATION_Y= 430 VariTitle = "Bank" # Text in Window_Variable VariShoNum= 1 # Variable used in Window_Variable GoldName = "Gold" # Currency Name StepName = "Steps" # Text in Window_Steps PlTiName = "Play Time"# Text in Window_PlayTime NoteVName = "Notes" # Text in Window_Notes CurTiName = "Time" # Text in Window_RealTime LocaName = "Location:"# Text in Window_Location if $MapBG && Custom_Map == true print "Both $MapBG and Custom_Map cannot be on at the same time! Turning off Custom_Map." Custom_Map = false end #============================================================================== # ** Window_MenuStatus #------------------------------------------------------------------------------ # This window displays party member status on the menu screen. #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 240, 240) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 0 y = 0 actor = $game_party.actors[i] if Facesets == true #Facesets True? if FileTest.exist?("Graphics/Pictures/" + FaceIMG + FFILETYPE) #File Exist @face_file = FaceIMG + FFILETYPE self.contents.blt(x, y, RPG::Cache.picture(@face_file), Rect.new(x, y, 112, 112)) else #File Not Exist draw_actor_graphic(actor, 24, 56) end #End File Check else #Facesets Else draw_actor_graphic(actor, 24, 56) end #Faceset End if ShowName == true draw_actor_name(actor, NameX, NameY) end if ShowLevel == true draw_actor_level(actor, 0, 0) end if ShowState == true draw_actor_state(actor, StateX, StateY) end draw_actor_exp(actor, ExperX, ExperY) if ShowClass == true draw_actor_class(actor, ClassX, ClassY) end if ShowHP == true draw_actor_hp(actor, HPX, HPY) end if ShowSP == true draw_actor_sp(actor, SpecX, SpecY) end end end #-------------------------------------------------------------------------- # * Cursor Rectangle Update #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 116, self.width - 32, 96) end end end #============================================================================== # End Window_MenuStatus #============================================================================== #============================================================================== # Window Base Level Edit #============================================================================== class Window_Base def draw_actor_level(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(LevelX, 160, 32, 32, LevelT, 2) self.contents.font.color = normal_color self.contents.draw_text(LevelX + 32, 160, 24, 32, actor.level.to_s, 2) end end #============================================================================== # End Window_Base #============================================================================== class Window_Steps < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 245, 78) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(0, -5, 120, 32, StepName) self.contents.font.color = normal_color self.contents.draw_text(4, 16, 200, 32, $game_party.steps.to_s, 2) end end #============================================================================== # ** Window_Gold #------------------------------------------------------------------------------ # This window displays amount of gold. #============================================================================== class Window_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 245, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size(GoldName).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 180-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(184-cx, 0, cx, 32, GoldName, 2) end end #============================================================================== # ** Window_PlayTime #------------------------------------------------------------------------------ # This window displays play time on the menu screen. #============================================================================== class Window_PlayTime < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 150, 96) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 100, 32, PlTiName) @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, 32, 100, 32, text, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end #============================================================================= # End Window_Steps #============================================================================== #============================================================================== # ** Window_Notes by lilbrudder917 #------------------------------------------------------------------------------ # This window displays custom-made notes made for the menu screen, but # can be called anywhere. Requires Project CMS to work. I think. #============================================================================== $MESSAGE1_L1 = "Welcome to the Menu! This Window is called" # First line for the first message $MESSAGE1_L2 = "the Notes Window! Text automatically aligns" # Second line for the first message $MESSAGE1_L3 = "to the right side of the Window, and the" # Third line for the first message $MESSAGE1_L4 = "Window stores up to 5 lines per message!" $MESSAGE1_L5 = " " $MESSAGE2_L1 = "Since you talked to the Shady Noter," $MESSAGE2_L2 = "you have unlocked this new message to be" $MESSAGE2_L3 = "placed in your notes!" $MESSAGE2_L4 = " " $MESSAGE2_L5 = "Butterscotch." $MESSAGE3_L1 = "If you want, you can define these to say" $MESSAGE3_L2 = "what you want them to and then Script Call" $MESSAGE3_L3 = "'$DEFMESSAGE = (MessageNumber)' without " $MESSAGE3_L4 = "quotations or parentheses." $MESSAGE3_L5 = " " $MESSAGE4_L1 = "Oh, if you want a blank line, just put a" $MESSAGE4_L2 = "space where the message would go." $MESSAGE4_L3 = " " $MESSAGE4_L4 = " " $MESSAGE4_L5 = "See?" $DEFMESSAGE = 1 # Can be changed in game. class Window_Notes < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(240, 20, 485, 190) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, NoteVName) if $DEFMESSAGE == 1 text_L1 = $MESSAGE1_L1 text_L2 = $MESSAGE1_L2 text_L3 = $MESSAGE1_L3 text_L4 = $MESSAGE1_L4 text_L5 = $MESSAGE1_L5 elsif $DEFMESSAGE == 2 text_L1 = $MESSAGE2_L1 text_L2 = $MESSAGE2_L2 text_L3 = $MESSAGE2_L3 text_L4 = $MESSAGE2_L4 text_L5 = $MESSAGE2_L5 elsif $DEFMESSAGE == 3 text_L1 = $MESSAGE3_L1 text_L2 = $MESSAGE3_L2 text_L3 = $MESSAGE3_L3 text_L4 = $MESSAGE3_L4 text_L5 = $MESSAGE3_L5 elsif $DEFMESSAGE == 4 text_L1 = $MESSAGE4_L1 text_L2 = $MESSAGE4_L2 text_L3 = $MESSAGE4_L3 text_L4 = $MESSAGE4_L4 text_L5 = $MESSAGE4_L5 else text_L1 = " " text_L2 = " " text_L3 = "You have nothing stored in your notes." text_L4 = " " text_L5 = " " end self.contents.font.color = normal_color self.contents.draw_text(4, 32, 350, 32, text_L1, 2) self.contents.draw_text(4, 64, 350, 32, text_L2, 2) self.contents.draw_text(4, 96, 350, 32, text_L3, 2) self.contents.draw_text(4, 128, 350, 32, text_L4, 2) self.contents.draw_text(4, 160, 350, 32, text_L5, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh end end #============================================================================== # ** Window_Location by lilbrudder917 #------------------------------------------------------------------------------ # This window displays the map's name. #============================================================================== class Window_Location < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 485, 48) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(0, -10, 120, 32, LocaName) self.contents.font.color = normal_color cx = contents.text_size(LocaName).width self.contents.draw_text(cx+30, -10, 120, 32, $game_map.name) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh end end #------------------------------------------------------------------------- # * Define Map Title #------------------------------------------------------------------------- class Scene_Title alias locationname main def main $map_infos = load_data('Data/MapInfos.rxdata') $map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name} locationname end end class Game_Map def name return $map_infos[@map_id] end end #============================================================================== # ** Window_Variable by lilbrudder917 #------------------------------------------------------------------------------ # This window displays a variable made for the menu screen, but can be called # anywhere. Requires Project CMS to work. I think. #============================================================================== class Window_Variable < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 245, 96) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, VariTitle) text = "#{$game_variables[VariShoNum]}" self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, text, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh end end #============================================================================== # ** Window_RealTime by lilbrudder917 #------------------------------------------------------------------------------ # This window displays the time stored on your computer's internal clock, # made for the menu screen, but can be called anywhere. Requires Project CMS # to work. I think. #============================================================================== class Window_RealTime < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @time_stamp = Time.new if $TwelClock == true $game_variables[RTHVar] = @time_stamp.strftime("%I") # Hour, 12-Hour Format $game_variables[RTMVar] = @time_stamp.strftime("%M") # Minutes $game_variables[RTAPVar] = @time_stamp.strftime("%p")# AM/PM $game_variables[RTSVar] = @time_stamp.strftime("%S") # Seconds else $game_variables[RTHVar] = @time_stamp.strftime("%H") # Hour, 24-Hour Format $game_variables[RTMVar] = @time_stamp.strftime("%M") # Minutes $game_variables[RTSVar] = @time_stamp.strftime("%S") # Seconds end super(0, 0, 150, 96) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 100, 32, CurTiName) if $TwelClock == true text = "#{$game_variables[RTHVar]}: #{$game_variables[RTMVar]}: #{$game_variables[RTSVar]} #{$game_variables[RTAPVar]}" else text = "#{$game_variables[RTHVar]}: #{$game_variables[RTMVar]}: #{$game_variables[RTSVar]}" end self.contents.font.color = normal_color self.contents.draw_text(4, 32, 100, 32, text, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super refresh end end class Scene_Menu #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main #-------------------------------------------------------------------------- # * Menu Background #-------------------------------------------------------------------------- if $MapBG == true @map = Spriteset_Map.new end if Custom_Map == true @sprite = Sprite.new @sprite.bitmap = RPG::Cache.picture(Map_Picture) end # Make command window s1 = ItemName s2 = SkillName s3 = EquipName s4 = StatusName s5 = SaveName s6 = EndName @command_window = Window_Command.new(CommandW, [s1, s2, s3, s4, s5, s6]) @command_window.x = CommandX @command_window.index = 0 # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(4) end if $UseNotes == true @mnotes_window = Window_Notes.new @mnotes_window.x = WINNOTES_X @mnotes_window.y = WINNOTES_Y end if $UseLoca == true @location_window = Window_Location.new @location_window.x = LOCATION_X @location_window.y = LOCATION_Y end # Make play time window if $UsePTime == true @playtime_window = Window_PlayTime.new @playtime_window.x = PlayTimeX @playtime_window.y = PlayTimeY end if $UseRTime == true @realtime_window = Window_RealTime.new @realtime_window.x = RealTimeX @realtime_window.y = RealTimeY end if $UseVar == true @vartime_window = Window_Variable.new @vartime_window.x = VariableX @vartime_window.y = VariableY end #Make steps window if $UseSteps ==true @steps_window = Window_Steps.new @steps_window.x = WStepX @steps_window.y = WStepY end # Make gold window if $UseGold == true @gold_window = Window_Gold.new @gold_window.x = WGoldX @gold_window.y = WGoldY end if CornerLogo == true @image = Sprite.new @image.bitmap = RPG::Cache.picture(LogoIcon) @image.x = PLogoX @image.y = PLogoY end # Make status window @status_window = Window_MenuStatus.new @status_window.x = WMStatusX @status_window.y = WMStatusY # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @command_window.dispose if $MapBG == true @map.dispose end if $UseLoca == true @location_window.dispose end if $UseNotes == true @mnotes_window.dispose end if $UsePTime == true @playtime_window.dispose end if $UseRTime == true @realtime_window.dispose end if $UseVar == true @vartime_window.dispose end if $UseSteps ==true @steps_window.dispose end if $UseGold == true @gold_window.dispose end if CornerLogo == true @image.dispose end @status_window.dispose #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update if $UseNotes == true @mnotes_window.update end if $UseLoca == true @location_window.update end if $UsePTime == true @playtime_window.update end if $UseRTime == true @realtime_window.update end if $UseVar == true @vartime_window.update end if $UseSteps ==true @steps_window.update end if $UseGold == true @gold_window.update end if CornerLogo == true @image.update end @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input:: # 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 # save # If saving is forbidden if $game_system.save_disabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to save screen $scene = Scene_Save.new when 5 # 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 #-------------------------------------------------------------------------- # * Frame Update (when status window is active) #-------------------------------------------------------------------------- def update_status # If B button was pressed if Input.trigger?(Input:: # Play cancel SE $game_system.se_play($data_system.cancel_se) # Make command window active @command_window.active = true @status_window.active = false @status_window.index = -1 return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 1 # skill # If this actor's action limit is 2 or more if $game_party.actors[@status_window.index].restriction >= 2 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to skill screen $scene = Scene_Skill.new(@status_window.index) when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to equipment screen $scene = Scene_Equip.new(@status_window.index) when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to status screen $scene = Scene_Status.new(@status_window.index) end return end end end end Demo:Menù per un solo PG