Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=========================================================================#
- # Side-slot Style II v1.01 #
- # * THIS ADD-ON REQUIRES the Script "Z-Systems Neo Menu System" by Zetu * #
- #=========================================================================#
- module Z_Systems
- module NeoMenu
- module SSSII
- ACTORS = 1..8 # Index of all actors to be shown in menu. Max 8.
- #Actor IMG A size = 128 * 96
- #Actor IMG B size = 128 * 80
- end
- end
- end
- class Game_Actor < Game_Battler
- def exp_til
- return (@exp - @exp_list[@level])
- end
- def exp_max
- return 0 if @level == 99
- return @exp_list[@level+1] - @exp_list[@level]
- end
- end
- class Window_Base < Window
- def draw_actor_xp(actor, x, y, width = 120)
- draw_actor_xp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, "XP")
- self.contents.font.color = normal_color
- last_font_size = self.contents.font.size
- if width < 120
- self.contents.draw_text(x + 32, y, width - 32, WLH, actor.exp_til, 2)
- else
- self.contents.font.color = normal_color
- text = actor.exp_til.to_s + " / " + actor.exp_max.to_s
- text = actor.level == 99 ? "-------" : text
- self.contents.draw_text(x + 32, y, width - 32, WLH, text, 2)
- end
- end
- def draw_actor_xp_gauge(actor, x, y, width = 120)
- gw = actor.exp_max != 0 ? width * actor.exp_til / actor.exp_max : width
- gc1 = text_color(16)
- gc2 = text_color(22)
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- def draw_neo_pic(x, y, filename = "BackImage")
- bitmap = Cache.picture(filename)
- rect = Rect.new(0, 0, 0, 0)
- rect.width = bitmap.width
- rect.height = bitmap.height
- self.contents.blt(x, y, bitmap, rect)
- bitmap.dispose
- end
- end
- class Scene_Menu < Scene_Base
- include Z_Systems::NeoMenu::SSSII
- def start
- create_menu_background
- @gold_window = Window_Gold.new(0, 360)
- @status_window = Window_MenuStatus.new(160, 0)
- create_command_window
- end
- def command_window_index
- return 0 if @command_window.nil?
- return @command_window.index
- end
- end
- class Window_MenuStatus < Window_Selectable
- include Z_Systems::NeoMenu::SSSII
- include Z_Systems::NeoMenu
- def initialize(x, y)
- super(0, 0, 544, 352)
- @last_index = 0
- refresh
- self.active = false
- self.index = -1
- end
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- @last_index = $scene.command_window_index
- self.contents.draw_text(304, 0, 272, WLH, MENU_ITEMS[@last_index])
- for actor in $game_party.members
- x = actor.index * 128
- y = 120
- draw_neo_pic(x, 24, actor.id.to_s + "_A")
- draw_actor_name(actor, x, y)
- draw_actor_level(actor, x + 70, y + WLH)
- draw_actor_state(actor, x, y - WLH)
- draw_actor_hp(actor, x, y + WLH * 2)
- draw_actor_mp(actor, x, y + WLH * 3)
- draw_actor_xp(actor, x, y + WLH * 4)
- end
- array = ACTORS.to_a
- for actor in $game_party.members
- array -= [actor.id]
- end
- x = 0
- for actor_id in array
- draw_neo_pic(x, 240, actor_id.to_s + "_B")
- x += 128
- end
- end
- def update_cursor
- if @index < 0 # No cursor
- self.cursor_rect.empty
- elsif @index < @item_max # Normal
- self.cursor_rect.set(@index*128, 24, 128, 216)
- elsif @index >= 100 # Self
- self.cursor_rect.set((@index - 100)*128, 24, 128, 216)
- else # All
- self.cursor_rect.set(0, 0, 128, 216)
- end
- end
- def update
- super
- refresh if @last_index != $scene.command_window_index
- if cursor_movable?
- last_index = @index
- if Input.repeat?(Input::RIGHT)
- cursor_down(Input.trigger?(Input::RIGHT))
- end
- if Input.repeat?(Input::LEFT)
- cursor_up(Input.trigger?(Input::LEFT))
- end
- if Input.repeat?(Input::RIGHT)
- cursor_right(Input.trigger?(Input::RIGHT))
- end
- if Input.repeat?(Input::LEFT)
- cursor_left(Input.trigger?(Input::LEFT))
- end
- if Input.repeat?(Input::R)
- cursor_pagedown
- end
- if Input.repeat?(Input::L)
- cursor_pageup
- end
- if @index != last_index
- Sound.play_cursor
- end
- end
- update_cursor
- call_update_help
- end
- end
- class Window_CommandNMS < Window_Selectable
- def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
- if row_max == 0
- row_max = (commands.size + column_max - 1) / column_max
- end
- super(0, 0, 32*commands.size+32, WLH + 32, 0)
- @commands = commands
- @item_max = commands.size
- @column_max = @item_max
- refresh
- self.index = 0
- self.opacity = 0
- end
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- rect.x += 4
- rect.width -= 8
- self.contents.clear_rect(rect)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- if Z_Systems::NeoMenu::ICONS[@commands[index]] != nil
- draw_icon(Z_Systems::NeoMenu::ICONS[@commands[index]], rect.x, rect.y)
- rect.x += 24
- end
- #~ self.contents.draw_text(rect, @commands[index])
- end
- end
- class Game_Map
- def name
- data = load_data("Data/MapInfos.rvdata")
- return data[@map_id].name
- end
- end
- class Window_Gold < Window_Base
- def initialize(x, y)
- super(x, y, 544, WLH + 32)
- refresh
- end
- def refresh
- draw_currency_value($game_party.gold, 4, 0, 120)
- self.contents.font.color = normal_color
- self.contents.draw_text(192, 0, 128, WLH, $game_map.name, 1)
- end
- def update
- self.contents.clear
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 360
- min = (@total_sec / 60) % 60
- sec = @total_sec % 60
- time = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(384, 0, 128, WLH, time, 2)
- refresh
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement