Pomógł: 10 razy Dołączył: 04 Gru 2010 Posty: 69 Skąd: z Polski :P
Wysłany: Nie 18 Gru, 2011 17:11
Munkis' Simple Main Menu
Munkis' Simple Main Menu
Opis:
Jest to bardzo proste menu do gier przygodowych. Wszystkie funkcje są na screenie.
Autor:
Munkis
Tłumacz:
Virandar (to co mogłem )
Skrypt:
Spoiler:
Kod:
#------------------------------------------------------------------------------
# * Munkis' Simple Menu V 1.0
# * Made by munkis by request for Deadbox
# * Basically this reduces the main menu to a very basic command window.
# * OVERWRITES Scene_Menu!
# * V 1.0: Initial release
#------------------------------------------------------------------------------
#[module]
module MNK_SimpleMenu
MENU_TEXT = ["Kontynuuj","Ekwipunek","Wyjście"]
#Zmień gdzie gracz trafia po naciśnięciu "wyjście".
#0 = Ekran Tytułowy.
#1 = Do Scene_End Menu.
#2 = Wychodzi całkowicie.
EXIT_TYPE = 1
#The first two numbers in this array CANNOT be zero or negative. The last
#three can, however. But setting the opacity to a negative number won't make
#it any more transparent.
#CHOICE_WINDOW_DIM = [width, columns, center_x, center_y, opacity]
CHOICE_WINDOW_DIM = [175,1,-3,0,0]
#[show gold window,X,Y co-ordinates and opacity of the gold window]
GOLD_WINDOW = [false,191,260,0]
end
#[/module]
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
if MNK_SimpleMenu::GOLD_WINDOW[3] == true
@gold_window = Window_Gold.new(MNK_SimpleMenu::GOLD_WINDOW[1], MNK_SimpleMenu::GOLD_WINDOW[2])
@gold_window.opacity = MNK_SimpleMenu::GOLD_WINDOW[3]
end
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
super
open_command_window
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
dispose_menu_background
@gold_window.dispose if MNK_SimpleMenu::GOLD_WINDOW[3] == true
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.refresh if MNK_SimpleMenu::GOLD_WINDOW[3] == true
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
case @command_window.index
when 0 # to title
command_resume
when 1 # shutdown
command_inventory
when 2 # quit
command_quit
end
end
end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
def update_menu_background
super
@menuback_sprite.tone.set(0, 0, 0, 128)
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = MNK_SimpleMenu::MENU_TEXT[0]
s2 = MNK_SimpleMenu::MENU_TEXT[1]
s3 = MNK_SimpleMenu::MENU_TEXT[2]
@command_window = Window_Command.new(MNK_SimpleMenu::CHOICE_WINDOW_DIM[0], [s1, s2, s3], MNK_SimpleMenu::CHOICE_WINDOW_DIM[1])
@command_window.x = (544 - @command_window.width + MNK_SimpleMenu::CHOICE_WINDOW_DIM[2]) / 2
@command_window.y = (416 - @command_window.height + MNK_SimpleMenu::CHOICE_WINDOW_DIM[3]) / 2
@command_window.openness = 0
@command_window.opacity = MNK_SimpleMenu::CHOICE_WINDOW_DIM[4]
end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
#--------------------------------------------------------------------------
# * Process When Choosing [Resume] Command
#--------------------------------------------------------------------------
def command_resume
Sound.play_decision
return_scene
end
#--------------------------------------------------------------------------
# * Process When Choosing [Inventory] Command
#--------------------------------------------------------------------------
def command_inventory
Sound.play_decision
$scene = Scene_Item.new
end
#--------------------------------------------------------------------------
# * Process When Choosing [Exit] Command
#--------------------------------------------------------------------------
def command_quit
if MNK_SimpleMenu::EXIT_TYPE == 0
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = Scene_Title.new
close_command_window
Graphics.fadeout(60)
elsif MNK_SimpleMenu::EXIT_TYPE == 1
Sound.play_decision
$scene = Scene_End.new
elsif MNK_SimpleMenu::EXIT_TYPE == 2
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
end
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum