Project1
标题:
【夜想曲·改】快捷键问题
[打印本页]
作者:
iNG.天影-冰
时间:
2012-1-24 10:40
标题:
【夜想曲·改】快捷键问题
本帖最后由 iNG.天影-冰 于 2012-1-24 21:39 编辑
就是更改夜想曲·改的快捷键的位置 使之与图片相符
图片:
未命名-1.png
(15.02 KB, 下载次数: 8)
下载附件
保存到相册
2012-1-24 10:36 上传
特技快捷键脚本(从【DNF单机】搬来的):
#==============================================================================
# ■ Window_KeyCommand
#------------------------------------------------------------------------------
# 选择快捷键的窗口
#==============================================================================
class Window_KeyCommand < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(73-16, 480-106, 520, 155)#(73-16, 480-71, 520, 155)
self.contents = Bitmap.new(width - 29, height - 32)
self.opacity = 0
@item_max = 12
@column_max = 6
@commands = ["F1", "F2", "F3", "F4", "F5", "F6", "A", "S", "D", "F", "G", "H"]
refresh
self.index = -1
self.active = false
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh(actor=nil)
self.contents.clear
if actor != nil
u = 0
u2 = 0
for key in ["F1", "F2", "F3", "F4", "F5", "F6"]
skill = $game_skills[actor.key[key]]
if !skill.nil?
bitmap = RPG::Cache.icon(skill.icon_name)
x = 305 + u * (180)/6#305 + u * (200)/6
self.contents.font.size = 12
self.contents.font.color = Color.new(255,255,255,255)
self.contents.blt(x,16,bitmap,Rect.new(0,0,28,30))
self.contents.draw_text(x, 24, 128, 30, "")#"MP:#{skill.sp_cost}")
end
u += 1
end
for key2 in ["A", "S", "D", "F", "G", "H"]
skill = $game_skills[actor.key[key2]]
if !skill.nil?
bitmap = RPG::Cache.icon(skill.icon_name)
x = 305 + u2 * (180)/6
self.contents.font.size = 12
self.contents.font.color = Color.new(255,255,255,255)
self.contents.blt(x,51,bitmap,Rect.new(0,0,30,30))
self.contents.draw_text(x, 59, 128, 32, "")#"MP:#{skill.sp_cost}")
#
end
u2 += 1
end
end
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
x = 315 + index * (180)/6
self.contents.font.size = 16
self.contents.font.color = Color.new(20,20,20)
self.contents.draw_text(x+1, 1, 128, 28, " ")
self.contents.font.color = Color.new(135,175,255)
self.contents.draw_text(x, 0, 128, 28, " ")
x2 = 315 + -1 * (180)/6
self.contents.font.size = 14
self.contents.font.color = Color.new(20,20,20)
self.contents.draw_text(x2+1, 31, 258, 32, " ")
# self.contents.draw_text(x2+1, 31, 128, 32, @commands[index])
self.contents.font.color = Color.new(135,175,255)
self.contents.draw_text(x2, 30, 258, 32, " ")
# self.contents.draw_text(x2, 30, 128, 32, @commands[index])
end
#--------------------------------------------------------------------------
# ● 更新光标举行
#--------------------------------------------------------------------------
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index / @column_max
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.top_row = row
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.top_row = row - (self.page_row_max - 1)
end
# 计算光标的宽
cursor_width = self.width / @column_max - 30
# 计算光标坐标
x = @index % @column_max * (180)/6
y = @index / @column_max * 32 - self.oy
# 更新国标矩形
self.cursor_rect.set(305+x, y+8, 30, 40)
end
end
#==============================================================================
# ■ Scene_Key
#------------------------------------------------------------------------------
# 处理中快捷键的类。
#==============================================================================
class Scene_Key < Scene_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# actor_index : 角色索引
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
super()
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main_start
super
@actor = $game_party.actors[@actor_index]
# 生成帮助窗口、状态窗口、特技窗口
@help_window = Window_Help.new
@skill_window = Window_Skill.new(@actor)
@skill_window.z -= 98
@skill_window.height = 37*9
@skill_window.back_opacity = 160
@help_window.back_opacity = 160
@key_window = Window_KeyCommand.new
@key_window.refresh(@actor)
# 关联帮助窗口
@skill_window.help_window = @help_window
@windows.push(@help_window)
@windows.push(@skill_window)
@windows.push(@key_window)
end
def make_sprite
@spriteset = Spriteset_Map.new
@arpg_actor = ARPG_Actor.new
end
def dispose_sprite
@spriteset.dispose
@arpg_actor.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新命令窗口
@arpg_actor.update
if @skill_window.active
update_skill
return
end
if @key_window.active
update_key
return
end
end
#--------------------------------------------------------------------------
# ● 刷新技能窗口
#--------------------------------------------------------------------------
def update_skill
@skill_window.update
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
@skill_window.pclear
$game_system.se_play($data_system.cancel_se)
# 切换到菜单画面
$scene = Scene_Map.new
return
end
# 按下 C 键的场合下
if Input.trigger?(Input::C)
M.ok
@skill_window.active = false
@key_window.active = true
@key_window.index = 0
end
end
#--------------------------------------------------------------------------
# ● 刷新选择键位
#--------------------------------------------------------------------------
def update_key
@key_window.update
if Input.trigger?(Input::C)
skill = @skill_window.skill
case @key_window.index
when 6
key_start("A",skill)
when 7
key_start("S",skill)
when 8
key_start("D",skill)
when 9
key_start("F",skill)
when 10
key_start("G",skill)
when 11
key_start("H",skill)
when 0
key_start("F1",skill)
when 1
key_start("F2",skill)
when 2
key_start("F3",skill)
when 3
key_start("F4",skill)
when 4
key_start("F5",skill)
when 5
key_start("F6",skill)
end
end
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@key_window.active = false
@key_window.index = -1
return
end
end
#--------------------------------------------------------------------------
# ● 设置键位
#--------------------------------------------------------------------------
def key_start(key,skill)
if skill.nil?
@actor.key[key] = 0
else
@actor.key[key] = skill.id
end
@skill_window.active = true
@key_window.active = false
@key_window.index = -1
@key_window.refresh(@actor)
M.eq
return
end
end
复制代码
物品快捷键脚本:
#==============================================================================
# ■ Window_Item_KeyCommand
#------------------------------------------------------------------------------
# 选择快捷键的窗口
#==============================================================================
class Window_Item_KeyCommand < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(284, 37, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@item_max = 3
@column_max = 3
@commands = ["1", "2", "3"]
refresh
self.index = -1
self.active = false
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh(actor=nil)
self.contents.clear
if actor != nil
u = 0
for key in ["1","2","3"]
item = $data_items[actor.item_key[key]]
if !item.nil?
if $game_party.item_number(item.id) == 0
actor.item_key[key] = 0
refresh(actor)
return
end
bitmap = RPG::Cache.icon(item.icon_name)
x = 0
self.contents.font.size = 12
self.contents.font.color = Color.new(255,255,255,255)
self.contents.blt(x,16,bitmap,Rect.new(0,0,30,30))
self.contents.draw_text(x,26, 128, 32,"")
self.contents.draw_text(x+10,24, 128, 40,"")
end
u += 1
end
end
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
x = 104 + index * (120)/3
self.contents.font.size = 16
self.contents.font.color = Color.new(20,20,20)
self.contents.draw_text(x+1, 1, 128, 32, "")
self.contents.font.color = Color.new(135,175,255)
self.contents.draw_text(x, 0, 128, 32, "")
end
#--------------------------------------------------------------------------
# ● 更新光标举行
#--------------------------------------------------------------------------
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index / @column_max
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.top_row = row
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.top_row = row - (self.page_row_max - 1)
end
# 计算光标的宽
cursor_width = 0
# 计算光标坐标
x = @index % @column_max * (120)/3
y = @index / @column_max * 32 - self.oy
# 更新国标矩形
self.cursor_rect.set(x, y, 30, 30)
end
end
#==============================================================================
# ■ Scene_Key
#------------------------------------------------------------------------------
# 处理中快捷键的类。
#==============================================================================
class Scene_Item_Key < Scene_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# actor_index : 角色索引
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
super()
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main_start
super
# 获取角色
@actor = $game_party.actors[@actor_index]
# 生成帮助窗口、状态窗口、特技窗口
@help_window = Window_Help.new
@item_window = Window_Item.new#(@actor)
@item_window.z -= 98
@item_window.height = 256
@item_window.back_opacity = 0
@help_window.back_opacity = 160
@key_window = Window_Item_KeyCommand.new
@key_window.refresh(@actor)
# 关联帮助窗口
@item_window.help_window = @help_window
@windows.push(@help_window)
@windows.push(@item_window)
@windows.push(@key_window)
end
def make_sprite
@spriteset = Spriteset_Map.new
@arpg_actor = ARPG_Actor.new
end
def dispose_sprite
@spriteset.dispose
@arpg_actor.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新命令窗口
@arpg_actor.update
if @item_window.active
update_item
return
end
if @key_window.active
update_key
return
end
end
#--------------------------------------------------------------------------
# ● 刷新技能窗口
#--------------------------------------------------------------------------
def update_item
@item_window.update
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换到菜单画面
$scene = Scene_Map.new
return
end
# 按下 C 键的场合下
if Input.trigger?(Input::C)
item = @item_window.item
return if !$game_party.item_can_use?(item.id)
M.ok
@item_window.active = false
@key_window.active = true
@key_window.index = 0
end
end
#--------------------------------------------------------------------------
# ● 刷新选择键位
#--------------------------------------------------------------------------
def update_key
@key_window.update
if Input.trigger?(Input::C)
item = @item_window.item
case @key_window.index
when 0
key_start("1",item)
when 1
key_start("2",item)
when 2
key_start("3",item)
end
end
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
@item_window.active = true
@key_window.active = false
@key_window.index = -1
return
end
end
#--------------------------------------------------------------------------
# ● 设置键位
#--------------------------------------------------------------------------
def key_start(key,item)
if item.nil?
@actor.item_key[key] = 0
else
@actor.item_key[key] = item.id
end
@item_window.active = true
@key_window.active = false
@key_window.index = -1
@key_window.refresh(@actor)
M.eq
return
end
end
复制代码
技能第一格 x:104 y:22
物品第一格 x:284 y:37 dsu_plus_rewardpost_czw
作者:
文军诺
时间:
2012-1-25 18:15
我不明白。说起来你邀请我干什么=_=
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1