|
| |
Auteur | Message |
---|
Mack Chevalier (niveau 5)
Messages postés : 126 Date d'inscription : 26/06/2013
| Sujet: Re: [Résolu] Un p'tit menu ? Sam 2 Mai 2015 - 15:35 | |
| Nope, ça vient pas du script de message, c'est moi qui ai fait une boulette xD. Remplace le script Menu par celui là : - Code:
-
#============================================================================== # ** Compact Menu #------------------------------------------------------------------------------ # Autor: The Sleeping Leonhart # Version: 1.2 # Release Date: 26/07/2008 #------------------------------------------------------------------------------ # Description: # This is an All in One menu where you can use item equipment and skill. #------------------------------------------------------------------------------ # Istruzioni: # Edit the images to suit tastes. # You must put the images of party in the Picture # and you must call it like the Battler graphic. #==============================================================================
class Game_Actor < Game_Battler def now_exp return @exp - @exp_list[@level] end def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end
class Window_Base < Window def draw_actor_exps(actor, x, y) self.contents.font.name = $fontface self.contents.font.color = system_color self.contents.draw_text(x, y, 28, 32, "Exp") self.contents.font.color = normal_color text = (actor.now_exp.to_s + " / " + actor.next_exp.to_s) self.contents.draw_text(x + 40, y, 84, 32, text.to_s) end def draw_actor_parameter(actor, x, y, type) self.contents.font.name = $fontface case type when 0 parameter_name = $data_system.words.atk parameter_value = actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = actor.str when 4 parameter_name = $data_system.words.dex parameter_value = actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = actor.agi when 6 parameter_name = $data_system.words.int parameter_value = actor.int when 7 parameter_name = "Evasion" parameter_value = actor.eva end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 48, y, 36, 32, parameter_value.to_s, 2) end end
class Window_MenuStatus < Window_Selectable def initialize(actor) super(220, 48, 480, 96+32) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.contents.font.name = $fontface @actor = actor @stats = [0,0,0, 0,0,0,0] for i in 0..6 case i when 0 parameter_value = @actor.atk when 1 parameter_value = @actor.pdef when 2 parameter_value = @actor.mdef when 3 parameter_value = @actor.str when 4 parameter_value = @actor.dex when 5 parameter_value = @actor.agi when 6 parameter_value = @actor.int end @stats[i] = parameter_value end refresh self.active = false self.index = -1 end def refresh self.contents.clear @item_max = 1 x = 0 y = 0 actor = @actor self.contents.font.size = 14 #draw_actor_name(actor, x, y) draw_actor_hp(actor, x, y+42) draw_actor_sp(actor, x, y+54) draw_actor_state(actor, x, y) draw_actor_level(actor, x, y + 18) draw_actor_exps(actor, x, y + 30) #draw_actor_parameter(actor, x + 92+48, y + 16+8, 0) #draw_actor_parameter(actor, x + 92+48, y + 32+8, 1) #draw_actor_parameter(actor, x + 92+48, y + 48+8, 2) #draw_actor_parameter(actor, x + 232+48, y + 64, 6) #draw_actor_parameter(actor, x + 232+48, y + 16, 3) #draw_actor_parameter(actor, x + 232+48, y + 32, 4) #draw_actor_parameter(actor, x + 232+48, y + 48, 5) for i in 0..6 case i when 0 parameter_name = $data_system.words.atk parameter_value = @actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = @actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = @actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = @actor.str when 4 parameter_name = $data_system.words.dex parameter_value = @actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = @actor.agi when 6 parameter_name = $data_system.words.int parameter_value = @actor.int end if (parameter_value > @stats[i]) self.contents.font.color = Color.new(255, 0, 0, 255) elsif (parameter_value < @stats[i]) self.contents.font.color = Color.new(0, 255, 0, 255) else self.contents.font.color = normal_color end if (i<3) self.contents.draw_text(x + 92 + 48+48, y + 16 +16 * i + 16, 36, 32, @stats[i].to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x + 92 + 48, y + 16 +16 * i + 16, 120, 32, parameter_name) else self.contents.draw_text(x + 232 + 48+48, y + 16 +16 * (i-4) + 16, 36, 32, @stats[i].to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x + 232 + 48, y + 16 +16 * (i-4) + 16, 120, 32, parameter_name) end end #draw_actor_parameter(actor, x + 236, y + 64, 7) self.contents.font.color = normal_color id = @actor.skills[0] if ( $data_skills[id] != nil) self.contents.draw_text(x+180, y, 180, 32, $data_skills[id].name, 2) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 96, self.width - 32, 96) end end def set_stats(s) @stats = s refresh end end
class Window_MenuItem < Window_Selectable def initialize super(287, 300, 278, 32+24*5) @column_max = 10 refresh self.index = 0 self.opacity = 0 end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 24) self.contents.font.name = $fontface for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = index % 10 * 24 y = index / 10 * 24 rect = Rect.new(x, y, 24, 24) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.font.size = 14 bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y - 1, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 12, y + 4, 24, 32, number.to_s) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.name, self.item == nil ? "" : self.item.description) end def update_cursor_rect if self.active if @index < 0 self.cursor_rect.empty return end row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + 1 self.top_row = row - 1 end cursor_width = self.width / @column_max - 32 i = 24 self.oy = (self.oy/80)*i x = @index % @column_max * 24 y = @index / @column_max * 24 - (self.oy/i)*i - 1 self.cursor_rect.set(x, y, 24, 24) else self.cursor_rect.set(0, 0, 0, 0) end end end
class Window_Target < Window_Selectable def initialize super(0, 0, $game_party.actors.size*48+32, 96) self.contents = Bitmap.new(width - 32, height - 32) self.z += 10 @column_max = @item_max = $game_party.actors.size refresh end def refresh self.contents.clear for i in 0...$game_party.actors.size x = 48*i+24 y = 52 actor = $game_party.actors[i] draw_actor_graphic(actor, x, y) end end def update_cursor_rect if @index <= -2 self.cursor_rect.set((@index + 10) * 48, 0, 48, 64) elsif @index == -1 self.cursor_rect.set(0, 0, @item_max * 48, 64) else self.cursor_rect.set(@index * 48, 0, 48, 64) end end end
class Window_MenuEquipped < Window_Selectable def initialize(actor) super(272, 150, 334, 16*7+32) self.contents = Bitmap.new(width - 32, 32 * 4 - 32) self.opacity = 0 self.active = false self.index = 0 @item_max = 5 @column_max = 1 @actor = actor self.contents.font.name = $fontface refresh end def item return @data[self.index] end def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) @item_max = @data.size self.contents.font.color = system_color self.contents.font.size = 16 h = 16 self.contents.draw_text(16, h * 0, 92, 32, $data_system.words.weapon) self.contents.draw_text(16, h * 1, 92, 32, $data_system.words.armor1) self.contents.draw_text(16, h * 2, 92, 32, $data_system.words.armor2) self.contents.draw_text(16, h * 3, 92, 32, $data_system.words.armor3) self.contents.draw_text(16, h * 4, 92, 32, $data_system.words.armor4) draw_item_name(@data[0], 92, h * 0) draw_item_name(@data[1], 92, h * 1) draw_item_name(@data[2], 92, h * 2) draw_item_name(@data[3], 92, h * 3) draw_item_name(@data[4], 92, h * 4) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.name, self.item == nil ? "" : self.item.description) end def draw_item_name(item, x, y) if item == nil return end self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 212, 32, item.name) end def update_cursor_rect if self.active y = @index % 5 * 16 self.cursor_rect.set(12, y + 9, 244, 16) self.oy = (@index - @index % 5) * 16 else self.cursor_rect.set(0, 0, 0, 0) end end end
class Window_MenuEquip < Window_Selectable attr_reader :data def initialize(actor, type) super(287, 243, 272, 56) @actor = actor @column_max = 10 @row_max = 1 @equip_type = type self.index = 0 self.opacity = 0 self.active = false refresh end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] if @equip_type == 0 weapon_set = $data_classes[@actor.class_id].weapon_set for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) @data.push($data_weapons[i]) end end end if @equip_type != 0 armor_set = $data_classes[@actor.class_id].armor_set for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 and armor_set.include?(i) if $data_armors[i].kind == @equip_type-1 @data.push($data_armors[i]) end end end end @data.push(nil) @item_max = @data.size col = @item_max / 10 self.contents = Bitmap.new(width - 32, 24 * col + 24) self.contents.font.name = $fontface for i in 0...@item_max-1 draw_item(i) end end def draw_item(index) item = @data[index] case item when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end x = index % 10 * 24 y = index / 10 * 24 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.font.size = 14 bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x+12,y+8,128,24, number.to_s) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.name, self.item == nil ? "" : self.item.description) end def update_cursor_rect if self.active self.cursor_rect.set(@index % 10 * 24, 0, 24, 24) self.oy = index / 10 * 24 else self.cursor_rect.set(0, 0, 0, 0) end end def update #super if self.active and @item_max > 0 and @index >= 0 if Input.repeat?(Input::DOWN) if @column_max >= 2 and @index < @item_max - 1 $game_system.se_play($data_system.cursor_se) @index += 1 end end if Input.repeat?(Input::UP) if @column_max >= 2 and @index > 0 $game_system.se_play($data_system.cursor_se) @index -= 1 end end if Input.repeat?(Input::RIGHT) if @column_max >= 2 and @index < @item_max - 1 $game_system.se_play($data_system.cursor_se) @index += 1 end end if Input.repeat?(Input::LEFT) if @column_max >= 2 and @index > 0 $game_system.se_play($data_system.cursor_se) @index -= 1 end end if Input.repeat?(Input::R) if self.top_row + (self.page_row_max - 1) < (self.row_max - 1) $game_system.se_play($data_system.cursor_se) @index = [@index + self.page_item_max, @item_max - 1].min self.top_row += self.page_row_max end end if Input.repeat?(Input::L) if self.top_row > 0 $game_system.se_play($data_system.cursor_se) @index = [@index - self.page_item_max, 0].max self.top_row -= self.page_row_max end end end if self.active and @help_window != nil update_help end update_cursor_rect end end
class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main @actor_index = 0 @target = "" scene_window Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze scene_dispose end def scene_window @actor = $game_party.actors[@actor_index] @map = Spriteset_Map.new @bg = Sprite.new @bg.bitmap = Bitmap.new("Graphics/Pictures/MenuBG") @pg = Sprite.new i = $game_variables[@actor.id+0] @pg.bitmap = Bitmap.new("Graphics/Pictures/" + @actor.battler_name+"_"+i.to_s) @pg.y = 64 @arrow = Sprite.new @arrow.x = 198 @arrow.y = 52 @arrow.bitmap = Bitmap.new("Graphics/Pictures/Arrow") @lr = Sprite.new @lr.bitmap = Bitmap.new("Graphics/Pictures/LR") if $game_party.actors.size > 1 s1 = "" @command_window = Window_Command.new(160, [s1, s1, s1, s1]) @use_window = Window_Command.new(160, ["Utiliser","Jeter"]) @use_window.visible = false @use_window.active = false @use_window.z = 999 @use_window.x = 292 @use_window.y = 300 - 80 @menu_index = 3 if @menu_index == 4 @menu_index = 4 if @menu_index == 5 @command_window.index = @menu_index @command_window.visible = false 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 @help_window = Window_HelpMenu.new @help_window.opacity = 0 @item_window = Window_MenuItem.new @status_window = Window_MenuStatus.new(@actor) @target_window = Window_Target.new @right_window = Window_MenuEquipped.new(@actor) @item_window1 = Window_MenuEquip.new(@actor, 0) @item_window2 = Window_MenuEquip.new(@actor, 1) @item_window3 = Window_MenuEquip.new(@actor, 2) @item_window4 = Window_MenuEquip.new(@actor, 3) @item_window5 = Window_MenuEquip.new(@actor, 4) tab = [""] @skill_command_window = Window_CommandSpe.new(192, tab) tab = [""] @equip_command_window = Window_CommandSpe.new(192, tab) @equip_command_window.active = false @equip_command_window.visible = false @item_window.help_window = @help_window @right_window.help_window = @help_window @item_window1.help_window = @help_window @item_window2.help_window = @help_window @item_window3.help_window = @help_window @item_window4.help_window = @help_window @item_window5.help_window = @help_window @item_equip_window = @item_window1 @item_window1.visible = false @item_window2.visible = false @item_window3.visible = false @item_window4.visible = false @item_window5.visible = false @item_window.active = false @help_window.visible = false @target_window.visible = false @target_window.active = false @skill_command_window.active = false @skill_command_window.visible = false end def scene_dispose @use_window.dispose @command_window.dispose @item_window.dispose @item_window1.dispose @item_window2.dispose @item_window3.dispose @item_window4.dispose @item_window5.dispose @status_window.dispose @target_window.dispose @right_window.dispose @help_window.dispose @map.dispose @bg.dispose @pg.dispose @arrow.dispose @lr.dispose @equip_command_window.dispose end def update @equip_command_window.update @skill_command_window.update @use_window.update @command_window.update @item_window.update @item_window1.update @item_window2.update @item_window3.update @item_window4.update @item_window5.update @status_window.update @target_window.update @right_window.update @map.update case @right_window.index when 0 @item_equip_window.visible = false @item_equip_window = @item_window1 @item_equip_window.visible = true when 1 @item_equip_window.visible = false @item_equip_window = @item_window2 @item_equip_window.visible = true when 2 @item_equip_window.visible = false @item_equip_window = @item_window3 @item_equip_window.visible = true when 3 @item_equip_window.visible = false @item_equip_window = @item_window4 @item_equip_window.visible = true when 4 @item_equip_window.visible = false @item_equip_window = @item_window5 @item_equip_window.visible = true end if $game_party.actors.size > 1 if Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) @actor_index += 1 @actor_index %= $game_party.actors.size scene_dispose scene_window return end if Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size scene_dispose scene_window return end end if @skill_command_window.active update_skill return end if @command_window.active update_command return end if (@use_window.active) update_use_item return end if @item_window.active update_item return end if @right_window.active update_right return end if @item_equip_window.active update_equip_item return end if @target_window.active update_item_target if @target == "item" update_skill_target if @target == "skill" return end end def update_command case @command_window.index when 0 @help_window.set_text("Show and use skill.","") @arrow.x = 198 @arrow.y = 52 when 2 @help_window.set_text("Show and use item.","") @arrow.x = 264 @arrow.y = 300 when 1 @help_window.set_text("Equip Weapon and Armor.","") @arrow.x = 264 @arrow.y = 170 when 3 @help_window.set_text("Save the game progress.","") @arrow.x = 556 @arrow.y = 464 when 4 @help_window.set_text("Exit.","") @arrow.x = 590 @arrow.y = 464 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 $game_system.se_play($data_system.decision_se) tab = [] for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill != nil tab.push(skill.name) end end @skill_command_window = Window_CommandSpe.new(192, tab) @command_window.active = false @skill_command_window.active = true @skill_command_window.visible = true when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @item_window.active = true when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @right_window.active = true when 3 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 4 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end end def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @item_window.active = false @command_window.active = true return end if Input.trigger?(Input::C) @item_window.active = false @use_window.active = true @use_window.visible = true return end end def update_use_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = false @item_window.active = true @item_window.help_window.active = true @use_window.active = false @use_window.visible = false @target_window.visible = false @target_window.active = false return end if Input.trigger?(Input::C) if (@use_window.index==1) @item = @item_window.item $game_party.lose_item(@item.id, 1) @item_window.refresh if ($game_party.item_number(@item.id)<=0) @command_window.active = false @item_window.active = true @item_window.help_window.active = true @use_window.active = false @use_window.visible = false @target_window.visible = false @target_window.active = false end else @use_window.active = false @use_window.visible = false @item = @item_window.item unless @item.is_a?(RPG::Item) $game_system.se_play($data_system.buzzer_se) @use_window.active = true @use_window.visible = true return end unless $game_party.item_can_use?(@item.id) $game_system.se_play($data_system.buzzer_se) @use_window.active = true @use_window.visible = true return end $game_system.se_play($data_system.decision_se) if @item.scope >= 3 @item_window.active = false @target_window.x = 287 @target_window.y = 355 @target_window.visible = true @target_window.active = true @target = "item" if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end else if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end $scene = Scene_Map.new return end end return end end def update_item_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) unless $game_party.item_can_use?(@item.id) @item_window.refresh end @target = "" @item_window.active = true @target_window.visible = false @target_window.active = false return end if Input.trigger?(Input::C) if $game_party.item_number(@item.id) == 0 $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.item_effect(@item) end end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.item_effect(@item) end if used $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $scene = Scene_Map.new return end @status_window.refresh end unless used $game_system.se_play($data_system.buzzer_se) end return end if ($game_party.item_number(@item.id)<=0) $game_system.se_play($data_system.cancel_se) unless $game_party.item_can_use?(@item.id) @item_window.refresh end @target = "" @item_window.active = true @target_window.visible = false @target_window.active = false return end end end def update_skill if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @skill_command_window.active = false @skill_command_window.visible = false @command_window.active = true return end if Input.trigger?(Input::C) @skill = $data_skills[@actor.skills[@skill_command_window.index]] if @skill == nil or not @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) if @skill.scope >= 3 @skill_command_window.active = false @target_window.x = 287 @target_window.y = 299 @target_window.visible = true @target_window.active = true @target = "skill" if @skill.scope == 4 || @skill.scope == 6 @target_window.index = -1 elsif @skill.scope == 7 @target_window.index = @actor_index - 10 else @target_window.index = 0 end else if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $game_system.se_play(@skill.menu_se) @status_window.refresh @skill_command_window.refresh @target_window.refresh $scene = Scene_Map.new return end end return end end def update_skill_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @skill_command_window.active = true @target_window.visible = false @target_window.active = false @target = "" return end if Input.trigger?(Input::C) unless @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.skill_effect(@actor, @skill) end end if @target_window.index <= -2 target = $game_party.actors[@target_window.index + 10] used = target.skill_effect(@actor, @skill) end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.skill_effect(@actor, @skill) end if used $game_system.se_play(@skill.menu_se) @actor.sp -= @skill.sp_cost @status_window.refresh @skill_command_window.refresh @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $scene = Scene_Map.new return end end unless used $game_system.se_play($data_system.buzzer_se) end return end end def update_right if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @right_window.active = false @right_window.help_window.visible = false @command_window.active = true return end if Input.trigger?(Input::C) if @actor.equip_fix?(@right_window.index) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @right_window.active = false @item_equip_window.active = true tab = [] for i in 0...@item_equip_window.data.size if (@item_equip_window.data[i] != nil) tab.push(@item_equip_window.data[i].name) else tab.push("") end end @equip_command_window = Window_CommandSpe.new(192-24, tab) @equip_command_window.x = 480-96-8 if (@right_window.index==0) @equip_command_window.y = 130 +16 else @equip_command_window.y = 130 + @right_window.index * 16 end @equip_command_window.visible = true @equip_command_window.active = true return end end def update_equip_item @equip_command_window.index = @item_equip_window.index last_hp = @actor.hp last_sp = @actor.sp item1 = @item_equip_window.item item2 = @right_window.item @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) stats = [@actor.atk, @actor.pdef, @actor.mdef,@actor.str, @actor.dex,@actor.agi,@actor.int] @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) @actor.hp = last_hp @actor.sp = last_sp @status_window.set_stats(stats) if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @right_window.active = true @item_equip_window.help_window.visible = false @item_equip_window.active = false @equip_command_window.visible = false @equip_command_window.active = false stats = [@actor.atk, @actor.pdef, @actor.mdef,@actor.str, @actor.dex,@actor.agi,@actor.int] @status_window.set_stats(stats) return end if Input.trigger?(Input::C) $game_system.se_play($data_system.equip_se) type = @right_window.index item = @item_equip_window.item @actor.equip(type, item == nil ? 0 : item.id) @right_window.active = true @item_equip_window.active = false @right_window.refresh @item_equip_window.refresh @status_window.refresh @equip_command_window.visible = false @equip_command_window.active = false stats = [@actor.atk, @actor.pdef, @actor.mdef,@actor.str, @actor.dex,@actor.agi,@actor.int] @status_window.set_stats(stats) return end end end ( Si ça marche toujours pas par contre, envoie moi une démo fonctionnelle avec tout les scripts que tu utilises, ça sera plus facile à débuguer ) |
| | | Raven Administrateur
Messages postés : 1338 Date d'inscription : 20/04/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 12:06 | |
| Hello ! Bon j'viens voir un peu si quelqu'un peu pas filer un p'tit coup d'main. Petit résumé des épisodes précédents : > En fait j'ai ajouté le script de Mack à mon jeu. Mais son script est donc entré en conflit avec celui de "Advanced Message" (comme précisé plus haut). Du coup dès qu'on veut accéder au menu, le jeu se ferme à cause d'un bug. J'ai enlevé les scripts qu'il avait fait et le bug est resté (alors qu'avant je l'avais pas). J'ai probablement fais une fausse manip, je sais pas trop, je suis assez déconcerté. > Il m'a donc filé un truc pour régler le problème, un code puisque ce sont ces lignes là qui buggent : - Code:
-
unless @opacity_text_buf.disposed?
@opacity_text_buf.dispose
end J'ai donc remplacé par ce qu'il m'avait dit : - Code:
-
if (@opacity_text_buf) unless @opacity_text_buf.disposed? @opacity_text_buf.dispose end end Le problème c'est que ça me désactive purement et simplement le script (dont j'ai quand même besoin, et j'peux plus afficher mes boites de dialogues normales en haut et en transparence en même temps, pourtant c'est une fonction de base de rmxp). Du coup j'me dis que plusieurs têtes valent mieux qu'une et demi (oui, je compte pour la demi) et que si quelqu'un comprenait ce qu'il se passe, bah ça m'permettrait de finir la démo pour les temps que j'ai prévu x). Je sais que Mack essaie encore de résoudre le bug, et j'pense que ça doit pas mal lui fais un Mindfuck xD EDIT : Ah et puis j'peux plus appeler d'évènement commun (ou afficher d'images), ça bug dans le script advanced_message à ce niveau là: - Code:
-
self.cursor_rect.set(8 + @indent + @face_indent, n * 32, @cursor_width, 32) Merci d'avance à vous ! |
| | | Kasbak Membre V.I.P.
Messages postés : 1356 Date d'inscription : 05/01/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 13:06 | |
| Après c'est bizarre parce que si tu met juste l'advanced message et le script du menu dans un projet neuf (je viens d'essayer)tout fonctionne très bien donc c'est peu etre liè à un autre script,meme si l'erreur s'affiche ailleurs,ça me l'avait déjà fait sur des projets.Tu utilise quoi comme autres scripts ? |
| | | Raven Administrateur
Messages postés : 1338 Date d'inscription : 20/04/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 13:13 | |
| Oui j'en ai d'autres, tiens voilà la demo
Dernière édition par Raven le Dim 3 Mai 2015 - 19:27, édité 1 fois |
| | | Kasbak Membre V.I.P.
Messages postés : 1356 Date d'inscription : 05/01/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 13:35 | |
| Bah la juste dans la démo tu colle le advanced au dessus de main sa bug plus...j'ai mis le script du menu ça marche aussi,l'image saffiche aussi et l'event commun marche. |
| | | Raven Administrateur
Messages postés : 1338 Date d'inscription : 20/04/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 13:42 | |
| Alors effectivement, j'ai remis le advanced juste au dessus et ça remarche x) Comme quoi... Par conte le script menu bug :/ (cette fois ci à la ligne 177 du script menu) |
| | | Kasbak Membre V.I.P.
Messages postés : 1356 Date d'inscription : 05/01/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 14:13 | |
| Pour les lignes qui bug c'est surement du à un truc ajouter dans le script entre la version d'origine et celle que tu utilise,Mack va surement savoir d'où ça vient.Au pire tu peut mettre ça en attendant. - Code:
-
#draw_actor_parameter(actor, x + 236, y + 64, 7) # if ($game_temp.test == nil) # $game_temp.test = @actor.skills[0] # end # if ($game_temp.test >= 0) # self.contents.draw_text(x+180, y, 180, 32, $data_skills[$game_temp.test].name, 2) # end |
| | | Raven Administrateur
Messages postés : 1338 Date d'inscription : 20/04/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 14:19 | |
| Ah bah du coup ça m'fait un bug sur le script Menu. J'vais enlever les deux scripts menus pour le moment :p |
| | | Mack Chevalier (niveau 5)
Messages postés : 126 Date d'inscription : 26/06/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 14:30 | |
| - Mack a écrit:
- Nope, ça vient pas du script de message, c'est moi qui ai fait une boulette xD.
Remplace le script Menu par celui là : - Code:
-
#============================================================================== # ** Compact Menu #------------------------------------------------------------------------------ # Autor: The Sleeping Leonhart # Version: 1.2 # Release Date: 26/07/2008 #------------------------------------------------------------------------------ # Description: # This is an All in One menu where you can use item equipment and skill. #------------------------------------------------------------------------------ # Istruzioni: # Edit the images to suit tastes. # You must put the images of party in the Picture # and you must call it like the Battler graphic. #==============================================================================
class Game_Actor < Game_Battler def now_exp return @exp - @exp_list[@level] end def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end
class Window_Base < Window def draw_actor_exps(actor, x, y) self.contents.font.name = $fontface self.contents.font.color = system_color self.contents.draw_text(x, y, 28, 32, "Exp") self.contents.font.color = normal_color text = (actor.now_exp.to_s + " / " + actor.next_exp.to_s) self.contents.draw_text(x + 40, y, 84, 32, text.to_s) end def draw_actor_parameter(actor, x, y, type) self.contents.font.name = $fontface case type when 0 parameter_name = $data_system.words.atk parameter_value = actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = actor.str when 4 parameter_name = $data_system.words.dex parameter_value = actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = actor.agi when 6 parameter_name = $data_system.words.int parameter_value = actor.int when 7 parameter_name = "Evasion" parameter_value = actor.eva end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 48, y, 36, 32, parameter_value.to_s, 2) end end
class Window_MenuStatus < Window_Selectable def initialize(actor) super(220, 48, 480, 96+32) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.contents.font.name = $fontface @actor = actor @stats = [0,0,0, 0,0,0,0] for i in 0..6 case i when 0 parameter_value = @actor.atk when 1 parameter_value = @actor.pdef when 2 parameter_value = @actor.mdef when 3 parameter_value = @actor.str when 4 parameter_value = @actor.dex when 5 parameter_value = @actor.agi when 6 parameter_value = @actor.int end @stats[i] = parameter_value end refresh self.active = false self.index = -1 end def refresh self.contents.clear @item_max = 1 x = 0 y = 0 actor = @actor self.contents.font.size = 14 #draw_actor_name(actor, x, y) draw_actor_hp(actor, x, y+42) draw_actor_sp(actor, x, y+54) draw_actor_state(actor, x, y) draw_actor_level(actor, x, y + 18) draw_actor_exps(actor, x, y + 30) #draw_actor_parameter(actor, x + 92+48, y + 16+8, 0) #draw_actor_parameter(actor, x + 92+48, y + 32+8, 1) #draw_actor_parameter(actor, x + 92+48, y + 48+8, 2) #draw_actor_parameter(actor, x + 232+48, y + 64, 6) #draw_actor_parameter(actor, x + 232+48, y + 16, 3) #draw_actor_parameter(actor, x + 232+48, y + 32, 4) #draw_actor_parameter(actor, x + 232+48, y + 48, 5) for i in 0..6 case i when 0 parameter_name = $data_system.words.atk parameter_value = @actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = @actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = @actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = @actor.str when 4 parameter_name = $data_system.words.dex parameter_value = @actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = @actor.agi when 6 parameter_name = $data_system.words.int parameter_value = @actor.int end if (parameter_value > @stats[i]) self.contents.font.color = Color.new(255, 0, 0, 255) elsif (parameter_value < @stats[i]) self.contents.font.color = Color.new(0, 255, 0, 255) else self.contents.font.color = normal_color end if (i<3) self.contents.draw_text(x + 92 + 48+48, y + 16 +16 * i + 16, 36, 32, @stats[i].to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x + 92 + 48, y + 16 +16 * i + 16, 120, 32, parameter_name) else self.contents.draw_text(x + 232 + 48+48, y + 16 +16 * (i-4) + 16, 36, 32, @stats[i].to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x + 232 + 48, y + 16 +16 * (i-4) + 16, 120, 32, parameter_name) end end #draw_actor_parameter(actor, x + 236, y + 64, 7) self.contents.font.color = normal_color id = @actor.skills[0] if ( $data_skills[id] != nil) self.contents.draw_text(x+180, y, 180, 32, $data_skills[id].name, 2) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 96, self.width - 32, 96) end end def set_stats(s) @stats = s refresh end end
class Window_MenuItem < Window_Selectable def initialize super(287, 300, 278, 32+24*5) @column_max = 10 refresh self.index = 0 self.opacity = 0 end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 24) self.contents.font.name = $fontface for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = index % 10 * 24 y = index / 10 * 24 rect = Rect.new(x, y, 24, 24) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.font.size = 14 bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y - 1, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 12, y + 4, 24, 32, number.to_s) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.name, self.item == nil ? "" : self.item.description) end def update_cursor_rect if self.active if @index < 0 self.cursor_rect.empty return end row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + 1 self.top_row = row - 1 end cursor_width = self.width / @column_max - 32 i = 24 self.oy = (self.oy/80)*i x = @index % @column_max * 24 y = @index / @column_max * 24 - (self.oy/i)*i - 1 self.cursor_rect.set(x, y, 24, 24) else self.cursor_rect.set(0, 0, 0, 0) end end end
class Window_Target < Window_Selectable def initialize super(0, 0, $game_party.actors.size*48+32, 96) self.contents = Bitmap.new(width - 32, height - 32) self.z += 10 @column_max = @item_max = $game_party.actors.size refresh end def refresh self.contents.clear for i in 0...$game_party.actors.size x = 48*i+24 y = 52 actor = $game_party.actors[i] draw_actor_graphic(actor, x, y) end end def update_cursor_rect if @index <= -2 self.cursor_rect.set((@index + 10) * 48, 0, 48, 64) elsif @index == -1 self.cursor_rect.set(0, 0, @item_max * 48, 64) else self.cursor_rect.set(@index * 48, 0, 48, 64) end end end
class Window_MenuEquipped < Window_Selectable def initialize(actor) super(272, 150, 334, 16*7+32) self.contents = Bitmap.new(width - 32, 32 * 4 - 32) self.opacity = 0 self.active = false self.index = 0 @item_max = 5 @column_max = 1 @actor = actor self.contents.font.name = $fontface refresh end def item return @data[self.index] end def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) @item_max = @data.size self.contents.font.color = system_color self.contents.font.size = 16 h = 16 self.contents.draw_text(16, h * 0, 92, 32, $data_system.words.weapon) self.contents.draw_text(16, h * 1, 92, 32, $data_system.words.armor1) self.contents.draw_text(16, h * 2, 92, 32, $data_system.words.armor2) self.contents.draw_text(16, h * 3, 92, 32, $data_system.words.armor3) self.contents.draw_text(16, h * 4, 92, 32, $data_system.words.armor4) draw_item_name(@data[0], 92, h * 0) draw_item_name(@data[1], 92, h * 1) draw_item_name(@data[2], 92, h * 2) draw_item_name(@data[3], 92, h * 3) draw_item_name(@data[4], 92, h * 4) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.name, self.item == nil ? "" : self.item.description) end def draw_item_name(item, x, y) if item == nil return end self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 212, 32, item.name) end def update_cursor_rect if self.active y = @index % 5 * 16 self.cursor_rect.set(12, y + 9, 244, 16) self.oy = (@index - @index % 5) * 16 else self.cursor_rect.set(0, 0, 0, 0) end end end
class Window_MenuEquip < Window_Selectable attr_reader :data def initialize(actor, type) super(287, 243, 272, 56) @actor = actor @column_max = 10 @row_max = 1 @equip_type = type self.index = 0 self.opacity = 0 self.active = false refresh end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] if @equip_type == 0 weapon_set = $data_classes[@actor.class_id].weapon_set for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) @data.push($data_weapons[i]) end end end if @equip_type != 0 armor_set = $data_classes[@actor.class_id].armor_set for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 and armor_set.include?(i) if $data_armors[i].kind == @equip_type-1 @data.push($data_armors[i]) end end end end @data.push(nil) @item_max = @data.size col = @item_max / 10 self.contents = Bitmap.new(width - 32, 24 * col + 24) self.contents.font.name = $fontface for i in 0...@item_max-1 draw_item(i) end end def draw_item(index) item = @data[index] case item when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end x = index % 10 * 24 y = index / 10 * 24 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.font.size = 14 bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x+12,y+8,128,24, number.to_s) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.name, self.item == nil ? "" : self.item.description) end def update_cursor_rect if self.active self.cursor_rect.set(@index % 10 * 24, 0, 24, 24) self.oy = index / 10 * 24 else self.cursor_rect.set(0, 0, 0, 0) end end def update #super if self.active and @item_max > 0 and @index >= 0 if Input.repeat?(Input::DOWN) if @column_max >= 2 and @index < @item_max - 1 $game_system.se_play($data_system.cursor_se) @index += 1 end end if Input.repeat?(Input::UP) if @column_max >= 2 and @index > 0 $game_system.se_play($data_system.cursor_se) @index -= 1 end end if Input.repeat?(Input::RIGHT) if @column_max >= 2 and @index < @item_max - 1 $game_system.se_play($data_system.cursor_se) @index += 1 end end if Input.repeat?(Input::LEFT) if @column_max >= 2 and @index > 0 $game_system.se_play($data_system.cursor_se) @index -= 1 end end if Input.repeat?(Input::R) if self.top_row + (self.page_row_max - 1) < (self.row_max - 1) $game_system.se_play($data_system.cursor_se) @index = [@index + self.page_item_max, @item_max - 1].min self.top_row += self.page_row_max end end if Input.repeat?(Input::L) if self.top_row > 0 $game_system.se_play($data_system.cursor_se) @index = [@index - self.page_item_max, 0].max self.top_row -= self.page_row_max end end end if self.active and @help_window != nil update_help end update_cursor_rect end end
class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main @actor_index = 0 @target = "" scene_window Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze scene_dispose end def scene_window @actor = $game_party.actors[@actor_index] @map = Spriteset_Map.new @bg = Sprite.new @bg.bitmap = Bitmap.new("Graphics/Pictures/MenuBG") @pg = Sprite.new i = $game_variables[@actor.id+0] @pg.bitmap = Bitmap.new("Graphics/Pictures/" + @actor.battler_name+"_"+i.to_s) @pg.y = 64 @arrow = Sprite.new @arrow.x = 198 @arrow.y = 52 @arrow.bitmap = Bitmap.new("Graphics/Pictures/Arrow") @lr = Sprite.new @lr.bitmap = Bitmap.new("Graphics/Pictures/LR") if $game_party.actors.size > 1 s1 = "" @command_window = Window_Command.new(160, [s1, s1, s1, s1]) @use_window = Window_Command.new(160, ["Utiliser","Jeter"]) @use_window.visible = false @use_window.active = false @use_window.z = 999 @use_window.x = 292 @use_window.y = 300 - 80 @menu_index = 3 if @menu_index == 4 @menu_index = 4 if @menu_index == 5 @command_window.index = @menu_index @command_window.visible = false 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 @help_window = Window_HelpMenu.new @help_window.opacity = 0 @item_window = Window_MenuItem.new @status_window = Window_MenuStatus.new(@actor) @target_window = Window_Target.new @right_window = Window_MenuEquipped.new(@actor) @item_window1 = Window_MenuEquip.new(@actor, 0) @item_window2 = Window_MenuEquip.new(@actor, 1) @item_window3 = Window_MenuEquip.new(@actor, 2) @item_window4 = Window_MenuEquip.new(@actor, 3) @item_window5 = Window_MenuEquip.new(@actor, 4) tab = [""] @skill_command_window = Window_CommandSpe.new(192, tab) tab = [""] @equip_command_window = Window_CommandSpe.new(192, tab) @equip_command_window.active = false @equip_command_window.visible = false @item_window.help_window = @help_window @right_window.help_window = @help_window @item_window1.help_window = @help_window @item_window2.help_window = @help_window @item_window3.help_window = @help_window @item_window4.help_window = @help_window @item_window5.help_window = @help_window @item_equip_window = @item_window1 @item_window1.visible = false @item_window2.visible = false @item_window3.visible = false @item_window4.visible = false @item_window5.visible = false @item_window.active = false @help_window.visible = false @target_window.visible = false @target_window.active = false @skill_command_window.active = false @skill_command_window.visible = false end def scene_dispose @use_window.dispose @command_window.dispose @item_window.dispose @item_window1.dispose @item_window2.dispose @item_window3.dispose @item_window4.dispose @item_window5.dispose @status_window.dispose @target_window.dispose @right_window.dispose @help_window.dispose @map.dispose @bg.dispose @pg.dispose @arrow.dispose @lr.dispose @equip_command_window.dispose end def update @equip_command_window.update @skill_command_window.update @use_window.update @command_window.update @item_window.update @item_window1.update @item_window2.update @item_window3.update @item_window4.update @item_window5.update @status_window.update @target_window.update @right_window.update @map.update case @right_window.index when 0 @item_equip_window.visible = false @item_equip_window = @item_window1 @item_equip_window.visible = true when 1 @item_equip_window.visible = false @item_equip_window = @item_window2 @item_equip_window.visible = true when 2 @item_equip_window.visible = false @item_equip_window = @item_window3 @item_equip_window.visible = true when 3 @item_equip_window.visible = false @item_equip_window = @item_window4 @item_equip_window.visible = true when 4 @item_equip_window.visible = false @item_equip_window = @item_window5 @item_equip_window.visible = true end if $game_party.actors.size > 1 if Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) @actor_index += 1 @actor_index %= $game_party.actors.size scene_dispose scene_window return end if Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size scene_dispose scene_window return end end if @skill_command_window.active update_skill return end if @command_window.active update_command return end if (@use_window.active) update_use_item return end if @item_window.active update_item return end if @right_window.active update_right return end if @item_equip_window.active update_equip_item return end if @target_window.active update_item_target if @target == "item" update_skill_target if @target == "skill" return end end def update_command case @command_window.index when 0 @help_window.set_text("Show and use skill.","") @arrow.x = 198 @arrow.y = 52 when 2 @help_window.set_text("Show and use item.","") @arrow.x = 264 @arrow.y = 300 when 1 @help_window.set_text("Equip Weapon and Armor.","") @arrow.x = 264 @arrow.y = 170 when 3 @help_window.set_text("Save the game progress.","") @arrow.x = 556 @arrow.y = 464 when 4 @help_window.set_text("Exit.","") @arrow.x = 590 @arrow.y = 464 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 $game_system.se_play($data_system.decision_se) tab = [] for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill != nil tab.push(skill.name) end end @skill_command_window = Window_CommandSpe.new(192, tab) @command_window.active = false @skill_command_window.active = true @skill_command_window.visible = true when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @item_window.active = true when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @right_window.active = true when 3 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 4 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end end def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @item_window.active = false @command_window.active = true return end if Input.trigger?(Input::C) @item_window.active = false @use_window.active = true @use_window.visible = true return end end def update_use_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = false @item_window.active = true @item_window.help_window.active = true @use_window.active = false @use_window.visible = false @target_window.visible = false @target_window.active = false return end if Input.trigger?(Input::C) if (@use_window.index==1) @item = @item_window.item $game_party.lose_item(@item.id, 1) @item_window.refresh if ($game_party.item_number(@item.id)<=0) @command_window.active = false @item_window.active = true @item_window.help_window.active = true @use_window.active = false @use_window.visible = false @target_window.visible = false @target_window.active = false end else @use_window.active = false @use_window.visible = false @item = @item_window.item unless @item.is_a?(RPG::Item) $game_system.se_play($data_system.buzzer_se) @use_window.active = true @use_window.visible = true return end unless $game_party.item_can_use?(@item.id) $game_system.se_play($data_system.buzzer_se) @use_window.active = true @use_window.visible = true return end $game_system.se_play($data_system.decision_se) if @item.scope >= 3 @item_window.active = false @target_window.x = 287 @target_window.y = 355 @target_window.visible = true @target_window.active = true @target = "item" if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end else if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end $scene = Scene_Map.new return end end return end end def update_item_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) unless $game_party.item_can_use?(@item.id) @item_window.refresh end @target = "" @item_window.active = true @target_window.visible = false @target_window.active = false return end if Input.trigger?(Input::C) if $game_party.item_number(@item.id) == 0 $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.item_effect(@item) end end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.item_effect(@item) end if used $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $scene = Scene_Map.new return end @status_window.refresh end unless used $game_system.se_play($data_system.buzzer_se) end return end if ($game_party.item_number(@item.id)<=0) $game_system.se_play($data_system.cancel_se) unless $game_party.item_can_use?(@item.id) @item_window.refresh end @target = "" @item_window.active = true @target_window.visible = false @target_window.active = false return end end end def update_skill if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @skill_command_window.active = false @skill_command_window.visible = false @command_window.active = true return end if Input.trigger?(Input::C) @skill = $data_skills[@actor.skills[@skill_command_window.index]] if @skill == nil or not @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) if @skill.scope >= 3 @skill_command_window.active = false @target_window.x = 287 @target_window.y = 299 @target_window.visible = true @target_window.active = true @target = "skill" if @skill.scope == 4 || @skill.scope == 6 @target_window.index = -1 elsif @skill.scope == 7 @target_window.index = @actor_index - 10 else @target_window.index = 0 end else if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $game_system.se_play(@skill.menu_se) @status_window.refresh @skill_command_window.refresh @target_window.refresh $scene = Scene_Map.new return end end return end end def update_skill_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @skill_command_window.active = true @target_window.visible = false @target_window.active = false @target = "" return end if Input.trigger?(Input::C) unless @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.skill_effect(@actor, @skill) end end if @target_window.index <= -2 target = $game_party.actors[@target_window.index + 10] used = target.skill_effect(@actor, @skill) end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.skill_effect(@actor, @skill) end if used $game_system.se_play(@skill.menu_se) @actor.sp -= @skill.sp_cost @status_window.refresh @skill_command_window.refresh @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $scene = Scene_Map.new return end end unless used $game_system.se_play($data_system.buzzer_se) end return end end def update_right if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @right_window.active = false @right_window.help_window.visible = false @command_window.active = true return end if Input.trigger?(Input::C) if @actor.equip_fix?(@right_window.index) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @right_window.active = false @item_equip_window.active = true tab = [] for i in 0...@item_equip_window.data.size if (@item_equip_window.data[i] != nil) tab.push(@item_equip_window.data[i].name) else tab.push("") end end @equip_command_window = Window_CommandSpe.new(192-24, tab) @equip_command_window.x = 480-96-8 if (@right_window.index==0) @equip_command_window.y = 130 +16 else @equip_command_window.y = 130 + @right_window.index * 16 end @equip_command_window.visible = true @equip_command_window.active = true return end end def update_equip_item @equip_command_window.index = @item_equip_window.index last_hp = @actor.hp last_sp = @actor.sp item1 = @item_equip_window.item item2 = @right_window.item @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) stats = [@actor.atk, @actor.pdef, @actor.mdef,@actor.str, @actor.dex,@actor.agi,@actor.int] @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) @actor.hp = last_hp @actor.sp = last_sp @status_window.set_stats(stats) if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @right_window.active = true @item_equip_window.help_window.visible = false @item_equip_window.active = false @equip_command_window.visible = false @equip_command_window.active = false stats = [@actor.atk, @actor.pdef, @actor.mdef,@actor.str, @actor.dex,@actor.agi,@actor.int] @status_window.set_stats(stats) return end if Input.trigger?(Input::C) $game_system.se_play($data_system.equip_se) type = @right_window.index item = @item_equip_window.item @actor.equip(type, item == nil ? 0 : item.id) @right_window.active = true @item_equip_window.active = false @right_window.refresh @item_equip_window.refresh @status_window.refresh @equip_command_window.visible = false @equip_command_window.active = false stats = [@actor.atk, @actor.pdef, @actor.mdef,@actor.str, @actor.dex,@actor.agi,@actor.int] @status_window.set_stats(stats) return end end end ( Si ça marche toujours pas par contre, envoie moi une démo fonctionnelle avec tout les scripts que tu utilises, ça sera plus facile à débuguer ) Cette erreur, tu l'as signalé sur la page d'avant xD. |
| | | Raven Administrateur
Messages postés : 1338 Date d'inscription : 20/04/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 15:14 | |
| Ah ouais ! T'as raison, désolé, j'suis un peu con des fois. Bon bah du coup c'est tout beau, tout bien, tout propre, tout parfait ! Merci ! |
| | | Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 15:16 | |
| Et des points pour Mack, plein de points ! Merci à lui, je classe le sujet. |
| | | Mack Chevalier (niveau 5)
Messages postés : 126 Date d'inscription : 26/06/2013 Jauge LPC :
| Sujet: Re: [Résolu] Un p'tit menu ? Dim 3 Mai 2015 - 15:39 | |
| Si tu trouves un autre bug, ou que t'ai un soucis avec, envoie moi un MP ^^. |
| | | Contenu sponsorisé
| Sujet: Re: [Résolu] Un p'tit menu ? | |
| |
| | | |
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |