Also ich habe jetzt mal schnell was geschrieben, da das mit den Icons zu den richtigen Menüpunkte wahrscheinlich etwas zu schwer für dich sein dürfte.
module Akwa
GOLDICON = 205
ICON1 = 2
ICON2 = 3
ICON3 = 4
ICON4 = 5
ICON5 = 6
ICON6 = 7
end
class Scene_Menu < Scene_Base
def initialize(menu_index = 0)
@menu_index = menu_index
end
def start
super
create_menu_background
create_command_window
@gold_window = Window_Goldakwa.new(0, 360)
end
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
end
def update
super
update_menu_background
@command_window.update
@gold_window.update
update_command_selection
end
def create_command_window
s1 = Vocab::item
s2 = "Fähigkeiten"
s3 = Vocab::equip
s4 = Vocab::status
s5 = "Speichern"
s6 = Vocab::game_end
c1 = Akwa::ICON1
c2 = Akwa::ICON2
c3 = Akwa::ICON3
c4 = Akwa::ICON4
c5 = Akwa::ICON5
c6 = Akwa::ICON6
@command_window = Window_Commandakwa.new(190, [s1, s2, s3, s4, s5, s6], [c1, c2, c3, c4, c5, c6])
@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
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 # skill
$scene = Scene_Skill.new(0)
when 2 # equipment
$scene = Scene_Equip.new(0)
when 3 # status
$scene = Scene_Status.new(0)
when 4 # Load
$scene = Scene_File.new(true, false, true)
when 5 # End Game
$scene = Scene_End.new
end
end
end
end
##########################################################
class Window_Commandakwa < Window_Selectable
attr_reader :commands
attr_reader :icondraw
def initialize(width, commands, icondraw, 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)
@commands = commands
@icondraw = icondraw
@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)
rect = item_rect(index)
rect.x += 34
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
draw_icon(@icondraw[index], 4,index*24, enabled = true)
self.contents.draw_text(rect, @commands[index])
end
end
##########################################################
class Window_Goldakwa < Window_Base
def initialize(x, y)
super(x, y, 160, WLH + 32)
refresh
end
def refresh
self.contents.clear
draw_icon(Akwa::GOLDICON, 4,0, enabled = true)
draw_currency_value($game_party.gold, 4, 0, 120)
end
end
Im Module kannst du die Icons zu den Punkten wählen, sobald du mehr Menüpunkte (s) machst musst du aller dings auch mehr Iconpunkte machen (c) und dementsprechend auch mehr modulepunkte. Falls das jetzt etwas zu kompliziert erklärt war, frag einfach noch mal nach^^
Also ich habe jetzt mal schnell was geschrieben, da das mit den Icons zu den richtigen Menüpunkte wahrscheinlich etwas zu schwer für dich sein dürfte.
module Akwa
GOLDICON = 205
ICON1 = 2
ICON2 = 3
ICON3 = 4
ICON4 = 5
ICON5 = 6
ICON6 = 7
end
class Scene_Menu < Scene_Base
def initialize(menu_index = 0)
@menu_index = menu_index
end
def start
super
create_menu_background
create_command_window
@gold_window = Window_Goldakwa.new(0, 360)
end
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
end
def update
super
update_menu_background
@command_window.update
@gold_window.update
update_command_selection
end
def create_command_window
s1 = Vocab::item
s2 = "Fähigkeiten"
s3 = Vocab::equip
s4 = Vocab::status
s5 = "Speichern"
s6 = Vocab::game_end
c1 = Akwa::ICON1
c2 = Akwa::ICON2
c3 = Akwa::ICON3
c4 = Akwa::ICON4
c5 = Akwa::ICON5
c6 = Akwa::ICON6
@command_window = Window_Commandakwa.new(190, [s1, s2, s3, s4, s5, s6], [c1, c2, c3, c4, c5, c6])
@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
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 # skill
$scene = Scene_Skill.new(0)
when 2 # equipment
$scene = Scene_Equip.new(0)
when 3 # status
$scene = Scene_Status.new(0)
when 4 # Load
$scene = Scene_File.new(true, false, true)
when 5 # End Game
$scene = Scene_End.new
end
end
end
end
##########################################################
class Window_Commandakwa < Window_Selectable
attr_reader :commands
attr_reader :icondraw
def initialize(width, commands, icondraw, 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)
@commands = commands
@icondraw = icondraw
@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)
rect = item_rect(index)
rect.x += 34
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
draw_icon(@icondraw[index], 4,index*24, enabled = true)
self.contents.draw_text(rect, @commands[index])
end
end
##########################################################
class Window_Goldakwa < Window_Base
def initialize(x, y)
super(x, y, 160, WLH + 32)
refresh
end
def refresh
self.contents.clear
draw_icon(Akwa::GOLDICON, 4,0, enabled = true)
draw_currency_value($game_party.gold, 4, 0, 120)
end
end
Im Module kannst du die Icons zu den Punkten wählen, sobald du mehr Menüpunkte (s) machst musst du aller dings auch mehr Iconpunkte machen (c) und dementsprechend auch mehr modulepunkte. Falls das jetzt etwas zu kompliziert erklärt war, frag einfach noch mal nach^^
Funktioniert super ... das einzigste Problem ist wenn ich nur noch 2 Menüpunkte habe und dann auf Spiel Beenden gehe und das Fenster To Title, Shutdown .... kommt und dann aber ESC drücke und somit zurück zum Menü komme dann steht unter Spiel beenden eine freie Zeile und der 1. Menüpunkt (bei mir Gegenstände) ist nicht mehr Sichtbar