Project1
标题:
VX如何添加新的选项在菜单中
[打印本页]
作者:
沈基拉
时间:
2011-8-27 19:39
提示:
作者被禁止或删除 内容自动屏蔽
作者:
仲秋启明
时间:
2011-8-27 19:54
http://rpg.blue/thread-163873-1-1.html
像忧雪说的一样,我的好人卡不是那么有技术含量
作者:
沈基拉
时间:
2011-8-27 20:37
提示:
作者被禁止或删除 内容自动屏蔽
作者:
fux2
时间:
2011-8-27 20:53
沈基拉 发表于 2011-8-27 20:37
关于那个添加选择项“是” “否”,以免游戏中按错,可以添加上去吗? ...
邪恶提示:别忘了点我下面的“认可答案”按钮哦~
module Fux2
MOVE_SWITCH = 50 # 禁止传送选项的开关号
TARGET_MAP_ID = 1 # 目标传送地图ID
TARGET_X = 10 # 目标传送地图X坐标
TARGET_Y = 10 # 目标传送地图Y坐标
TARGET_D = 8 # 传送后人物朝向,2,4,6,8
end
class Window_Command_Fux < Window_Selectable
def initialize
row_max = 2
super(150, 100, 250, row_max * WLH + 64, 5)
@commands = ["是","否"]
@item_max = @commands.size
@column_max = 1
refresh
self.index = 0
end
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = WLH
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * WLH + 32
return rect
end
def refresh
self.contents.clear
self.contents.draw_text(0,0,200,32,"你确定要传送吗?")
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index])
end
end
class Scene_Menu < Scene_Base
include Fux2
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
s7 = "神秘功能"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
if $game_party.members.size == 0
@command_window.draw_item(0, false)
@command_window.draw_item(1, false)
@command_window.draw_item(2, false)
@command_window.draw_item(3, false)
end
if $game_system.save_disabled
@command_window.draw_item(4, false)
end
if $game_switches[MOVE_SWITCH] == true
@command_window.draw_item(6, false)
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
elsif $game_switches[50] == true && @command_window.index == 6
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
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
when 6
call_move_proc
end
end
end
def call_move_proc
fux = Window_Command_Fux.new
fux.index = 0
fux.active = true
fux.z = 99999
fux2 = 0
loop do
Input.update
Graphics.update
fux.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.buzzer_se)
fux.dispose
return
end
if Input.trigger?(Input::C)
fux2 = fux.index
break
end
end
fux.dispose
case fux2
when 0
$game_player.reserve_transfer(TARGET_MAP_ID, TARGET_X, TARGET_Y, TARGET_D)
$scene = Scene_Map.new
end
return
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1