Ogłoszenie
Administracja Forum
Ring Menu VX
Autor
Wiadomo¶ć
Ayene
Ranga RM:
Pomogła: 232 razy Doł±czyła: 18 Wrz 2007 Posty: 2424
Wysłany: Pi± 23 PaĽ, 2009 12:01
Ring Menu VX
~ Ring Menu VX ~
KrĂłtki opis
Skrypt zmienia wygląd menu ze standardowego na menu kołowe (patrz screenshot).
Autor skryptu
DouglasMF
Tłumaczenie i poprawki
Ayene [yurika@o2.pl]
Kompatybilność
Tylko VX
Skrypt
Spoiler:
Kod: #=====================================================
# ~ Ring Menu VX ~
# Data publikacji: 23.10.2009
# Autor: DouglasMF
# Tłumaczenie i poprawki: Ayene [yurika@o2.pl]
# Zapraszamy na stronÄ™ Ultima Forum - http://www.ultimateam.pl
# =========================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# =========================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --------------------------- POCZĄTEK SKRYPTU -------------------------------
module AYENE
# ---------------------------- POCZĄTEK EDYCJI -------------------------------
IKONA_PRZEDMIOT = 144 # Ikona przedmiotu
IKONA_UMIEJETNOSC = 128 # Ikona umiejętności
IKONA_EKWIPUNEK = 40 # Ikona ekwipunku
IKONA_STATUS = 137 # Ikona statusu
IKONA_ZAPIS = 149 # Ikona zapisu
IKONA_WYJSCIE = 112 # Ikona wyjścia
# ----------------------------- KONIEC EDYCJI --------------------------------
end
# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^------------------
#=============================================================================
# Scene_Menu
#-----------------------------------------------------------------------------
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
super
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(0, 360)
@win_local = Window_Local.new(0,0)
@status_window = Window_MenuStatus.new(160, 0)
px = $game_player.screen_x - 16
py = $game_player.screen_y - 28
@ring_menu = Window_RingMenu_Comando.new(px,py)
@status_window.z = @ring_menu.z + 20
@status_window.visible = false
end
#--------------------------------------------------------------------------
# Zakończenie
#--------------------------------------------------------------------------
def terminate
super
@spriteset.dispose
@ring_menu.dispose
@gold_window.dispose
@win_local.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def update
super
@ring_menu.update
@gold_window.update
@win_local.update
@spriteset.update
@status_window.update
if @ring_menu.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Aktualizacja komend w menu
#--------------------------------------------------------------------------
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 @ring_menu.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @ring_menu.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @ring_menu.indice
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
$scene = Scene_File.new(true, false, false)
when 5
$scene = Scene_End.new
end
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
Sound.play_cursor
@ring_menu.girar(3)
return
end
if Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
@ring_menu.girar(4)
return
end
end
#--------------------------------------------------------------------------
# Rozpoczęcie wyboru postaci
#--------------------------------------------------------------------------
def start_actor_selection
@ring_menu.active = false
@status_window.visible = true
@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
#--------------------------------------------------------------------------
# Zakończenie wyboru postaci
#--------------------------------------------------------------------------
def end_actor_selection
@ring_menu.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# Aktualizacja wyboru postaci
#--------------------------------------------------------------------------
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 @ring_menu.indice
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#==============================================================================
# Window_RingMenu_Comando
#==============================================================================
class Window_RingMenu_Comando < Window_Base
DurIni = 30
DurMov = 15
RaioAnel = 64
ModoIni = 1
ModoEsp = 2
ModoMD = 3
ModoME = 4
SE_Inicio = ""
attr_accessor :indice
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5,s6]
@item_max = 6
@item_icon = [AYENE::IKONA_PRZEDMIOT,
AYENE::IKONA_UMIEJETNOSC,AYENE::IKONA_EKWIPUNEK,
AYENE::IKONA_STATUS,AYENE::IKONA_ZAPIS,AYENE::IKONA_WYJSCIE]
@item_hab = [true,true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# Odświeżenie
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @modo
when ModoIni
refresh_inicio
when ModoEsp
refresh_espera
when ModoMD
refresh_mover(1)
when ModoME
refresh_mover(0)
end
sw = self.contents.width
rect = Rect.new((@cx - ((sw-32)/2))+12, @cy - 40, sw-32, 32)
self.contents.draw_text(rect, @item_name[@indice],1)
end
#--------------------------------------------------------------------------
# Odświeżenie menu
#--------------------------------------------------------------------------
def refresh_inicio
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / DurIni
r = RaioAnel - 1.0 * RaioAnel * @passos / DurIni
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def refresh_espera
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @indice
x = @cx + ( RaioAnel * Math.sin( d * j ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d * j ) ).to_i
desenha_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# Odświeżenie wskaźnika
#--------------------------------------------------------------------------
def refresh_mover(modo)
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / DurMov
d2 *= -1 if modo != 0
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( RaioAnel * Math.sin( d ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Wyświetlanie ikon
#--------------------------------------------------------------------------
def desenha_item(x, y, i)
if @indice == i
self.cursor_rect.set(x-4, y-4, 32, 32)
draw_icon(@item_icon[i], x, y, @item_hab[i])
else
draw_icon(@item_icon[i], x, y, @item_hab[i])
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def inicia_menu
@modo = ModoIni
@passos = DurIni
if SE_Inicio != nil and SE_Inicio != ""
Audio.se_play("Audio/SE/" + SE_Inicio, 80, 100)
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def girar(modo)
if modo == ModoMD
@indice -= 1
@indice = @item_hab.size - 1 if @indice < 0
elsif modo == ModoME
@indice += 1
@indice = 0 if @indice >= @item_hab.size
else
return
end
@modo = modo
@passos = DurMov
end
end
#==============================================================================
# Scene_Title
#==============================================================================
class Scene_Title
alias load_database_old load_database
def load_database
load_database_old
$data_mapinfo = load_data("Data/MapInfos.rvdata")
end
end
#==============================================================================
# Window_Local
#==============================================================================
class Window_Local < Window_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 96)
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "Lokacja:")
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 120, 32, $data_mapinfo[$game_map.map_id].name, 2)
end
end
Demo
niepotrzebne
Screenshot
Instrukcja
1. Wklej skrypt nad "Main" w Edytorze Skryptu.
2. Reszta instrukcji znajduje się w treści skryptu.
Piszcie w razie problemĂłw.
ring_menu.txt Pobierz SKRYPT
Pobierz Plik ¶ci±gnięto 893 raz(y) 11,58 KB
________________________
Czeliosss
Ranga RM:
Pomógł: 49 razy Doł±czył: 02 Lis 2009 Posty: 661 Sk±d: Wa-wa
Wysłany: Pon 02 Lis, 2009 20:23
Dodałem ten skrypt ale nie mam paru innych np. Bestariusz, Zmiana Drużyny. Pomóżcie/
Ayene
Ranga RM:
Pomogła: 232 razy Doł±czyła: 18 Wrz 2007 Posty: 2424
Wysłany: Pon 02 Lis, 2009 20:42
Zamień powyższy skrypt na poniższy (jeśli korzystasz ze skryptów Bestiariusza i zmiany drużyny dostępnych na tym forum - w przeciwnym wypadku będzie inny kod wywoływania)
Spoiler:
Kod: # =====================================================
# ~ Ring Menu VX ~
# Data publikacji: 23.10.2009
# Autor: DouglasMF
# Tłumaczenie i poprawki: Ayene [yurika@o2.pl]
# Zapraszamy na stronÄ™ Ultima Forum - http://www.ultimateam.pl
# =========================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# =========================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --------------------------- POCZĄTEK SKRYPTU -------------------------------
module AYENE
# ---------------------------- POCZĄTEK EDYCJI -------------------------------
IKONA_PRZEDMIOT = 144 # Ikona przedmiotu
IKONA_UMIEJETNOSC = 128 # Ikona umiejętności
IKONA_EKWIPUNEK = 40 # Ikona ekwipunku
IKONA_STATUS = 137 # Ikona statusu
IKONA_ZAPIS = 149 # Ikona zapisu
IKONA_WYJSCIE = 112 # Ikona wyjścia
IKONA_BESTIARIUSZ = 179 # Ikona bestiariusza
IKONA_DRUZYNA = 100 # Ikona zmiany druĹĽyny
# ----------------------------- KONIEC EDYCJI --------------------------------
end
# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^------------------
#========================================================
# Scene_Menu
#-----------------------------------------------------------------------------
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
super
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(0, 360)
@win_local = Window_Local.new(0,0)
@status_window = Window_MenuStatus.new(160, 0)
px = $game_player.screen_x - 16
py = $game_player.screen_y - 28
@ring_menu = Window_RingMenu_Comando.new(px,py)
@status_window.z = @ring_menu.z + 20
@status_window.visible = false
end
#--------------------------------------------------------------------------
# Zakończenie
#--------------------------------------------------------------------------
def terminate
super
@spriteset.dispose
@ring_menu.dispose
@gold_window.dispose
@win_local.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def update
super
@ring_menu.update
@gold_window.update
@win_local.update
@spriteset.update
@status_window.update
if @ring_menu.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Aktualizacja komend w menu
#--------------------------------------------------------------------------
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 @ring_menu.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @ring_menu.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @ring_menu.indice
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
$scene = Scene_MonsterBook.new
when 5
$scene = Scene_Party.new
when 6
$scene = Scene_File.new(true, false, false)
when 7
$scene = Scene_End.new
end
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
Sound.play_cursor
@ring_menu.girar(3)
return
end
if Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
@ring_menu.girar(4)
return
end
end
#--------------------------------------------------------------------------
# Rozpoczęcie wyboru postaci
#--------------------------------------------------------------------------
def start_actor_selection
@ring_menu.active = false
@status_window.visible = true
@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
#--------------------------------------------------------------------------
# Zakończenie wyboru postaci
#--------------------------------------------------------------------------
def end_actor_selection
@ring_menu.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# Aktualizacja wyboru postaci
#--------------------------------------------------------------------------
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 @ring_menu.indice
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#=========================================================
# Window_RingMenu_Comando
#=========================================================
class Window_RingMenu_Comando < Window_Base
DurIni = 30
DurMov = 15
RaioAnel = 64
ModoIni = 1
ModoEsp = 2
ModoMD = 3
ModoME = 4
SE_Inicio = ""
attr_accessor :indice
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = 'Bestiariusz'
s6 = 'DruĹĽyna'
s7 = Vocab::save
s8 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5,s6,s7,s8]
@item_max = 8
@item_icon = [AYENE::IKONA_PRZEDMIOT,
AYENE::IKONA_UMIEJETNOSC,AYENE::IKONA_EKWIPUNEK,
AYENE::IKONA_STATUS, AYENE::IKONA_BESTIARIUSZ, AYENE::IKONA_DRUZYNA, AYENE::IKONA_ZAPIS, AYENE::IKONA_WYJSCIE]
@item_hab = [true,true,true,true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# Odświeżenie
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @modo
when ModoIni
refresh_inicio
when ModoEsp
refresh_espera
when ModoMD
refresh_mover(1)
when ModoME
refresh_mover(0)
end
sw = self.contents.width
rect = Rect.new((@cx - ((sw-32)/2))+12, @cy - 40, sw-32, 32)
self.contents.draw_text(rect, @item_name[@indice],1)
end
#--------------------------------------------------------------------------
# Odświeżenie menu
#--------------------------------------------------------------------------
def refresh_inicio
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / DurIni
r = RaioAnel - 1.0 * RaioAnel * @passos / DurIni
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def refresh_espera
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @indice
x = @cx + ( RaioAnel * Math.sin( d * j ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d * j ) ).to_i
desenha_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# Odświeżenie wskaźnika
#--------------------------------------------------------------------------
def refresh_mover(modo)
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / DurMov
d2 *= -1 if modo != 0
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( RaioAnel * Math.sin( d ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Wyświetlanie ikon
#--------------------------------------------------------------------------
def desenha_item(x, y, i)
if @indice == i
self.cursor_rect.set(x-4, y-4, 32, 32)
draw_icon(@item_icon[i], x, y, @item_hab[i])
else
draw_icon(@item_icon[i], x, y, @item_hab[i])
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def inicia_menu
@modo = ModoIni
@passos = DurIni
if SE_Inicio != nil and SE_Inicio != ""
Audio.se_play("Audio/SE/" + SE_Inicio, 80, 100)
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def girar(modo)
if modo == ModoMD
@indice -= 1
@indice = @item_hab.size - 1 if @indice < 0
elsif modo == ModoME
@indice += 1
@indice = 0 if @indice >= @item_hab.size
else
return
end
@modo = modo
@passos = DurMov
end
end
#========================================================
# Scene_Title
#========================================================
class Scene_Title
alias load_database_old load_database
def load_database
load_database_old
$data_mapinfo = load_data("Data/MapInfos.rvdata")
end
end
#========================================================
# Window_Local
#========================================================
class Window_Local < Window_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 96)
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "Lokacja:")
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 120, 32, $data_mapinfo[$game_map.map_id].name, 2)
end
end
Jeśli chcesz dopasować ikonę do komendy w łatwy sposób, skorzystaj z programiku IconView
________________________
sled
Preferowany:
Pomógł: 7 razy Doł±czył: 23 Kwi 2010 Posty: 93 Sk±d: InowrocĹ‚aw
Wysłany: Pon 03 Maj, 2010 22:11
świetne menu! - właśnie czegoś takiego szukałem!
Tylko mam 1 prośbę - czy dałoby się zrobić tak, aby nie było opcji save w nim?
(tzw w tym menu, a nie normalnym jak to jest juĹĽ na forum podane)
Ayene
Ranga RM:
Pomogła: 232 razy Doł±czyła: 18 Wrz 2007 Posty: 2424
Wysłany: Wto 04 Maj, 2010 06:47
sled , zamień skrypt na poniższy:
Spoiler:
Kod: # ====================================================
# ~ Ring Menu VX ~
# Data publikacji: 23.10.2009
# Autor: DouglasMF
# Tłumaczenie i poprawki: Ayene [yurika@o2.pl]
# Zapraszamy na stronÄ™ Ultima Forum - http://www.ultimateam.pl
# =========================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# =========================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --------------------------- POCZĄTEK SKRYPTU -------------------------------
module AYENE
# ---------------------------- POCZĄTEK EDYCJI -------------------------------
IKONA_PRZEDMIOT = 144 # Ikona przedmiotu
IKONA_UMIEJETNOSC = 128 # Ikona umiejętności
IKONA_EKWIPUNEK = 40 # Ikona ekwipunku
IKONA_STATUS = 137 # Ikona statusu
IKONA_ZAPIS = 149 # Ikona zapisu
IKONA_WYJSCIE = 112 # Ikona wyjścia
# ----------------------------- KONIEC EDYCJI --------------------------------
end
# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^------------------
#========================================================
# Scene_Menu
#-----------------------------------------------------------------------------
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
super
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(0, 360)
@win_local = Window_Local.new(0,0)
@status_window = Window_MenuStatus.new(160, 0)
px = $game_player.screen_x - 16
py = $game_player.screen_y - 28
@ring_menu = Window_RingMenu_Comando.new(px,py)
@status_window.z = @ring_menu.z + 20
@status_window.visible = false
end
#--------------------------------------------------------------------------
# Zakończenie
#--------------------------------------------------------------------------
def terminate
super
@spriteset.dispose
@ring_menu.dispose
@gold_window.dispose
@win_local.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def update
super
@ring_menu.update
@gold_window.update
@win_local.update
@spriteset.update
@status_window.update
if @ring_menu.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Aktualizacja komend w menu
#--------------------------------------------------------------------------
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 @ring_menu.index < 4
Sound.play_buzzer
return
end
Sound.play_decision
case @ring_menu.indice
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
$scene = Scene_End.new
end
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
Sound.play_cursor
@ring_menu.girar(3)
return
end
if Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
@ring_menu.girar(4)
return
end
end
#--------------------------------------------------------------------------
# Rozpoczęcie wyboru postaci
#--------------------------------------------------------------------------
def start_actor_selection
@ring_menu.active = false
@status_window.visible = true
@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
#--------------------------------------------------------------------------
# Zakończenie wyboru postaci
#--------------------------------------------------------------------------
def end_actor_selection
@ring_menu.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# Aktualizacja wyboru postaci
#--------------------------------------------------------------------------
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 @ring_menu.indice
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#========================================================
# Window_RingMenu_Comando
#========================================================
class Window_RingMenu_Comando < Window_Base
DurIni = 30
DurMov = 15
RaioAnel = 64
ModoIni = 1
ModoEsp = 2
ModoMD = 3
ModoME = 4
SE_Inicio = ""
attr_accessor :indice
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5]
@item_max = 5
@item_icon = [AYENE::IKONA_PRZEDMIOT,
AYENE::IKONA_UMIEJETNOSC,AYENE::IKONA_EKWIPUNEK,
AYENE::IKONA_STATUS,AYENE::IKONA_WYJSCIE]
@item_hab = [true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# Odświeżenie
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @modo
when ModoIni
refresh_inicio
when ModoEsp
refresh_espera
when ModoMD
refresh_mover(1)
when ModoME
refresh_mover(0)
end
sw = self.contents.width
rect = Rect.new((@cx - ((sw-32)/2))+12, @cy - 40, sw-32, 32)
self.contents.draw_text(rect, @item_name[@indice],1)
end
#--------------------------------------------------------------------------
# Odświeżenie menu
#--------------------------------------------------------------------------
def refresh_inicio
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / DurIni
r = RaioAnel - 1.0 * RaioAnel * @passos / DurIni
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def refresh_espera
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @indice
x = @cx + ( RaioAnel * Math.sin( d * j ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d * j ) ).to_i
desenha_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# Odświeżenie wskaźnika
#--------------------------------------------------------------------------
def refresh_mover(modo)
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / DurMov
d2 *= -1 if modo != 0
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( RaioAnel * Math.sin( d ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Wyświetlanie ikon
#--------------------------------------------------------------------------
def desenha_item(x, y, i)
if @indice == i
self.cursor_rect.set(x-4, y-4, 32, 32)
draw_icon(@item_icon[i], x, y, @item_hab[i])
else
draw_icon(@item_icon[i], x, y, @item_hab[i])
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def inicia_menu
@modo = ModoIni
@passos = DurIni
if SE_Inicio != nil and SE_Inicio != ""
Audio.se_play("Audio/SE/" + SE_Inicio, 80, 100)
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def girar(modo)
if modo == ModoMD
@indice -= 1
@indice = @item_hab.size - 1 if @indice < 0
elsif modo == ModoME
@indice += 1
@indice = 0 if @indice >= @item_hab.size
else
return
end
@modo = modo
@passos = DurMov
end
end
#========================================================
# Scene_Title
#========================================================
class Scene_Title
alias load_database_old load_database
def load_database
load_database_old
$data_mapinfo = load_data("Data/MapInfos.rvdata")
end
end
#========================================================
# Window_Local
#========================================================
class Window_Local < Window_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 96)
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "Lokacja:")
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 120, 32, $data_mapinfo[$game_map.map_id].name, 2)
end
end
________________________
sled
Preferowany:
Pomógł: 7 razy Doł±czył: 23 Kwi 2010 Posty: 93 Sk±d: InowrocĹ‚aw
Wysłany: Wto 04 Maj, 2010 09:10
działa!
Dzięki za pomoc Ayene!
Gepardis
Preferowany:
Doł±czył: 16 Cze 2010 Posty: 24
Ayene
Ranga RM:
Pomogła: 232 razy Doł±czyła: 18 Wrz 2007 Posty: 2424
Wysłany: Pon 28 Cze, 2010 18:18
Gepardis , podmień skrypt z Ring_Menu na poniższy:
Spoiler:
Kod: #=====================================================
# ~ Ring Menu VX ~
# Data publikacji: 23.10.2009
# Autor: DouglasMF
# Tłumaczenie i poprawki: Ayene [yurika@o2.pl]
# Zapraszamy na stronÄ™ Ultima Forum - http://www.ultimateam.pl
# =========================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# =========================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --------------------------- POCZĄTEK SKRYPTU -------------------------------
module AYENE
# ---------------------------- POCZĄTEK EDYCJI -------------------------------
IKONA_PRZEDMIOT = 144 # Ikona przedmiotu
IKONA_UMIEJETNOSC = 128 # Ikona umiejętności
IKONA_EKWIPUNEK = 40 # Ikona ekwipunku
IKONA_STATUS = 137 # Ikona statusu
IKONA_ZAPIS = 149 # Ikona zapisu
IKONA_WYJSCIE = 112 # Ikona wyjścia
IKONA_PUNKTY = 110
# ----------------------------- KONIEC EDYCJI --------------------------------
end
# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^------------------
#=============================================================================
# Scene_Menu
#-----------------------------------------------------------------------------
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
super
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(0, 360)
@win_local = Window_Local.new(0,0)
@status_window = Window_MenuStatus.new(160, 0)
px = $game_player.screen_x - 16
py = $game_player.screen_y - 28
@ring_menu = Window_RingMenu_Comando.new(px,py)
@status_window.z = @ring_menu.z + 20
@status_window.visible = false
end
#--------------------------------------------------------------------------
# Zakończenie
#--------------------------------------------------------------------------
def terminate
super
@spriteset.dispose
@ring_menu.dispose
@gold_window.dispose
@win_local.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def update
super
@ring_menu.update
@gold_window.update
@win_local.update
@spriteset.update
@status_window.update
if @ring_menu.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Aktualizacja komend w menu
#--------------------------------------------------------------------------
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 @ring_menu.index < 5
Sound.play_buzzer
return
elsif $game_system.save_disabled and @ring_menu.index == 5
Sound.play_buzzer
return
end
Sound.play_decision
case @ring_menu.indice
when 0
$scene = Scene_Item.new
when 1,2,3,4
start_actor_selection
when 5
$scene = Scene_File.new(true, false, false)
when 6
$scene = Scene_End.new
end
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
Sound.play_cursor
@ring_menu.girar(3)
return
end
if Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
@ring_menu.girar(4)
return
end
end
#--------------------------------------------------------------------------
# Rozpoczęcie wyboru postaci
#--------------------------------------------------------------------------
def start_actor_selection
@ring_menu.active = false
@status_window.visible = true
@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
#--------------------------------------------------------------------------
# Zakończenie wyboru postaci
#--------------------------------------------------------------------------
def end_actor_selection
@ring_menu.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# Aktualizacja wyboru postaci
#--------------------------------------------------------------------------
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 @ring_menu.indice
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
when 4
$scene = Scene_RequiemUpgrade.new(@status_window.index,true)
end
end
end
end
#==============================================================================
# Window_RingMenu_Comando
#==============================================================================
class Window_RingMenu_Comando < Window_Base
DurIni = 30
DurMov = 15
RaioAnel = 64
ModoIni = 1
ModoEsp = 2
ModoMD = 3
ModoME = 4
SE_Inicio = ""
attr_accessor :indice
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = "Punkty"
s6 = Vocab::save
s7 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5,s6,s7]
@item_max = 7
@item_icon = [AYENE::IKONA_PRZEDMIOT,
AYENE::IKONA_UMIEJETNOSC,AYENE::IKONA_EKWIPUNEK,
AYENE::IKONA_STATUS, AYENE::IKONA_PUNKTY, AYENE::IKONA_ZAPIS, AYENE::IKONA_WYJSCIE]
@item_hab = [true,true,true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# Odświeżenie
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @modo
when ModoIni
refresh_inicio
when ModoEsp
refresh_espera
when ModoMD
refresh_mover(1)
when ModoME
refresh_mover(0)
end
sw = self.contents.width
rect = Rect.new((@cx - ((sw-32)/2))+12, @cy - 40, sw-32, 32)
self.contents.draw_text(rect, @item_name[@indice],1)
end
#--------------------------------------------------------------------------
# Odświeżenie menu
#--------------------------------------------------------------------------
def refresh_inicio
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / DurIni
r = RaioAnel - 1.0 * RaioAnel * @passos / DurIni
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Aktualizacja menu
#--------------------------------------------------------------------------
def refresh_espera
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @indice
x = @cx + ( RaioAnel * Math.sin( d * j ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d * j ) ).to_i
desenha_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# Odświeżenie wskaźnika
#--------------------------------------------------------------------------
def refresh_mover(modo)
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / DurMov
d2 *= -1 if modo != 0
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( RaioAnel * Math.sin( d ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Wyświetlanie ikon
#--------------------------------------------------------------------------
def desenha_item(x, y, i)
if @indice == i
self.cursor_rect.set(x-4, y-4, 32, 32)
draw_icon(@item_icon[i], x, y, @item_hab[i])
else
draw_icon(@item_icon[i], x, y, @item_hab[i])
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def inicia_menu
@modo = ModoIni
@passos = DurIni
if SE_Inicio != nil and SE_Inicio != ""
Audio.se_play("Audio/SE/" + SE_Inicio, 80, 100)
end
end
#--------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------
def girar(modo)
if modo == ModoMD
@indice -= 1
@indice = @item_hab.size - 1 if @indice < 0
elsif modo == ModoME
@indice += 1
@indice = 0 if @indice >= @item_hab.size
else
return
end
@modo = modo
@passos = DurMov
end
end
#==============================================================================
# Scene_Title
#==============================================================================
class Scene_Title
alias load_database_old load_database
def load_database
load_database_old
$data_mapinfo = load_data("Data/MapInfos.rvdata")
end
end
#==============================================================================
# Window_Local
#==============================================================================
class Window_Local < Window_Base
#--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 96)
refresh
end
#--------------------------------------------------------------------------
# Aktualizacja
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "Lokacja:")
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 120, 32, $data_mapinfo[$game_map.map_id].name, 2)
end
end
A w skrypcie z rozdawaniem punktów usuń fragment od:
Kod: class Scene_Menu < Scene_Base
do samego końca.
________________________
Gepardis
Preferowany:
Doł±czył: 16 Cze 2010 Posty: 24
Wysłany: Pon 28 Cze, 2010 20:10
Wielkie dzięki, teraz wszystko działa.
Lukortech
Preferowany:
Doł±czył: 08 Maj 2010 Posty: 42
Wysłany: Czw 12 Sie, 2010 11:03
Wszystko pięknie ładnie...
Tylko co jeśli gracz stanie na górnym/lewym/dolnym/prawym krańcu mapy i uruchomi menu?
U mnie przycięło :D
________________________ Spoiler:
I'am making the world a better place...
krzysiaczek2
Doł±czył: 30 Kwi 2010 Posty: 1
Wysłany: Sro 25 Sie, 2010 15:04
Witam!
Mam takie pytanie: czy da się zrobić tak, by była dodatkowa opcja wyboru mapy w menu?
Pozdrawiam
FilipsO
Preferowany:
Ranga RM:
Pomógł: 1 raz Doł±czył: 21 Maj 2010 Posty: 236 Sk±d: z nikÄ…d
Wysłany: Sro 25 Sie, 2010 18:59
Pewnie ĹĽe siÄ™ da. W skryptach.
________________________ 89% graczy uwaĹĽa, ĹĽe najwaĹĽniejsza jest grafika.
Jeśli należysz do pozostałych 11% wklej to do swojego podpisu.
Moja Gra MMORPG Erathia:
pro14ab
Preferowany:
Pomógł: 5 razy Doł±czył: 20 Maj 2011 Posty: 32
Angius
Nie wkurzać
Preferowany:
Pomógł: 104 razy Doł±czył: 30 PaĽ 2010 Posty: 1276 Sk±d: wROCK
Wysłany: Sob 28 Maj, 2011 23:56
A dałoby się wywalić wywalić save, dałoby się... Zmień tan fragment:
Spoiler:
Kod: #--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5,s6]
@item_max = 6
@item_icon = [AYENE::IKONA_PRZEDMIOT,
AYENE::IKONA_UMIEJETNOSC,AYENE::IKONA_EKWIPUNEK,
AYENE::IKONA_STATUS,AYENE::IKONA_ZAPIS,AYENE::IKONA_WYJSCIE]
@item_hab = [true,true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
Na:
Spoiler:
Kod: #--------------------------------------------------------------------------
# Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s6 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s6]
@item_max = 6
@item_icon = [AYENE::IKONA_PRZEDMIOT,
AYENE::IKONA_UMIEJETNOSC,AYENE::IKONA_EKWIPUNEK,
AYENE::IKONA_STATUS,AYENE::IKONA_WYJSCIE]
@item_hab = [true,true,true,true,false,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
O ile się orientuję, powinno działać... Choć pewnie zapomniałem wywalić jeszcze jakiegoś fragmentu, jak zwykle
________________________ "Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
pro14ab
Preferowany:
Pomógł: 5 razy Doł±czył: 20 Maj 2011 Posty: 32
Nie możesz pisać nowych tematówNie możesz odpowiadać w tematachNie możesz zmieniać swoich postówNie możesz usuwać swoich postówNie możesz głosować w ankietachNie możesz zał±czać plików na tym forumMożesz ¶ci±gać zał±czniki na tym forum
Dodaj temat do Ulubionych Wersja do druku