MSX - Scene_Menu MOD
Pagina 1 di 1
MSX - Scene_Menu MOD
MSX - Scene_Menu MOD
Versione: 1.0
Autore: Melosx
Introduzione
Cambia lo stile del menu. Viene cambiato anche lo stile delle barre nel resto del gioco e non nel solo menu.
Screenshot
- Spoiler:
Script
- Codice:
#=============================================================================
# ** MSX - Scene_Menu MOD
#=============================================================================
# Author: Melosx
# Version: 1.0 => 6-1-2012
#
#=============================================================================
# * Instructions
#-----------------------------------------------------------------------------
# Copy the script below Materials and above Main.
#
#=============================================================================
# * Rewrite
#-----------------------------------------------------------------------------
#
# Window_Base:
#
# def draw_character
# def draw_actor_graphic
# def draw_gauge
#
#=============================================================================
# * Add
#-----------------------------------------------------------------------------
#
# Window_Base:
#
# def draw_actor_exp_gauge
#
#==============================================================================
#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
def start
super
create_command_window
create_gold_window
create_status_window
end
def create_gold_window
@gold_window = Window_MenuPlus_Horz.new
@gold_window.x = 0
@gold_window.y = Graphics.height - @gold_window.height
end
def create_status_window
@status_window = Window_MenuStatus.new(0, 48)
end
end
#==============================================================================
# ** Window_MenuCommand
#==============================================================================
class Window_MenuCommand < Window_Command
def initialize
super(0, 0)
self.contents.font.size = 16
select_last
end
def visible_line_number
return 1
end
def col_max
return 7
end
def spacing
return 4
end
def window_width
return 544
end
def window_height
return 48
end
end
#==============================================================================
# ** Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
attr_reader :pending_index
def initialize(x, y)
super(x, y, window_width, window_height)
self.contents.font.size = 16
@pending_index = -1
refresh
end
def window_width
544
end
def window_height
320
end
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_graphic(actor, 24, rect.y + 52, enabled)
draw_actor_simple_status(actor, rect.x + 50, rect.y)
end
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x, y)
draw_actor_nickname(actor, x, y + line_height * 1 - 4, 160)
draw_actor_level(actor, x + 290, y)
draw_actor_icons(actor, x, y + line_height * 2 - 4, 144)
draw_actor_class(actor, x + 100, y)
draw_actor_hp(actor, x + 170, y + line_height * 1 - 4, 130)
draw_actor_mp(actor, x + 175, y + line_height * 2 - 4, 130)
draw_actor_exp_gauge(actor, x + 345, y + line_height * 1 + 20)
draw_exp_info(actor, x + 340, y + 18)
end
def draw_actor_class(actor, x, y, width = 112)
change_color(system_color)
draw_text(x, y, 52, line_height, "Class:")
change_color(normal_color)
draw_text(x + 54, y, width, line_height, actor.class.name)
end
def draw_exp_info(actor, x, y)
self.contents.font.color = text_color(0)
if actor.level != 99
s1 = actor.exp - actor.current_level_exp
s2 = actor.next_level_exp - actor.current_level_exp
else
s1 = "-"
s2 = "-"
end
exp = s1.to_s + " / " + s2.to_s
change_color(system_color)
draw_text(x, y, 100, line_height, "Experience")
change_color(normal_color)
draw_text(x, y + 12, 100, line_height, exp, 2)
end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
def draw_character(character_name, character_index, x, y, enabled=true)
return unless character_name
bitmap = Cache.character(character_name)
sign = character_name[/^[\!\$]./]
if sign && sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = character_index
src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
contents.blt(x - cw / 2, y - ch, bitmap, src_rect, enabled ? 255 : translucent_alpha)
end
def draw_actor_graphic(actor, x, y, enabled)
draw_character(actor.character_name, actor.character_index, x, y, enabled)
end
def draw_gauge(x, y, width, rate, color1, color2)
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x - 2, gauge_y - 2, width + 4, 10, gauge_back_color)
contents.fill_rect(x - 1, gauge_y - 1, width + 2, 8, normal_color)
contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
end
def draw_actor_exp_gauge(actor, x, y, width = 100)
if actor.level != 99
s1 = actor.exp - actor.current_level_exp
s2 = actor.next_level_exp - actor.current_level_exp
gw = width * s1 / s2
else
gw = 0
end
gc1 = text_color(14)
gc2 = text_color(6)
self.contents.fill_rect(x - 1, y - 1, width + 4, 10, gauge_back_color)
self.contents.fill_rect(x, y, width + 2, 8, normal_color)
self.contents.fill_rect(x + 1, y + 1, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x + 1, y + 1, gw, 6, gc1, gc2)
end
end
#==============================================================================
# ** Window_MenuPlus_Horz
#==============================================================================
class Window_MenuPlus_Horz < Window_Base
def initialize
super(0, 0, window_width, fitting_height(1))
self.contents.font.size = 16
refresh
end
def update
super
sec = (Graphics.frame_count / Graphics.frame_rate) % 60
if sec > @total_sec % 60 or sec == 0
refresh
end
end
def window_width
return 544
end
def refresh
contents.clear
draw_currency_value(value, currency_unit, 4, 0, 120)
draw_text(4, 0, 120, line_height, "Gold:", 0)
draw_text(195, 0, 120, line_height, "Steps:", 0)
draw_text(390, 0, 120, line_height, "Time:", 0)
change_color(normal_color)
draw_text(195, 0, 120, line_height, $game_party.steps, 2)
@total_sec = Graphics.frame_count / Graphics.frame_rate
ora = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
tempo = sprintf("%02d:%02d:%02d", ora, min, sec)
draw_text(390, 0, 120, line_height, tempo, 2)
end
def value
$game_party.gold
end
def currency_unit
Vocab::currency_unit
end
def open
refresh
super
end
end
Melosx- Data d'iscrizione : 14.07.11
Età : 32
Località : Avola
Pagina 1 di 1
Permessi in questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum.
|
|