【XP】图标菜单优化+地图名
好吧我其实是大自然的搬运工!效果图来也好了那啥啥的不说了
方法:
插入到main前面创建新的然后粘贴不用我多说吧- -
358行请改为@disabled = [ false, false, false, false, false, false ]
RUBY 代码
#===================================================
# ■ Ring Menu - Show Player Location - Release #1 (Enhanced By Dubealex)
#===================================================
# For more infos and update, visit:
# asylum.dubealex.com
#
# Original Ring Menu by: 和希 (From XRXS)
# Original Edit and Fix by: Maki
# Show Player Location Version by: Dubealex
#
# You can customize this script at line #35 - Have fun !!
# If you want to show more stuff, its easy to do, you can try to ask in the forum.
#
#
#===================================================
#===================================================
# ▼ CLASS Scene_Menu Begins
#===================================================
class Scene_Menu
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# menu_index : ƒRƒ}ƒ“ƒh‚̃J[ƒ\ƒ‹‰ŠúˆÊ’u
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
$location_text=[]
$window_size=[]
$ring_menu_text=[]
$chara_select=[]
@window_opacity=[]
@chara_select=[]
@window_position=[]
#--------------------------------------------------------------------------------------------------
# ■ Ring Menu Customization Section: (By Dubealex)
#--------------------------------------------------------------------------------------------------
# Those variables defines how the script will act.
# Simply change the value by those you want.
# Remember that changing the font size has its limitation due to text space allocation.
#
# ▼ TEXT SETTINGS FOR SHOW PLAYER LOCATION WINDOW:
$location_text="Tahoma" # Font Type
$location_text=22 # Font Size
$location_text=6 # Location Title Color
$location_text=0 # Map Name Color
$location_text="Location:" # Customize the "Location" Title Text
# ▼ SHOW LOCATION WINDOW SETTINS:
@show_location_window=true #Set to false to not use it !
@window_opacity=255 # Border Opacity
@window_opacity=130 # Background Opacity
$window_location_skin="001-Blue01" # Window Skin
@window_position=20 # X Axis Position
@window_position=20 # Y Axis Position
$window_size=160 # Lengh
$window_size=96 # Heigh
# ▼TEXT SETTINGS FOR INSIDE THE RING MENU:
$ring_menu_text="Tahoma" # Font Type
$ring_menu_text=0 # Font Color
$ring_menu_text=22 # Font Size
$ring_menu_text="Items" # Items Menu Text
$ring_menu_text="Skills" # Skills Menu Text
$ring_menu_text="Equip" # Equip Menu Text
$ring_menu_text="Stats" # Stats Menu Text
$ring_menu_text="Save" # Save Menu Text
$ring_menu_text="Quit" # Quit Menu Text
# ▼CHARACTER SELECTION WINDOW SETTINGS :
@chara_select=400 # X Axis Position
@chara_select=0 # Y Axis Position
$chara_select="Tahoma" # Font Type
$chara_select=0 # Font Color
$chara_select=22 # Font Size
$chara_select=255 # Window Border Opacity
$chara_select=130 # Window Background Opacity
$chara_select="001-Blue01"# Window Skin to use
#--------------------------------------------------------------------------------------------------
end
#--------------------------------------------------------------------------
# œ ƒƒCƒ“ˆ—
#--------------------------------------------------------------------------
def main
# Show Player Location Feature:
if@show_location_window==true
@window_location = Window_Location.new
@window_location.x = @window_position
@window_location.y = @window_position
@window_location.opacity = @window_opacity
@window_location.back_opacity = @window_opacity
end
#End of Show Player Location
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬
@spriteset = Spriteset_Map.new
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬
px = $game_player.screen_x - 15
py = $game_player.screen_y - 24
@command_window = Window_RingMenu.new(px,py)
@command_window.index = @menu_index
# ƒp[ƒeƒBl”‚ª 0 l‚Ìê‡
if$game_party.actors.size == 0
# ƒAƒCƒeƒ€AƒXƒLƒ‹A‘•”õAƒXƒe[ƒ^ƒX‚𖳌ø‰»
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.z = 100
# ƒZ[ƒu‹ÖŽ~‚Ìê‡
if$game_system.save_disabled
# ƒZ[ƒu‚𖳌ø‚É‚·‚é
@command_window.disable_item(4)
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬
@status_window = Window_RingMenuStatus.new
@status_window.x = @chara_select
@status_window.y = @chara_select
@status_window.z = 200
@status_window.opacity=$chara_select
@status_window.back_opacity=$chara_select
@status_window.visible = false
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
Graphics.transition
# ƒƒCƒ“ƒ‹[ƒv
loopdo
# ƒQ[ƒ€‰æ–Ê‚ðXV
Graphics.update
# “ü—Íî•ñ‚ðXV
Input.update
# ƒtƒŒ[ƒ€XV
update
# ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f
if$scene != self
break
end
end
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ
Graphics.freeze
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú
@spriteset.dispose
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
if@show_location_window==true
@window_location.dispose
end
@command_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚ðXV
if@show_location_window==true
@window_location.update
end
@command_window.update
@status_window.update
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_command ‚ðŒÄ‚Ô
if@command_window.active
update_command
return
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_status ‚ðŒÄ‚Ô
if@status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_command
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Map.new
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒp[ƒeƒBl”‚ª 0 l‚ÅAƒZ[ƒuAƒQ[ƒ€I—¹ˆÈŠO‚̃Rƒ}ƒ“ƒh‚Ìê‡
if$game_party.actors.size == 0and@command_window.index < 4
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case@command_window.index
when0# ƒAƒCƒeƒ€
# Œˆ’èSE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒCƒeƒ€‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Item.new
when1# ƒXƒLƒ‹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when2# ‘•”õ
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when3# ƒXƒe[ƒ^ƒX
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when4# ƒZ[ƒu
# ƒZ[ƒu‹ÖŽ~‚Ìê‡
if$game_system.save_disabled
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒZ[ƒu‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Save.new
when5# ƒQ[ƒ€I—¹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒQ[ƒ€I—¹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_End.new
end
return
end
# ƒAƒjƒ[ƒVƒ‡ƒ“’†‚È‚çƒJ[ƒ\ƒ‹‚̈—‚ðs‚í‚È‚¢
returnif@command_window.animation?
# ªor© ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.press?(Input::UP)orInput.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
return
end
# «or¨ ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.press?(Input::DOWN)orInput.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_status
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case@command_window.index
when1# ƒXƒLƒ‹
# ‚±‚̃AƒNƒ^[‚Ìs“®§ŒÀ‚ª 2 ˆÈã‚Ìê‡
if$game_party.actors[@status_window.index].restriction >= 2
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒLƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Skill.new(@status_window.index)
when2# ‘•”õ
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ‘•”õ‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Equip.new(@status_window.index)
when3# ƒXƒe[ƒ^ƒX
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒX‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#===================================================
# ▲ CLASS Scene_Menu Ends
#===================================================
#===================================================
# ▼ CLASS Window_RingMenuBegins
#===================================================
class Window_RingMenu < Window_Base
#--------------------------------------------------------------------------
# › ƒNƒ‰ƒX’è”
#--------------------------------------------------------------------------
STARTUP_FRAMES = 20
MOVING_FRAMES = 5
RING_R = 64
ICON_ITEM = RPG::Cache.icon("034-Item03")
ICON_SKILL= RPG::Cache.icon("044-Skill01")
ICON_EQUIP= RPG::Cache.icon("001-Weapon01")
ICON_STATUS = RPG::Cache.icon("050-Skill07")
ICON_SAVE = RPG::Cache.icon("038-Item07")
ICON_EXIT = RPG::Cache.icon("046-Skill03")
ICON_DISABLE= RPG::Cache.icon("")
SE_STARTUP = "056-Right02"
MODE_START = 1
MODE_WAIT= 2
MODE_MOVER = 3
MODE_MOVEL = 4
#--------------------------------------------------------------------------
# › ƒAƒNƒZƒT
#--------------------------------------------------------------------------
attr_accessor :index
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize( center_x, center_y )
super(0, 0, 640, 480)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = $ring_menu_text
self.contents.font.color = text_color($ring_menu_text)
self.contents.font.size = $ring_menu_text
self.opacity = 0
self.back_opacity = 0
s1 = $ring_menu_text
s2 = $ring_menu_text
s3 = $ring_menu_text
s4 = $ring_menu_text
s5 = $ring_menu_text
s6 = $ring_menu_text
@commands = [ s1, s2, s3, s4, s5, s6 ]
@item_max = 6
@index = 0
@items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]
@disabled =
@cx = center_x - 16
@cy = center_y - 16
setup_move_start
refresh
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# œ ‰æ–ÊÄ•`‰æ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# ƒAƒCƒRƒ“‚ð•`‰æ
case@mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end
# ƒAƒNƒeƒBƒu‚ȃRƒ}ƒ“ƒh–¼•\Ž¦
rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
self.contents.draw_text(rect, @commands[@index],1)
end
#--------------------------------------------------------------------------
# › ‰æ–ÊÄ•`‰æ(‰Šú‰»Žž)
#--------------------------------------------------------------------------
def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d )).to_i
y = @cy - ( r * Math.cos( d )).to_i
draw_item(x, y, i)
end
@steps -= 1
if@steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
# › ‰æ–ÊÄ•`‰æ(‘Ò‹@Žž)
#--------------------------------------------------------------------------
def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j )).to_i
y = @cy - ( RING_R * Math.cos( d * j )).to_i
draw_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# › ‰æ–ÊÄ•`‰æ(‰ñ“]Žž)
#mode : 0=”½ŽžŒv‰ñ‚è 1=ŽžŒv‰ñ‚è
#--------------------------------------------------------------------------
def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1if mode != 0
for i in0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d )).to_i
y = @cy - ( RING_R * Math.cos( d )).to_i
draw_item(x, y, i)
end
@steps -= 1
if@steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
# œ €–Ú‚Ì•`‰æ
# x :
# y :
# i : €–Ú”Ô†
#--------------------------------------------------------------------------
def draw_item(x, y, i)
#p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items.to_s
rect = Rect.new(0, 0, @items.width, @items.height)
if@index == i
self.contents.blt( x, y, @items, rect )
if@disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items, rect, 128)
if@disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128)
end
end
end
#--------------------------------------------------------------------------
# œ €–ڂ𖳌ø‚É‚·‚é
# index : €–Ú”Ô†
#--------------------------------------------------------------------------
def disable_item(index)
@disabled = true
end
#--------------------------------------------------------------------------
# › ‰Šú‰»ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì€”õ
#--------------------------------------------------------------------------
def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
ifSE_STARTUP != niland SE_STARTUP != ""
Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
end
end
#--------------------------------------------------------------------------
# › ‰ñ“]ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì€”õ
#--------------------------------------------------------------------------
def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1if@index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0if@index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end
#--------------------------------------------------------------------------
# › ƒAƒjƒ[ƒVƒ‡ƒ“’†‚©‚Ç‚¤‚©
#--------------------------------------------------------------------------
def animation?
return@mode != MODE_WAIT
end
end
#===================================================
# ▲ CLASS Window_RingMenu Ends
#===================================================
#===================================================
# ▼ CLASS Window_RingMenuStatus Begins
#===================================================
class Window_RingMenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(204, 64, 232, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = $chara_select
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($chara_select)
self.contents.font.name = $chara_select
self.contents.font.color = text_color($chara_select)
@item_max = $game_party.actors.size
for i in0...$game_party.actors.size
x = 80
y = 80 * i
actor = $game_party.actors
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y + 24)
end
end
#--------------------------------------------------------------------------
# œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV
#--------------------------------------------------------------------------
def update_cursor_rect
if@index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
end
end
end
#===================================================
# ▲ CLASS Window_RingMenuStatus Ends
#===================================================
#===================================================
# ▼ CLASS Game_Map Additional Code Begins
#===================================================
class Game_Map
#Dubealex Addition (from XRXS) to show Map Name on screen
def name
$map_infos[@map_id]
end
end
#===================================================
# ▲ CLASS Game_Map Additional Code Ends
#===================================================
#===================================================
# ▼ CLASS Scene_Title Additional Code Begins
#===================================================
class Scene_Title
#Dubealex Addition (from XRXS) to show Map Name on screen
$map_infos = load_data("Data/MapInfos.rxdata")
for key in$map_infos.keys
$map_infos = $map_infos.name
end
end
#===================================================
# ▲ CLASS Scene_Title Additional Code Ends
#===================================================
#===================================================
# ▼ CLASS Window_Location Begins
#===================================================
class Window_Location < Window_Base
def initialize
super(0, 0, $window_size, $window_size)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $location_text
self.contents.font.size = $location_text
refresh
end
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($window_location_skin)
self.contents.font.color = text_color($location_text)
self.contents.draw_text(4, 0, 120, 32, $location_text)
self.contents.font.color = text_color($location_text)
self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2)
end
end
#===================================================
# ▲ CLASS Window_Location Ends
#===================================================
#===================================================
# ▲ Ring Menu - Show Player Location R1 - Ends
#===================================================
似乎有点长,,,不过效果还是很可观的- -
那么!给点糖呗
本帖来自P1论坛作者1041235896,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=375980若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]