Va-nu-pieds Lv.4
Age : 28 Inscrit le : 16/03/2010 Messages : 63
| Sujet: Re: Ajouter l'option "Quetes" dans ce menu. Mer 2 Mai 2012 - 16:12 | |
| Je sais pas si ton problème est toujours d'actualité, mais voilà : - Spoiler:
- Code:
-
#=============================================================================== # # Yanfly Engine RD - Scene Menu ReDux + KGC Custom Menu Command # Last Date Updated: 2009.06.22 # Level: Normal, Hard, Lunatic # # This is more or less a revision of the menu scene. Included in the script are # a couple of features. Note that I will NOT take credit for KGC's custom menu # command script as all I did was merely import it into this script and finished # up the excluded functions that he's left behind. Everything else I did add # to the script. # # COMMAND CONTROL - by KGC # Add, remove, and re-order commands akin to KGC's CustomMenuCommands. Akin to # this feature will include what KGC's original script was missing and that was # easy functionality to include custom menu commands without hassling the core # script itself. Also added is the ability to launch common events from the # main menu itself for those who wish to event unique commands. # # REDUX MENUS # The redux menus are completely optional and are mostly nothing other than # visual changes to the menu scene. You can add icons to the command window, # display more than just gold on the main menu screen, and added experience # bars to the party window. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.22 - Fixed time calculation. # o 2009.06.10 - Added Time, Steps, and Map Name to MultiVariable Window. # o 2009.06.06 - Finished script. # o 2009.06.05 - Started script. #=============================================================================== # Instructions #=============================================================================== # # Note that the placement of this script is extremely important. # # 1. Place all of the non-KGC and non-Yanfly scripts that have new scenes above # this script. That way, they will not alter the menu. # 2. Place all KGC and Yanfly scripts below this script to develop compatibility # amongst all of the scripts. # # Note that the special rules other scripts may use to disable their respective # commands will not follow those rules. You'll have to mimic them through usage # of switches. Make sure you understand how and when those scripts disable their # own commands before toggling your switches. # # Scroll down to MENU_COMMANDS to add/remove/reorder your own menu commands. # Adjust any of the ReDux menu options if desired. # #=============================================================================== # # Compatibility # - Works With: KGC scripts, Yanfly scripts, etc. # - Alias: Game_Temp, initialize # - Overwrites: Scene_Menu: anything regarding command window # - Overwrites: Scene_Equip, Scene_Skill, and Scene_Status's return_scene # #=============================================================================== # Credits: # All credits will go to KGC as I did not write the majority of this code. # KGC for Custom Menu Command base coding and pretty much everything. #===============================================================================
$imported = {} if $imported == nil $imported["SceneMenuReDux"] = true
module YE module REDUX module MENU #----------------------------------------------------------------------- # BASIC MENU FUNCTIONS #----------------------------------------------------------------------- # This adjusts the input button used to call the main menu. By default, # the input command is Input::B. MENU_BUTTON = Input::B # The following determines which option the menu will place the cursor # at whenever launched. START_INDEX = 0 # This will place the command window on the right hand side and all the # rest on the left hand side if set to true. RIGHT_SIDE_COMMAND = false #----------------------------------------------------------------------- # Instructions on how to set up the MENU_COMMANDS order. #------------------------------------------------------------------------ # This array will let you determine how you want your menu command list # to be ordered. Each command is assigned a number and these are the # following numbers. The following are the default menu commands: # # 0..Items 1..Skills 2..Equipment 3..Status 4..Save 5..System # # The following are imports from KGC's original CustomMenuCommand. # # 10: Party .............. KGC_LargeParty # 11: View AP ............ KGC_EquipLearnSkill # 12: Skill Slots ........ KGC_SkillCPSystem # 13: Difficulty ......... KGC_BattleDifficulty # 14: Level Up ........... KGC_DistributeParameter # 15: Bestiary ........... KGC_MonsterGuide # 16: Outline ............ KGC_Outline # # The following are menu items for Yanfly Engine ReDux scripts. # # 51: Change Class ....... Yanfly's Subclass Selection System # 52: Learn Skill ........ Yanfly's Subclass Selection System # 53: Skill Slots ........ Yanfly's Equip Skill Slots # 54: Bestiary ........... Yanfly's Bestiary + Display Scanned Enemy # # For commands 101 to 200, common events can be bound. Make sure you # set up the COMMON_EVENTS hash to get the right common events you want. # # From command 201 and onward, custom scripted scenes can be launched. # Already imported are a few rather popular scripts found throughout the # RPG Maker VX community. # # 201: Quest Journal ..... Modern Algebra's Quest Journal # 202: Factions .......... SojaBird's Factions # 203: Rows .............. originalwij's Row Changer # 204: Record Window ..... Stilleas' Record Window # 205: Crafting .......... Cmpsr2000's Crafting Scene # # If you wish to add your own commands, you'll need to register them # under the lunatic mode portion of the script. #----------------------------------------------------------------------- MENU_COMMANDS =[ # Make sure you've read the instructions above. 0, # Items 1, # Skills 2, # Equipment 3, # Status 54, # Bestiary 101, # Common-Event 9 102, # Common-Event 10 4, # Save 5, # System 6, ### Quetes ] # Do not remove this # The following determines the maximum number of displayed rows for the # customized command window. MAX_ROWS = 10 #----------------------------------------------------------------------- # How to Use: Lunatic Mode - Menu Command - Common Events #----------------------------------------------------------------------- # The following allows you to bind common events to the menu commands. # When a common event is selected, it will exit the menu, go back to the # map screen, and launch the common event there. Bind these ID's from # 101 to 200. Here is what each of the categories mean: # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Debug? - Only appears in test mode. Does not appear in normal play. # CEvent - The ID of the common event that will be launched. # Title - The title text that appears for the event. # # After binding your common events to ID's, go back to MENU_COMMANDS # and insert the proper command ID at the proper location. #----------------------------------------------------------------------- COMMON_EVENTS ={ # These can only be from 101 to 199. # -ID => [HideSw, DisbSw, Debug?, CEvent, Title Name] 101 => [ nil, nil, true, 9, "Debug"], 102 => [ nil, nil, false, 10, "Camp"], } # Do not remove this. #----------------------------------------------------------------------- # How to Use: Lunatic Mode - Menu Command - Imported Scripts #----------------------------------------------------------------------- # The following is what KGC originally was going to have in his script # but was actually missing it in his publicized script. This will regain # functionality and also lift the "limit" of only 100 extra commands. # The following will explain how to set up the individual options. # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Actor? - Does this select an actor. Set to true if it does. # Title - The title text that appears for the event. # Scene - The scene used to launch the respective scene. # # Note that this does not automatically detect what will and will not # disable the command ingame. You must understand and create a work # around with them (if they do disable the commands) with switches. # After binding your imported commands, go back to MENU_COMMANDS and # insert the proper command ID at the proper location. #----------------------------------------------------------------------- IMPORTED_COMMANDS ={ # These can only be from 201 onward. # -ID => [HideSw, DisbSw, Actor?, Title Name, Scene Name.new] 201 => [ 8, 9, false, "Quests", "Scene_Quest"], 202 => [ 10, 11, false, "Factions", "Scene_Factions"], 203 => [ nil, nil, false, "Rows", "Scene_Row"], 204 => [ nil, nil, false, "Records", "Scene_Record"], 205 => [ nil, nil, false, "Crafting", "Scene_Crafting"], } # Do not remove this. #----------------------------------------------------------------------- # REDUX MENU FUNCTIONS #----------------------------------------------------------------------- # For those who would like to add icons to their commands, set this to # true, then go to ICON_SETS and bind text to the icon desired. COMMAND_ICONS = true # Match the ingame command names with the icons. The reason this isn't # implemented together with the index numbers is because this can allow # for varying icons dependent on the command name (such as difficulty). ICON_SETS ={ # "Unlisted" must exist for the unlisted commands. "Unlisted" => 176, # -----Vocab----- => Icon "Bestiary" => 141, "Camp" => 77, "Class Change" => 131, "Equip" => 44, "Item" => 144, "Learn Skills" => 133, "Quests" => 193, "Save" => 149, "Shutdown" => 154, "Slots" => 103, "Skill" => 159, "Status" => 137, "System" => 134, } # Do not remove this. # This part will trigger usage of the "new" party status window. Set it # to false if you do not wish to use it. The "new" status window simply # adds the experience bar to the menu and raises the coordinates of the # various status items by a little bit. USE_REDUX_STATUS = true # This part will adjust the font size for the text shown in the Redux # Status Menu. Affects all text. REDUX_FONT_SIZE = 20 # The following determines how things are shown on the Redux Status Menu. DRAWN_ACTOR_SETUP = 0 # 0 - Face only, 1 - Sprite only, 2 - Both SPRITE_OFFSET = 32 # Sets the y offset for actor sprites FACE_OPACITY = 128 # Sets the face opacity for setting 2 # The following adjusts the EXP bar. Fill out the info properly. EXP_TEXT = "EXP" # Text used for EXP PERCENT_EXP = "%#.04g%%" # Text format used for EXP percentage EXP_GAUGE_1 = 28 # Colour 1 for the EXP Gauge EXP_GAUGE_2 = 29 # Colour 2 for the EXP Gauge # This part adjusts the multi-variable window. It will replace the gold # window and allows you to display multiple variables (including gold) in # the small bow at the bottom of the screen. USE_MULTI_VARIABLE_WINDOW = true # Variables will be shown in this order. Use 0 to show gold. Adjust the # following information as seen necessary. VARIABLES_SHOWN = [-5, -1, -2, 0, 1] VARIABLES_ICONS = true VARIABLES_HASH ={ # Note that value zero must exist. # VarID => [Icon, Text] -5 => [ 153, "Map"], -2 => [ 48, "Steps"], -1 => [ 188, "Time"], 0 => [ 205, "Gold"], 1 => [ 200, "Jewels"], }# Do not remove this. end end end
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
#=============================================================================== # Scene_Menu #===============================================================================
class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # create_command_list #-------------------------------------------------------------------------- def create_command_list commands = [] @ex_cmds = {} index_list = {} YE::REDUX::MENU::MENU_COMMANDS.each_with_index { |c, i| case c when 0 # Items index_list[:item] = commands.size commands.push(Vocab.item) when 1 # Skills index_list[:skill] = commands.size commands.push(Vocab.skill) when 2 # Equip index_list[:equip] = commands.size commands.push(Vocab.equip) when 3 # Status index_list[:status] = commands.size commands.push(Vocab.status) when 4 # Save index_list[:save] = commands.size commands.push(Vocab.save) when 5 # System index_list[:game_end] = commands.size commands.push(Vocab.game_end) when 6 ### Questes index_list[:OmegaQuest] = commands.size commands.push("Quêtes") when 10 # KGC's Large Party next unless $imported["LargeParty"] index_list[:partyform] = commands.size @__command_partyform_index = commands.size commands.push(Vocab.partyform) when 11 # KGC's AP Viewer next unless $imported["EquipLearnSkill"] index_list[:ap_viewer] = commands.size @__command_ap_viewer_index = commands.size commands.push(Vocab.ap_viewer) when 12 # KGC's CP Skill System next unless $imported["SkillCPSystem"] index_list[:set_battle_skill] = commands.size @__command_set_battle_skill_index = commands.size commands.push(Vocab.set_battle_skill) when 13 # KGC's Battle Difficulty next unless $imported["BattleDifficulty"] index_list[:set_difficulty] = commands.size @__command_set_difficulty_index = commands.size commands.push(KGC::BattleDifficulty.get[:name]) when 14 # KGC's Distribute Parameter next unless $imported["DistributeParameter"] index_list[:distribute_parameter] = commands.size @__command_distribute_parameter_index = commands.size commands.push(Vocab.distribute_parameter) when 15 # KGC's Enemy Guide next unless $imported["EnemyGuide"] index_list[:enemy_guide] = commands.size @__command_enemy_guide_index = commands.size commands.push(Vocab.enemy_guide) when 16 # KGC's Outline next unless $imported["Outline"] index_list[:outline] = commands.size @__command_outline_index = commands.size commands.push(Vocab.outline) when 51 # Yanfly Subclass Class Change next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH] index_list[:classchange] = commands.size @command_class_change = commands.size commands.push(YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE)
when 52 # Yanfly Subclass Learn Skill next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::USE_JP_SYSTEM and YE::SUBCLASS::LEARN_SKILL_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_LEARN_SKILLS_SWITCH] index_list[:learnskill] = commands.size @command_learn_skill = commands.size commands.push(YE::SUBCLASS::LEARN_SKILL_TITLE) when 53 # Yanfly Equip Skill System next unless $imported["EquipSkillSlots"] next unless $game_switches[YE::EQUIPSKILL::ENABLE_SLOTS_SWITCH] index_list[:equipskill] = commands.size @command_equip_skill = commands.size commands.push(YE::EQUIPSKILL::MENU_TITLE) when 54 # Yanfly Bestiary next unless $imported["DisplayScannedEnemy"] next unless $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH] index_list[:bestiary] = commands.size @command_bestiary = commands.size commands.push(YE::MENU::MONSTER::BESTIARY_TITLE) when 101..200 next unless YE::REDUX::MENU::COMMON_EVENTS.include?(c) common_event = YE::REDUX::MENU::COMMON_EVENTS[c] next if !$TEST and common_event[2] next if common_event[0] != nil and $game_switches[common_event[0]] index_list[c] = commands.size @ex_cmds[c] = commands.size commands.push(common_event[4]) else next unless YE::REDUX::MENU::IMPORTED_COMMANDS.include?(c) command_array = YE::REDUX::MENU::IMPORTED_COMMANDS[c] next if command_array[0] != nil and $game_switches[command_array[0]] index_list[c] = commands.size @ex_cmds[c] = commands.size commands.push(command_array[3]) end } # Do not remove this. $game_temp.menu_command_index = index_list return commands end #-------------------------------------------------------------------------- # set_command_enabled #-------------------------------------------------------------------------- def set_command_enabled disable_items = [] @disabled_command_index = [] # If zero party members are present if $game_party.members.size == 0 disable_items.push(:item, :skill, :equip, :status, :partyform, :ap_viewer, :set_battle_skill, :distribute_parameter, :classchange, :learnskill, :equipskill) end # If saving has been disabled if $game_system.save_disabled disable_items.push(:save) end # If party changing is disabled if $imported["LargeParty"] and !$game_party.partyform_enable? disable_items.push(:partyform) end for key in YE::REDUX::MENU::COMMON_EVENTS next unless $game_temp.menu_command_index.has_key?(key[0]) next if key[1][1] == nil disable_items.push(key[0]) if $game_switches[key[1][1]] end for key in YE::REDUX::MENU::IMPORTED_COMMANDS next unless $game_temp.menu_command_index.has_key?(key[0]) next if key[1][1] == nil disable_items.push(key[0]) if $game_switches[key[1][1]] end # Disable each of the items. disable_items.each { |i| if $game_temp.menu_command_index.has_key?(i) index = $game_temp.menu_command_index[i] @command_window.draw_item(index, false) @disabled_command_index.push(index) end } end #-------------------------------------------------------------------------- # overwrite update_command_selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) index = @command_window.index unless command_enabled?(index) Sound.play_buzzer return end Sound.play_decision case index # Item Command when $game_temp.menu_command_index[:item] $scene = Scene_Item.new # Skill, Equip, and Status Commands when $game_temp.menu_command_index[:skill], $game_temp.menu_command_index[:equip], $game_temp.menu_command_index[:status] start_actor_selection # Save Command when $game_temp.menu_command_index[:save] $scene = Scene_File.new(true, false, false) # System Command when $game_temp.menu_command_index[:game_end] $scene = Scene_End.new when $game_temp.menu_command_index[:OmegaQuest] $scene = Omega_Quest.new else # Custom Commands return_check = true for key in @ex_cmds if @ex_cmds[key[0]] == index return_check = false found_key = key[0] break end end return if return_check if found_key >= 101 and found_key <= 200 # Play a common event common_event = YE::REDUX::MENU::COMMON_EVENTS[found_key] $game_temp.common_event_id = common_event[3] $scene = Scene_Map.new else # Play an imported scene menu_command = YE::REDUX::MENU::IMPORTED_COMMANDS[found_key] if menu_command[2] start_actor_selection else $scene = eval(menu_command[4] + ".new") end end # End found_key end # End case check end end #-------------------------------------------------------------------------- # overwrite update_actor_selection #-------------------------------------------------------------------------- def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when $game_temp.menu_command_index[:skill] # Skill Command $scene = Scene_Skill.new(@status_window.index) when $game_temp.menu_command_index[:equip] # Equip Command $scene = Scene_Equip.new(@status_window.index) when $game_temp.menu_command_index[:status] # Status Command $scene = Scene_Status.new(@status_window.index) else # Custom Commands return_check = true for key in @ex_cmds if @ex_cmds[key[0]] == @command_window.index return_check = false found_key = key[0] break end end return if return_check menu_command = YE::REDUX::MENU::IMPORTED_COMMANDS[found_key] $scene = eval(menu_command[4] + ".new(@status_window.index)") end end end #-------------------------------------------------------------------------- # command_enabled? #-------------------------------------------------------------------------- def command_enabled?(index) if $game_system.save_disabled and index == $game_temp.menu_command_index[:save] return false end if $game_party.members.size == 0 and @disabled_command_index.include?(index) return false end for key in @ex_cmds if @ex_cmds[key[0]] == index return false if @disabled_command_index.include?(index) end end return true end #-------------------------------------------------------------------------- # overwrite initialize #-------------------------------------------------------------------------- def initialize(menu_index = YE::REDUX::MENU::START_INDEX) @menu_index = menu_index end #-------------------------------------------------------------------------- # alias start #-------------------------------------------------------------------------- alias start_menurd start unless $@ def start start_menurd if YE::REDUX::MENU::USE_REDUX_STATUS @status_window.dispose @status_window = Window_ReDuxMenuStatus.new(160, 0) end if YE::REDUX::MENU::USE_MULTI_VARIABLE_WINDOW @gold_window.dispose @gold_window = Window_MultiVariableWindow.new end if YE::REDUX::MENU::RIGHT_SIDE_COMMAND @status_window.x = 0 @command_window.x = Graphics.width - 160 @gold_window.x = Graphics.width - 160 end end #-------------------------------------------------------------------------- # overwrite create_command_window #-------------------------------------------------------------------------- def create_command_window commands = create_command_list if YE::REDUX::MENU::COMMAND_ICONS @command_window = Window_MenuCommand.new(160, commands) else @command_window = Window_Command.new(160, commands) end @command_window.height = [@command_window.height, YE::REDUX::MENU::MAX_ROWS * 24 + 32].min @command_window.index = [@menu_index, commands.size - 1].min set_command_enabled end end # Scene_Menu
#=============================================================================== # Scene_Map #===============================================================================
class Scene_Map < Scene_Base
#-------------------------------------------------------------------------- # overwrite update_call_menu #-------------------------------------------------------------------------- def update_call_menu if Input.trigger?(YE::REDUX::MENU::MENU_BUTTON) return if $game_map.interpreter.running? return if $game_system.menu_disabled $game_temp.menu_beep = true $game_temp.next_scene = "menu" end end end # Scene_Map
#============================================================================== # Imported from KGC's Custom Menu Command # to improve compatibility amongst KGC scripts #============================================================================== $imported["CustomMenuCommand"] = true class Game_Temp attr_accessor :menu_command_index attr_accessor :next_scene_actor_index alias initialize_KGC_CustomMenuCommand initialize unless $@ def initialize initialize_KGC_CustomMenuCommand
@menu_command_index = {} @next_scene_actor_index = 0 end end
module KGC module Commands module_function def call_item return if $game_temp.in_battle $game_temp.next_scene = :menu_item $game_temp.next_scene_actor_index = 0 $game_temp.menu_command_index = {} end def call_skill(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_skill $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_equip(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_equip $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_status(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_status $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end end end
class Game_Interpreter include KGC::Commands end
class Scene_Map < Scene_Base alias update_scene_change_KGC_CustomMenuCommand update_scene_change unless $@ def update_scene_change return if $game_player.moving? case $game_temp.next_scene when :menu_item call_menu_item when :menu_skill call_menu_skill when :menu_equip call_menu_equip when :menu_status call_menu_status else update_scene_change_KGC_CustomMenuCommand end end def call_menu_item $game_temp.next_scene = nil $scene = Scene_Item.new end def call_menu_skill $game_temp.next_scene = nil $scene = Scene_Skill.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_equip $game_temp.next_scene = nil $scene = Scene_Equip.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_status $game_temp.next_scene = nil $scene = Scene_Status.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end end
class Scene_Item < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:item) $scene = Scene_Menu.new($game_temp.menu_command_index[:item]) else $scene = Scene_Map.new end end end
unless $imported["SceneSkillReDux"] class Scene_Skill < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:skill) $scene = Scene_Menu.new($game_temp.menu_command_index[:skill]) else $scene = Scene_Map.new end end end end
unless $imported["SceneEquipReDux"] class Scene_Equip < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:equip) $scene = Scene_Menu.new($game_temp.menu_command_index[:equip]) else $scene = Scene_Map.new end end end end
unless $imported["SceneStatusReDux"] class Scene_Status < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:status) $scene = Scene_Menu.new($game_temp.menu_command_index[:status]) else $scene = Scene_Map.new end end end end
class Scene_File < Scene_Base alias return_scene_KGC_CustomMenuCommand return_scene unless $@ def return_scene if @from_title || @from_event return_scene_KGC_CustomMenuCommand elsif $game_temp.menu_command_index.has_key?(:save) $scene = Scene_Menu.new($game_temp.menu_command_index[:save]) else $scene = Scene_Map.new end end end
class Scene_End < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:game_end) $scene = Scene_Menu.new($game_temp.menu_command_index[:game_end]) else $scene = Scene_Map.new end end end
#=============================================================================== # Game_Map #===============================================================================
class Game_Map #-------------------------------------------------------------------------- # map name #-------------------------------------------------------------------------- unless method_defined?(:map_name) def map_name data = load_data("Data/MapInfos.rvdata") text = data[@map_id].name.gsub(/\[.*\]/) { "" } return text end end end # Game_Map
#=============================================================================== # Game_Actor #===============================================================================
class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # Now Exp - The experience gained for the current level. #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end #-------------------------------------------------------------------------- # Next Exp - The experience needed for the next level. #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end # Game_Actor
#=============================================================================== # Window_MenuCommand #===============================================================================
class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) rect.x += 4 rect.width -= 8 dx = rect.x dy = rect.y dw = rect.width dh = rect.height self.contents.clear_rect(rect) self.contents.font.color = normal_color if YE::REDUX::MENU::ICON_SETS.include?(@commands[index]) icon = YE::REDUX::MENU::ICON_SETS[@commands[index]] else icon = YE::REDUX::MENU::ICON_SETS["Unlisted"] end draw_icon(icon, dx, dy, enabled) self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(dx+24, dy, dw-24, dh, @commands[index]) end end # Window_MenuCommand
#=============================================================================== # Window_ReDuxMenuStatus #===============================================================================
class Window_ReDuxMenuStatus < Window_MenuStatus #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @item_max = $game_party.members.size create_contents fill_stand_by_background if $imported["LargeParty"] for actor in $game_party.members draw_rd_menu_actor(actor) x = 104 y = actor.index * 96 draw_actor_name(actor, x, y) draw_actor_class(actor, x + 120, y) draw_actor_level(actor, x, y + WLH * 1) draw_actor_state(actor, x, y + WLH * 2) draw_actor_hp(actor, x + 120, y + WLH * 1, 120) draw_actor_mp(actor, x + 120, y + WLH * 2, 120) draw_rd_menu_exp(actor, x + 120, y + WLH * 3, 120) end end #-------------------------------------------------------------------------- # draw_rd_menu_actor #-------------------------------------------------------------------------- def draw_rd_menu_actor(actor) case YE::REDUX::MENU::DRAWN_ACTOR_SETUP when 0 draw_actor_face(actor, 2, actor.index * 96 + 2, 92) when 1 offset = YE::REDUX::MENU::SPRITE_OFFSET draw_actor_graphic(actor, 49, (actor.index + 1) * 96 - offset) when 2 offset = YE::REDUX::MENU::SPRITE_OFFSET opacity = YE::REDUX::MENU::FACE_OPACITY face_name = actor.face_name face_index = actor.face_index bitmap = Cache.face(face_name) rect = Rect.new(0, 0, 0, 0) rect.x = face_index % 4 * 96 + 4 / 2 rect.y = face_index / 4 * 96 + 4 / 2 rect.width = 92 rect.height = 92 self.contents.blt(2, actor.index * 96 + 2, bitmap, rect, opacity) bitmap.dispose draw_actor_graphic(actor, 49, (actor.index + 1) * 96 - offset) end end #-------------------------------------------------------------------------- # draw_rd_menu_exp #-------------------------------------------------------------------------- def draw_rd_menu_exp(actor, x, y, size = 120) if actor.next_exp != 0 gw = size * actor.now_exp gw /= actor.next_exp else gw = size end gc1 = text_color(YE::REDUX::MENU::EXP_GAUGE_1) gc2 = text_color(YE::REDUX::MENU::EXP_GAUGE_2) self.contents.fill_rect(x, y + WLH - 8, size, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 40, WLH, YE::REDUX::MENU::EXP_TEXT) self.contents.font.color = normal_color if actor.next_exp != 0 expercent = actor.now_exp * 100.000 expercent /= actor.next_exp else expercent = 100.000 end expercent = 100.000 if expercent > 100.000 text = sprintf(YE::REDUX::MENU::PERCENT_EXP, expercent) self.contents.draw_text(x, y, size, WLH, text, 2) end end # Window_ReDuxMenuStatus
#=============================================================================== # Window_MultiVariableWindow #===============================================================================
class Window_MultiVariableWindow < Window_Selectable #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize dh = 32 + 24 * YE::REDUX::MENU::VARIABLES_SHOWN.size dy = Graphics.height - dh super(0, dy, 160, dh) refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for i in YE::REDUX::MENU::VARIABLES_SHOWN next unless YE::REDUX::MENU::VARIABLES_HASH.include?(i) @time_index = @data.size if i == -1 @data.push(i) end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) sw = self.width - 32 dy = WLH * index self.contents.clear_rect(rect) i = @data[index] case i when -5 # Draw Map Name self.contents.draw_text(0, dy, sw, WLH, $game_map.map_name, 1) when -2 # Draw Steps if YE::REDUX::MENU::VARIABLES_ICONS text = $game_party.steps self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[-2][0], sw-24, dy) else text = YE::REDUX::MENU::VARIABLES_HASH[-2][1] value = $game_party.steps cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end when -1 # Draw Time if YE::REDUX::MENU::VARIABLES_ICONS text = game_time self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[-1][0], sw-24, dy) else self.contents.font.color = normal_color text = game_time self.contents.draw_text(0, dy, sw, WLH, text, 1) end when 0 # Draw Gold if YE::REDUX::MENU::VARIABLES_ICONS text = $game_party.gold self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[0][0], sw-24, dy) else draw_currency_value($game_party.gold, 4, dy, 120) end else # Draw Variables if YE::REDUX::MENU::VARIABLES_ICONS text = $game_variables[i] self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[i][0], sw-24, dy) else text = YE::REDUX::MENU::VARIABLES_HASH[i][1] value = $game_variables[i] cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end end end #-------------------------------------------------------------------------- # game_time #-------------------------------------------------------------------------- def game_time @gametime = Graphics.frame_count / Graphics.frame_rate hours = @gametime / 3600 minutes = @gametime / 60 % 60 seconds = @gametime % 60 result = sprintf("%d:%02d:%02d", hours, minutes, seconds) return result end #-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- if YE::REDUX::MENU::VARIABLES_SHOWN.include?(-1) def update if @gametime != (Graphics.frame_count / Graphics.frame_rate) draw_item(@time_index) end end end end # Window_MultiVariableWindow
#=============================================================================== # # END OF FILE # #===============================================================================
|
|