Ho passato un po di minuti a capire come funziopnava lo script delle icone e un oretta buona a modificarlo per adattarlo ai nuovi comandi...
Dopo questa impresa epica(almeno per me che son nabbo) mi rimangono degli errori che spero voi possiate risolvere...
http://i51.tinypic.com/2060s5z.png
Come si vede dall'immagine la prima icona mi rimane tagliata in più il cursore non è ben centrato... ci ho sbattuto un po per aggiustare ma non riesco a risolvere sti errori... Vi lascio gli script del menu e quello delle icone...
#======================================================================
========
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
@tempo_gioco = Window_Tempo.new(0, 56)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
@tempo_gioco.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
@tempo_gioco.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command_Plus_Icons.new(544, [s1, s2, s3, s4, s5, s6], 6)
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4 # Save
$scene = Scene_File.new(true, false, false)
when 5 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * 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 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
# ========================================================================
# Omegas7's Menu Icons Script.
# ========================================================================
# Version: 2.0 (Final).
# ========================================================================
#
# Set icons for the commands in the menu command window.
#
# ========================================================================
#
# Edit the below module:
#
# MENU_ICONS[iD] = N
# Replace ID with the menu command window command option.
# Start counting from 0.
# 0 = First Option... 1 = Second Option...
# Replace N with the icon index.
#
# MENU_ICONS_SPACING_LEVEL is the amount of spaces before the
# command text, when higher, more space for the icon,
# when lower, less.
#
# MENU_ICONS_Y_INCREASE is the amount of Y screen position to
# increase for each line, by default is 24.
# Use it for adjusting the icons positions to fit the text.
#
# ========================================================================
module OMEGAS7
MENU_ICONS = [] # Don't edit this line.
MENU_ICONS[0] = 1 # First option has icon number 50.
MENU_ICONS[1] = 6
MENU_ICONS[2] = 5
MENU_ICONS[3] = 3
MENU_ICONS[4] = 2
MENU_ICONS[5] = 4 # Sixth option has icon number 55.
MENU_ICONS_SPACING_LEVEL = 0 # 3 spaces before command text.
MENU_ICONS_Y_INCREASE = 0 # 24 pixels between each icon.
end
class Window_Command_Plus_Icons < Window_Selectable
include OMEGAS7
attr_reader :commands # command
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, width, row_max * WLH + 32, spacing)
@space = ""
@commands = commands
@item_max = commands.size
@column_max = column_max
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, enabled = true)
for i in 0..MENU_ICONS_SPACING_LEVEL.to_i
@space += " "
end
rect = item_rect(index)
rect.x += 10
rect.width += 0
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @space + @commands[index])
draw_icon(MENU_ICONS[index], (index * 90) - 10, 0)
@space = ""
end
def update_cursor
if @index < 0 # カーソルなし
self.cursor_rect.empty
elsif @index < @item_max # 通常
self.cursor_rect.set(@index * 90, 0, 70, 32)
elsif @index >= 100 # 自分
self.cursor_rect.set(@index * 90, 0, contents.width, 32)
else # 全体
self.cursor_rect.set(0, 0, contents.width, @item_max * 32)
end
end
end
Question
Melosx
Ho passato un po di minuti a capire come funziopnava lo script delle icone e un oretta buona a modificarlo per adattarlo ai nuovi comandi...
Dopo questa impresa epica(almeno per me che son nabbo) mi rimangono degli errori che spero voi possiate risolvere...
http://i51.tinypic.com/2060s5z.png
Come si vede dall'immagine la prima icona mi rimane tagliata in più il cursore non è ben centrato... ci ho sbattuto un po per aggiustare ma non riesco a risolvere sti errori... Vi lascio gli script del menu e quello delle icone...
#====================================================================== ======== # ** Scene_Menu #------------------------------------------------------------------------------ # This class performs the menu screen processing. #============================================================================== class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- def start super create_menu_background create_command_window @gold_window = Window_Gold.new(0, 360) @status_window = Window_MenuStatus.new(160, 0) @tempo_gioco = Window_Tempo.new(0, 56) end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super dispose_menu_background @command_window.dispose @gold_window.dispose @status_window.dispose @tempo_gioco.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super update_menu_background @command_window.update @gold_window.update @status_window.update @tempo_gioco.update if @command_window.active update_command_selection elsif @status_window.active update_actor_selection end end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window s1 = Vocab::item s2 = Vocab::skill s3 = Vocab::equip s4 = Vocab::status s5 = Vocab::save s6 = Vocab::game_end @command_window = Window_Command_Plus_Icons.new(544, [s1, s2, s3, s4, s5, s6], 6) @command_window.index = @menu_index if $game_party.members.size == 0 # If number of party members is 0 @command_window.draw_item(0, false) # Disable item @command_window.draw_item(1, false) # Disable skill @command_window.draw_item(2, false) # Disable equipment @command_window.draw_item(3, false) # Disable status end if $game_system.save_disabled # If save is forbidden @command_window.draw_item(4, false) # Disable save end end #-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 4 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 # Item $scene = Scene_Item.new when 1,2,3 # Skill, equipment, status start_actor_selection when 4 # Save $scene = Scene_File.new(true, false, false) when 5 # End Game $scene = Scene_End.new end end end #-------------------------------------------------------------------------- # * Start Actor Selection #-------------------------------------------------------------------------- def start_actor_selection @command_window.active = false @status_window.active = true if $game_party.last_actor_index < @status_window.item_max @status_window.index = $game_party.last_actor_index else @status_window.index = 0 end end #-------------------------------------------------------------------------- # * End Actor Selection #-------------------------------------------------------------------------- def end_actor_selection @command_window.active = true @status_window.active = false @status_window.index = -1 end #-------------------------------------------------------------------------- # * 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 1 # skill $scene = Scene_Skill.new(@status_window.index) when 2 # equipment $scene = Scene_Equip.new(@status_window.index) when 3 # status $scene = Scene_Status.new(@status_window.index) end end end end# ======================================================================== # Omegas7's Menu Icons Script. # ======================================================================== # Version: 2.0 (Final). # ======================================================================== # # Set icons for the commands in the menu command window. # # ======================================================================== # # Edit the below module: # # MENU_ICONS[iD] = N # Replace ID with the menu command window command option. # Start counting from 0. # 0 = First Option... 1 = Second Option... # Replace N with the icon index. # # MENU_ICONS_SPACING_LEVEL is the amount of spaces before the # command text, when higher, more space for the icon, # when lower, less. # # MENU_ICONS_Y_INCREASE is the amount of Y screen position to # increase for each line, by default is 24. # Use it for adjusting the icons positions to fit the text. # # ======================================================================== module OMEGAS7 MENU_ICONS = [] # Don't edit this line. MENU_ICONS[0] = 1 # First option has icon number 50. MENU_ICONS[1] = 6 MENU_ICONS[2] = 5 MENU_ICONS[3] = 3 MENU_ICONS[4] = 2 MENU_ICONS[5] = 4 # Sixth option has icon number 55. MENU_ICONS_SPACING_LEVEL = 0 # 3 spaces before command text. MENU_ICONS_Y_INCREASE = 0 # 24 pixels between each icon. end class Window_Command_Plus_Icons < Window_Selectable include OMEGAS7 attr_reader :commands # command 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, width, row_max * WLH + 32, spacing) @space = "" @commands = commands @item_max = commands.size @column_max = column_max refresh self.index = 0 end def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end def draw_item(index, enabled = true) for i in 0..MENU_ICONS_SPACING_LEVEL.to_i @space += " " end rect = item_rect(index) rect.x += 10 rect.width += 0 self.contents.clear_rect(rect) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect, @space + @commands[index]) draw_icon(MENU_ICONS[index], (index * 90) - 10, 0) @space = "" end def update_cursor if @index < 0 # カーソルなし self.cursor_rect.empty elsif @index < @item_max # 通常 self.cursor_rect.set(@index * 90, 0, 70, 32) elsif @index >= 100 # 自分 self.cursor_rect.set(@index * 90, 0, contents.width, 32) else # 全体 self.cursor_rect.set(0, 0, contents.width, @item_max * 32) end end endhttp://i.imgur.com/ROhv4te.png
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now