Instantly share code, notes, and snippets.
LMichelle/Custom Menu.rb Secret
Created
March 10, 2018 14:28
Star
You must be signed in to star a gist
Language of Lyse - Custom Menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
# ** Scene_MenuLoL | |
#------------------------------------------------------------------------------ | |
# This class performs title screen processing. | |
#============================================================================== | |
class Scene_MenuLoL | |
def initialize(menu_index = 0) | |
@menu_index = menu_index | |
end | |
def main | |
s1 = "Items" #Bitmap.new("Graphics/Icons/032-Item01.png") | |
s2 = "Skill" | |
s3 = "Equip" | |
s4 = "Profile" | |
s5 = "Notebook" | |
s6 = "Quit" | |
@command_window = Window_Command.new(320, [s1, s2, s3, s4, s5, s6]) | |
@command_window.index = @menu_index | |
@command_window.y = 190 | |
@command_window.back_opacity = 160 | |
@window_notebook = Window_Notebook.new | |
@window_notebook.x = 320 | |
@window_notebook.visible = false | |
@window_notebook.active = false | |
@window_people = Window_People.new | |
@window_people.x = 320 | |
@window_people.back_opacity = 160 | |
#@window_people.y = 0 | |
@gold_window = Window_Gold.new | |
@gold_window.x = 0 | |
@gold_window.y = 416 | |
@gold_window.back_opacity = 160 | |
# background | |
#@bg = Sprite.new | |
#@bg.bitmap = Bitmap.new("Graphics/Titles/001-Title01.jpg") | |
@bg = Spriteset_Map.new | |
Graphics.transition | |
loop do | |
Graphics.update | |
Input.update | |
update | |
if $scene != self | |
break | |
end | |
end | |
Graphics.freeze | |
@window_people.dispose | |
@command_window.dispose | |
@gold_window.dispose | |
@bg.dispose | |
@window_notebook.dispose | |
end | |
##################### update | |
def update | |
@gold_window.update | |
@command_window.update | |
@window_people.update | |
@window_notebook.update | |
if @command_window.active | |
update_command | |
return | |
end | |
if @window_people.active | |
update_status | |
return | |
end | |
if @window_notebook.active | |
update_notebook | |
end | |
end | |
##################### Update Command | |
def update_command | |
if Input.trigger?(Input::B) | |
$game_system.se_play($data_system.cancel_se) | |
$scene = Scene_Map.new | |
end | |
if Input.trigger?(Input::C) | |
case @command_window.index | |
when 0 # Items | |
$game_system.se_play($data_system.decision_se) | |
$scene = Scene_Item.new | |
when 1 # Skill | |
$game_system.se_play($data_system.decision_se) | |
@command_window.active = false | |
@window_people.active = true | |
@window_people.index = 0 | |
when 2 # Equip | |
$game_system.se_play($data_system.decision_se) | |
@command_window.active = false | |
@window_people.active = true | |
@window_people.index = 0 | |
when 3 # Profile | |
$game_system.se_play($data_system.decision_se) | |
@command_window.active = false | |
@window_people.active = true | |
@window_people.index = 0 | |
when 4 # Journal | |
$game_system.se_play($data_system.decision_se) | |
@command_window.active = false | |
@window_people.visible = false | |
@window_notebook.active = true | |
@window_notebook.visible = true | |
when 5 # Quit | |
$game_system.se_play($data_system.decision_se) | |
$scene = Scene_End.new | |
end | |
return | |
end #end If trigger C | |
end | |
#################### Update Status | |
def update_status | |
if Input.trigger?(Input::B) | |
# Play cancel SE | |
$game_system.se_play($data_system.cancel_se) | |
# Make command window active | |
@command_window.active = true | |
@window_people.active = false | |
@window_people.index = -1 | |
return | |
end | |
if Input.trigger?(Input::C) | |
case @command_window.index | |
when 1 # skill | |
$game_system.se_play($data_system.decision_se) | |
$scene = Scene_Skill.new(@window_people.index) | |
when 2 # equipment | |
$game_system.se_play($data_system.decision_se) | |
$scene = Scene_Equip.new(@window_people.index) | |
when 3 # status | |
$game_system.se_play($data_system.decision_se) | |
$scene = Scene_Status.new(@window_people.index) | |
end | |
return | |
end | |
end | |
############ Update notebook | |
def update_notebook | |
if Input.trigger?(Input::B) | |
$game_system.se_play($data_system.cancel_se) | |
@window_notebook.active = false | |
@window_notebook.visible = false | |
@command_window.active = true | |
@command_window.index = 4 | |
@window_people.visible = true | |
end | |
end | |
############ | |
end #class end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment