Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=========================================================================#
- # Final Fantasy XII Sytle Menu (Requested by Ziimo) v1.05 #
- # * THIS ADD-ON REQUIRES the Script "Z-Systems Neo Menu System" by Zetu * #
- #=========================================================================#
- module Z_Systems
- module NeoMenu
- FFXIIDEFAULTFONT = "Calibri" # If you wish to use default, set to ""
- DEFAULTFONTNAME = "Verdana"
- ACTOR_CLASS_COLOR = [] #If any class id does not exist, will return 0.
- ACTOR_CLASS_COLOR[1] = 3
- ACTOR_CLASS_COLOR[2] = 8
- ACTOR_CLASS_COLOR[3] = 14
- ACTOR_CLASS_COLOR[4] = 28
- end
- end
- class Scene_Menu < Scene_Base
- def create_command_window
- @bar_window = Window_Bar.new(23)
- @bar_window.opacity = 0
- @command_window = Window_Command.new(160, Z_Systems::NeoMenu::MENU_ITEMS)
- @command_window.y += 10
- @command_window.opacity = 0
- @time_window = Window_Stats.new(192, 375, [1])
- @time_window.opacity = 0
- zs_nms_disable
- end
- alias ffxiii_start start unless $@
- def start
- ffxiii_start start
- @gold_window.x = 396
- @gold_window.y = 375
- @gold_window.opacity = 0
- @status_window.x = 152
- @status_window.y = 7
- @status_window.opacity = 0
- @map_window = Window_Stats.new(4, 375, [2])
- @map_window.opacity = 0
- end
- alias nms_terminate terminate unless $@
- def terminate
- nms_terminate
- @bar_window.dispose
- @map_window.dispose
- end
- alias upd update unless $@
- def update
- upd
- @map_window.update
- end
- end
- class Window_MenuStatus < Window_Selectable
- def refresh
- self.contents.clear
- get_font_type
- @item_max = $game_party.members.size
- nms_create_contents(0, 4*92)
- for actor in $game_party.members
- draw_actor_face(actor, 2, actor.index * 92 + 2, 90)
- x = 104
- y = actor.index * 92
- draw_actor_state(actor, x + 96, y + WLH * 2)
- draw_actor_name(actor, x + 8, y + 68)
- draw_actor_class_ffxii(actor, x + 96, y + 68)
- draw_actor_level_ffxii(actor, x - 8, y - 8, 88)
- draw_actor_stats_ffxii(actor, x + 96, y + 4, actor.hp, actor.maxhp, 4, hp_color(actor))
- draw_actor_stats_ffxii(actor, x + 96, y + 32, actor.mp, actor.maxmp, 3, mp_color(actor))
- end
- return_font_type
- end
- def update_cursor
- nms_set_cursor(0, @index, 0, 91, contents.width, 92)
- end
- end
- class Window_Base < Window
- def get_font_type
- fontname = Z_Systems::NeoMenu::FFXIIDEFAULTFONT
- if fontname != ""
- Font.default_shadow = true
- Font.default_name = fontname
- end
- end
- def return_font_type
- Font.default_shadow = false
- Font.default_name = Z_Systems::NeoMenu::DEFAULTFONTNAME
- end
- def draw_actor_class_ffxii(actor, x, y)
- if Z_Systems::NeoMenu::ACTOR_CLASS_COLOR[actor.id] != nil
- self.contents.font.color = text_color(Z_Systems::NeoMenu::ACTOR_CLASS_COLOR[actor.id])
- else
- self.contents.font.color = normal_color
- end
- self.contents.draw_text(x, y, 108, WLH, actor.class.name)
- end
- def draw_actor_level_ffxii(actor, x, y, size = 32)
- self.contents.font.color = text_color(7)
- self.contents.font.size = size
- if actor.level < 10
- text = "0" + actor.level.to_s
- else
- text = actor.level
- end
- self.contents.draw_text(x, y, size, size, text, 2)
- self.contents.font.size = 24
- self.contents.font.color = normal_color
- end
- def draw_actor_stats_ffxii(actor, x, y, min, max, dig, color = text_color(0))
- slots = []
- while 1
- if dig <= 0
- break
- else
- slots.push(dig)
- dig -= 1
- end
- end
- self.contents.font.color.alpha = 128
- for i in slots
- value = mod_dig(min, i, slots.size)
- if value != 0
- self.contents.font.color = color
- self.contents.font.color.alpha = 255
- end
- self.contents.draw_text(x, y, 16, 24, value, 2)
- x += 16
- end
- y += 4
- x -= 6
- self.contents.font.color = text_color(0)
- self.contents.draw_text(x, y, 16, 24, "/", 2)
- y += 4
- x += 12
- self.contents.font.color.alpha = 128
- for i in slots
- value = mod_dig(max, i, slots.size)
- if value != 0
- self.contents.font.color = color
- self.contents.font.color.alpha = 255
- end
- self.contents.draw_text(x, y, 16, 24, value, 2)
- x += 16
- end
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = 255
- end
- def mod_dig(num, dig, max = 4)
- max = 3 if num < 1000
- max = 2 if num < 100
- max = 1 if num < 10
- array = num.to_s.split(//)
- id = max - dig
- var = (id >= 0) ? array[id].to_i : 0
- return var
- end
- def draw_stat(value, new_value, x, y, max_dig = 3)
- self.contents.font.color = normal_color
- valuearray = new_value.to_s.split(//)
- tarray = []
- for i in 0...max_dig-valuearray.size do tarray.push("0") end
- self.contents.font.color.alpha = 128
- valuearray = tarray + valuearray
- for tvalue in valuearray
- if tvalue != "0"
- self.contents.font.color = new_parameter_color(value, new_value)
- self.contents.font.color.alpha = 255
- end
- self.contents.draw_text(x, y, 30, WLH, tvalue, 2)
- x += 12
- end
- end
- def new_parameter_color(old_value, new_value)
- if new_value > old_value
- return power_up_color
- elsif new_value == old_value
- return normal_color
- else
- return power_down_color
- end
- end
- end
- class Scene_Item < Scene_Base
- def start
- super
- create_menu_background
- @viewport = Viewport.new(0, 0, 544, 416)
- @help_window = Window_Help.new
- @help_window.y += 4
- @help_window.viewport = @viewport
- @help_window.opacity = 0
- @item_window = Window_Item.new(0, 60, 544, 360)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.active = false
- @item_window.opacity = 0
- @item_window.y -= 24
- @target_window = Window_MenuStatus.new(0, 0)
- hide_target_window
- @bar_window = Window_Bar.new(23)
- @bar_window.opacity = 0
- end
- alias nms_terminate terminate
- def terminate
- nms_terminate
- @bar_window.dispose
- end
- end
- class Scene_Equip < Scene_Base
- def start
- super
- @bar_window = Window_Bar.new(23)
- @bar_window.opacity = 0
- create_menu_background
- @actor = $game_party.members[@actor_index]
- @help_window = Window_Help.new
- @help_window.opacity = 0
- @help_window.y += 10
- create_item_windows
- @equip_window = Window_Equip.new(208, 56, @actor)
- @equip_window.help_window = @help_window
- @equip_window.index = @equip_index
- @equip_window.opacity = 0
- @status_window = Window_EquipStatus.new(0, 56, @actor)
- @status_window.opacity = 0
- end
- def terminate
- super
- dispose_menu_background
- @help_window.dispose
- @equip_window.dispose
- @status_window.dispose
- @bar_window.dispose
- dispose_item_windows
- end
- def create_item_windows
- @item_windows = []
- for i in 0...EQUIP_TYPE_MAX
- @item_windows[i] = Window_EquipItem.new(0, 208, 544, 208, @actor, i)
- @item_windows[i].help_window = @help_window
- @item_windows[i].visible = (@equip_index == i)
- @item_windows[i].y = 208
- @item_windows[i].height = 208
- @item_windows[i].active = false
- @item_windows[i].index = -1
- @item_windows[i].opacity = 0
- end
- end
- end
- class Scene_Skill < Scene_Base
- def start
- super
- create_menu_background
- @bar_window = Window_Bar.new(23)
- @bar_window.opacity = 0
- @actor = $game_party.members[@actor_index]
- @viewport = Viewport.new(0, 0, 544, 416)
- @help_window = Window_Help.new
- @help_window.viewport = @viewport
- @help_window.opacity = 0
- @help_window.y += 10
- @status_window = Window_SkillStatus.new(0, 32, @actor)
- @status_window.viewport = @viewport
- @status_window.opacity = 0
- @skill_window = Window_Skill.new(0, 79, 544, 304, @actor)
- @skill_window.viewport = @viewport
- @skill_window.help_window = @help_window
- @skill_window.opacity = 0
- @skill_window.y += 23
- @target_window = Window_MenuStatus.new(0, 0)
- hide_target_window
- end
- def terminate
- super
- dispose_menu_background
- @help_window.dispose
- @status_window.dispose
- @skill_window.dispose
- @target_window.dispose
- @bar_window.dispose
- end
- end
- class Window_SkillStatus < Window_Base
- def initialize(x, y, actor)
- super(x, y, 544, 128)
- @actor = actor
- refresh
- end
- def refresh
- self.contents.clear
- draw_actor_level_ffxii(@actor, 96, 0, 68)
- draw_actor_stats_ffxii(@actor, 192, 4, @actor.hp, @actor.maxhp, 4)
- draw_actor_stats_ffxii(@actor, 192, 32, @actor.mp, @actor.maxmp, 3)
- draw_actor_name(@actor, 0, 24)
- end
- end
- class Window_EquipStatus < Window_Base
- def draw_parameter(x, y, type)
- case type
- when 0
- name = Vocab::atk
- value = @actor.atk
- new_value = @new_atk
- when 1
- name = Vocab::def
- value = @actor.def
- new_value = @new_def
- when 2
- name = Vocab::spi
- value = @actor.spi
- new_value = @new_spi
- when 3
- name = Vocab::agi
- value = @actor.agi
- new_value = @new_agi
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x + 4, y, 80, WLH, name)
- self.contents.font.color = normal_color
- draw_stat(value, value, 36, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x + 102, y, 20, WLH, ">", 1)
- x -= 16
- draw_stat(value, new_value, 108, y) if new_value != nil
- end
- end
- class Scene_Status < Scene_Base
- def start
- create_menu_background
- @actor = $game_party.members[@actor_index]
- @bar_window = Window_Bar.new(23)
- @status_window = Window_Status.new(@actor)
- @status_window.opacity = 0
- end
- def terminate
- super
- dispose_menu_background
- @status_window.dispose
- @bar_window.dispose
- end
- def update
- update_menu_background
- @status_window.update
- @status_window.opacity = 0
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::R)
- Sound.play_cursor
- next_actor
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- prev_actor
- end
- end
- end
- class Window_Status < Window_Base
- def refresh
- self.contents.clear
- draw_actor_face(@actor, 2, 36, 90)
- draw_actor_state(@actor, 102, 80)
- draw_actor_name(@actor, 96, 100)
- draw_actor_class(@actor, 192, 100)
- draw_actor_level_ffxii(@actor, 96, 32, 68)
- thpcolor = hp_color(@actor)
- tmpcolor = mp_color(@actor)
- draw_actor_stats_ffxii(@actor, 192, 36, @actor.hp, @actor.maxhp, 4, thpcolor)
- draw_actor_stats_ffxii(@actor, 192, 64, @actor.mp, @actor.maxmp, 3, tmpcolor)
- draw_parameters(32, 160)
- draw_exp_info_ffxii(288, 32)
- draw_equipments(288, 160)
- end
- alias nms_draw_parameters draw_parameters
- def draw_parameters(x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x - 32, y + WLH*0, 48, WLH, "ATK")
- self.contents.draw_text(x - 32, y + WLH*1, 48, WLH, "DEF")
- self.contents.draw_text(x - 32, y + WLH*2, 48, WLH, "SPI")
- self.contents.draw_text(x - 32, y + WLH*3, 48, WLH, "AGI")
- draw_stat(@actor.atk, @actor.atk, x, y + WLH*0)
- draw_stat(@actor.def, @actor.def, x, y + WLH*1)
- draw_stat(@actor.spi, @actor.spi, x, y + WLH*2)
- draw_stat(@actor.agi, @actor.agi, x, y + WLH*3)
- end
- def draw_exp_info_ffxii(x, y)
- s1 = @actor.exp_s
- s2 = @actor.next_rest_exp_s
- s_next = sprintf(Vocab::ExpNext, Vocab::level)
- self.contents.font.color = system_color
- self.contents.draw_text(x+56, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
- self.contents.draw_text(x+56, y + WLH * 2, 180, WLH, s_next)
- self.contents.font.color = normal_color
- self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 2)
- self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 2)
- end
- end
- class Scene_Base
- def create_menu_background
- @menuback_sprite = Sprite.new
- @menuback_sprite.bitmap = $game_temp.background_bitmap
- @menuback_sprite.color.set(0, 0, 8, 192)
- @menuback_sprite.tone = Tone.new(0, 0, 0, 234)
- update_menu_background
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement