设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1377|回复: 1
打印 上一主题 下一主题

[已经过期] 【夜想曲·改】快捷键问题

[复制链接]

Lv1.梦旅人

CHN·TY·A

梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-1-14
帖子
213
跳转到指定楼层
1
发表于 2012-1-24 10:40:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 iNG.天影-冰 于 2012-1-24 21:39 编辑

就是更改夜想曲·改的快捷键的位置 使之与图片相符

图片:


特技快捷键脚本(从【DNF单机】搬来的):
  1. #==============================================================================
  2. # ■ Window_KeyCommand
  3. #------------------------------------------------------------------------------
  4. #  选择快捷键的窗口
  5. #==============================================================================
  6. class Window_KeyCommand < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(73-16, 480-106, 520, 155)#(73-16, 480-71, 520, 155)
  12.     self.contents = Bitmap.new(width - 29, height - 32)
  13.     self.opacity = 0
  14.     @item_max = 12
  15.     @column_max = 6
  16.     @commands = ["F1", "F2", "F3", "F4", "F5", "F6", "A", "S", "D", "F", "G", "H"]
  17.     refresh
  18.     self.index = -1
  19.     self.active = false
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 刷新
  23.   #--------------------------------------------------------------------------
  24.   def refresh(actor=nil)
  25.     self.contents.clear
  26.     if actor != nil
  27.       u = 0
  28.       u2 = 0
  29.       for key in ["F1", "F2", "F3", "F4", "F5", "F6"]
  30.         skill = $game_skills[actor.key[key]]
  31.         if !skill.nil?
  32.           bitmap = RPG::Cache.icon(skill.icon_name)
  33.           x = 305 + u * (180)/6#305 + u * (200)/6
  34.           self.contents.font.size = 12
  35.           self.contents.font.color = Color.new(255,255,255,255)
  36.           self.contents.blt(x,16,bitmap,Rect.new(0,0,28,30))
  37.           self.contents.draw_text(x, 24, 128, 30, "")#"MP:#{skill.sp_cost}")
  38.         end
  39.           u += 1
  40.         end
  41.       for key2 in ["A", "S", "D", "F", "G", "H"]
  42.         skill = $game_skills[actor.key[key2]]
  43.         if !skill.nil?
  44.           bitmap = RPG::Cache.icon(skill.icon_name)
  45.           x = 305 + u2 * (180)/6
  46.           self.contents.font.size = 12
  47.           self.contents.font.color = Color.new(255,255,255,255)
  48.           self.contents.blt(x,51,bitmap,Rect.new(0,0,30,30))
  49.           self.contents.draw_text(x, 59, 128, 32, "")#"MP:#{skill.sp_cost}")
  50.           #
  51.         end
  52.           u2 += 1
  53.         end
  54.     end
  55.     for i in 0...@item_max
  56.       draw_item(i)
  57.     end
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 描绘项目
  61.   #     index : 项目编号
  62.   #--------------------------------------------------------------------------
  63.   def draw_item(index)
  64.     x = 315 + index * (180)/6
  65.     self.contents.font.size = 16
  66.     self.contents.font.color = Color.new(20,20,20)
  67.     self.contents.draw_text(x+1, 1, 128, 28, " ")
  68.     self.contents.font.color = Color.new(135,175,255)
  69.     self.contents.draw_text(x, 0, 128, 28, " ")
  70.     x2 = 315 + -1 * (180)/6
  71.     self.contents.font.size = 14
  72.     self.contents.font.color = Color.new(20,20,20)
  73.     self.contents.draw_text(x2+1, 31, 258, 32, " ")
  74.    # self.contents.draw_text(x2+1, 31, 128, 32, @commands[index])
  75.     self.contents.font.color = Color.new(135,175,255)
  76.     self.contents.draw_text(x2, 30, 258, 32, "  ")
  77.    # self.contents.draw_text(x2, 30, 128, 32, @commands[index])
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● 更新光标举行
  81.   #--------------------------------------------------------------------------
  82.   def update_cursor_rect
  83.     # 光标位置不满 0 的情况下
  84.     if @index < 0
  85.       self.cursor_rect.empty
  86.       return
  87.     end
  88.     # 获取当前的行
  89.     row = @index / @column_max
  90.     # 当前行被显示开头行前面的情况下
  91.     if row < self.top_row
  92.       # 从当前行向开头行滚动
  93.       self.top_row = row
  94.     end
  95.     # 当前行被显示末尾行之后的情况下
  96.     if row > self.top_row + (self.page_row_max - 1)
  97.       # 从当前行向末尾滚动
  98.       self.top_row = row - (self.page_row_max - 1)
  99.     end
  100.     # 计算光标的宽
  101.     cursor_width = self.width / @column_max - 30
  102.     # 计算光标坐标
  103.     x = @index % @column_max * (180)/6
  104.     y = @index / @column_max * 32 - self.oy
  105.     # 更新国标矩形
  106.     self.cursor_rect.set(305+x, y+8, 30, 40)
  107.   end
  108. end
  109. #==============================================================================
  110. # ■ Scene_Key
  111. #------------------------------------------------------------------------------
  112. #  处理中快捷键的类。
  113. #==============================================================================

  114. class Scene_Key < Scene_Base
  115.   #--------------------------------------------------------------------------
  116.   # ● 初始化对像
  117.   #     actor_index : 角色索引
  118.   #--------------------------------------------------------------------------
  119.   def initialize(actor_index = 0)
  120.     @actor_index = actor_index
  121.     super()
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 主处理
  125.   #--------------------------------------------------------------------------
  126.   def main_start
  127.     super
  128.     @actor = $game_party.actors[@actor_index]
  129.     # 生成帮助窗口、状态窗口、特技窗口
  130.     @help_window = Window_Help.new
  131.     @skill_window = Window_Skill.new(@actor)
  132.     @skill_window.z -= 98
  133.     @skill_window.height = 37*9
  134.     @skill_window.back_opacity = 160
  135.     @help_window.back_opacity = 160
  136.     @key_window = Window_KeyCommand.new
  137.     @key_window.refresh(@actor)
  138.     # 关联帮助窗口
  139.     @skill_window.help_window = @help_window
  140.     @windows.push(@help_window)
  141.     @windows.push(@skill_window)
  142.     @windows.push(@key_window)
  143.   end
  144.   def make_sprite
  145.     @spriteset = Spriteset_Map.new
  146.     @arpg_actor = ARPG_Actor.new
  147.   end
  148.   def dispose_sprite
  149.     @spriteset.dispose
  150.     @arpg_actor.dispose
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 刷新画面
  154.   #--------------------------------------------------------------------------
  155.   def update
  156.     # 刷新命令窗口
  157.     @arpg_actor.update
  158.     if @skill_window.active
  159.       update_skill
  160.       return
  161.     end
  162.     if @key_window.active
  163.       update_key
  164.       return
  165.     end
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 刷新技能窗口
  169.   #--------------------------------------------------------------------------
  170.   def update_skill
  171.     @skill_window.update
  172.     # 按下 B 键的情况下
  173.     if Input.trigger?(Input::B)
  174.       # 演奏取消 SE
  175.       @skill_window.pclear
  176.       $game_system.se_play($data_system.cancel_se)
  177.       # 切换到菜单画面
  178.       $scene = Scene_Map.new
  179.       return
  180.     end
  181.     # 按下 C 键的场合下
  182.     if Input.trigger?(Input::C)
  183.       M.ok
  184.       @skill_window.active = false
  185.       @key_window.active = true
  186.       @key_window.index = 0
  187.     end
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 刷新选择键位
  191.   #--------------------------------------------------------------------------
  192.   def update_key
  193.     @key_window.update
  194.     if Input.trigger?(Input::C)
  195.       skill = @skill_window.skill
  196.       case @key_window.index
  197.       when 6
  198.         key_start("A",skill)
  199.       when 7
  200.         key_start("S",skill)
  201.       when 8
  202.         key_start("D",skill)
  203.       when 9
  204.         key_start("F",skill)
  205.       when 10
  206.         key_start("G",skill)
  207.       when 11
  208.         key_start("H",skill)        
  209.       when 0
  210.         key_start("F1",skill)
  211.       when 1
  212.         key_start("F2",skill)
  213.       when 2
  214.         key_start("F3",skill)
  215.       when 3
  216.         key_start("F4",skill)
  217.       when 4
  218.         key_start("F5",skill)
  219.       when 5
  220.         key_start("F6",skill)         
  221.     end
  222.   end
  223.     if Input.trigger?(Input::B)
  224.       # 演奏取消 SE
  225.       $game_system.se_play($data_system.cancel_se)
  226.       @skill_window.active = true
  227.       @key_window.active = false
  228.       @key_window.index = -1
  229.       return
  230.     end
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # ● 设置键位
  234.   #--------------------------------------------------------------------------
  235.   def key_start(key,skill)
  236.     if skill.nil?
  237.       @actor.key[key] = 0
  238.     else
  239.       @actor.key[key] = skill.id
  240.     end
  241.     @skill_window.active = true
  242.     @key_window.active = false
  243.     @key_window.index = -1
  244.     @key_window.refresh(@actor)
  245.     M.eq
  246.     return
  247.   end
  248. end
复制代码
物品快捷键脚本:
  1. #==============================================================================
  2. # ■ Window_Item_KeyCommand
  3. #------------------------------------------------------------------------------
  4. #  选择快捷键的窗口
  5. #==============================================================================
  6. class Window_Item_KeyCommand < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(284, 37, 640, 480)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     self.opacity = 0
  14.     @item_max = 3
  15.     @column_max = 3
  16.     @commands = ["1", "2", "3"]
  17.     refresh
  18.     self.index = -1
  19.     self.active = false
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 刷新
  23.   #--------------------------------------------------------------------------
  24.   def refresh(actor=nil)
  25.     self.contents.clear
  26.     if actor != nil
  27.       u = 0
  28.       for key in ["1","2","3"]
  29.         item = $data_items[actor.item_key[key]]
  30.         if !item.nil?
  31.           if $game_party.item_number(item.id) == 0
  32.             actor.item_key[key] = 0
  33.             refresh(actor)
  34.             return
  35.           end
  36.           bitmap = RPG::Cache.icon(item.icon_name)
  37.           x = 0
  38.           self.contents.font.size = 12
  39.           self.contents.font.color = Color.new(255,255,255,255)
  40.           self.contents.blt(x,16,bitmap,Rect.new(0,0,30,30))
  41.           self.contents.draw_text(x,26, 128, 32,"")
  42.           self.contents.draw_text(x+10,24, 128, 40,"")
  43.         end
  44.           u += 1
  45.       end
  46.     end
  47.     for i in 0...@item_max
  48.       draw_item(i)
  49.     end
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 描绘项目
  53.   #     index : 项目编号
  54.   #--------------------------------------------------------------------------
  55.   def draw_item(index)
  56.     x = 104 + index * (120)/3
  57.     self.contents.font.size = 16
  58.     self.contents.font.color = Color.new(20,20,20)
  59.     self.contents.draw_text(x+1, 1, 128, 32, "")
  60.     self.contents.font.color = Color.new(135,175,255)
  61.     self.contents.draw_text(x, 0, 128, 32, "")
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 更新光标举行
  65.   #--------------------------------------------------------------------------
  66.   def update_cursor_rect
  67.     # 光标位置不满 0 的情况下
  68.     if @index < 0
  69.       self.cursor_rect.empty
  70.       return
  71.     end
  72.     # 获取当前的行
  73.     row = @index / @column_max
  74.     # 当前行被显示开头行前面的情况下
  75.     if row < self.top_row
  76.       # 从当前行向开头行滚动
  77.       self.top_row = row
  78.     end
  79.     # 当前行被显示末尾行之后的情况下
  80.     if row > self.top_row + (self.page_row_max - 1)
  81.       # 从当前行向末尾滚动
  82.       self.top_row = row - (self.page_row_max - 1)
  83.     end
  84.     # 计算光标的宽
  85.     cursor_width = 0
  86.     # 计算光标坐标
  87.     x = @index % @column_max * (120)/3
  88.     y = @index / @column_max * 32 - self.oy
  89.     # 更新国标矩形
  90.     self.cursor_rect.set(x, y, 30, 30)
  91.   end
  92. end
  93. #==============================================================================
  94. # ■ Scene_Key
  95. #------------------------------------------------------------------------------
  96. #  处理中快捷键的类。
  97. #==============================================================================

  98. class Scene_Item_Key < Scene_Base
  99.   #--------------------------------------------------------------------------
  100.   # ● 初始化对像
  101.   #     actor_index : 角色索引
  102.   #--------------------------------------------------------------------------
  103.   def initialize(actor_index = 0)
  104.     @actor_index = actor_index
  105.     super()
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● 主处理
  109.   #--------------------------------------------------------------------------
  110.   def main_start
  111.     super
  112.     # 获取角色
  113.     @actor = $game_party.actors[@actor_index]
  114.     # 生成帮助窗口、状态窗口、特技窗口
  115.     @help_window = Window_Help.new
  116.     @item_window = Window_Item.new#(@actor)
  117.     @item_window.z -= 98
  118.     @item_window.height = 256
  119.     @item_window.back_opacity = 0
  120.     @help_window.back_opacity = 160
  121.     @key_window = Window_Item_KeyCommand.new
  122.     @key_window.refresh(@actor)
  123.     # 关联帮助窗口
  124.     @item_window.help_window = @help_window
  125.    
  126.    
  127.     @windows.push(@help_window)
  128.     @windows.push(@item_window)
  129.     @windows.push(@key_window)
  130.   end
  131.   def make_sprite
  132.     @spriteset = Spriteset_Map.new
  133.     @arpg_actor = ARPG_Actor.new
  134.   end
  135.   def dispose_sprite
  136.     @spriteset.dispose
  137.     @arpg_actor.dispose
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 刷新画面
  141.   #--------------------------------------------------------------------------
  142.   def update
  143.     # 刷新命令窗口
  144.     @arpg_actor.update
  145.     if @item_window.active
  146.       update_item
  147.       return
  148.     end
  149.     if @key_window.active
  150.       update_key
  151.       return
  152.     end
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● 刷新技能窗口
  156.   #--------------------------------------------------------------------------
  157.   def update_item
  158.     @item_window.update
  159.     # 按下 B 键的情况下
  160.     if Input.trigger?(Input::B)
  161.       # 演奏取消 SE
  162.       $game_system.se_play($data_system.cancel_se)
  163.       # 切换到菜单画面
  164.       $scene = Scene_Map.new
  165.       return
  166.     end
  167.     # 按下 C 键的场合下
  168.     if Input.trigger?(Input::C)
  169.       item = @item_window.item
  170.       return if !$game_party.item_can_use?(item.id)
  171.       M.ok
  172.       @item_window.active = false
  173.       @key_window.active = true
  174.       @key_window.index = 0
  175.     end
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 刷新选择键位
  179.   #--------------------------------------------------------------------------
  180.   def update_key
  181.     @key_window.update
  182.     if Input.trigger?(Input::C)
  183.       item = @item_window.item
  184.       case @key_window.index
  185.       when 0
  186.         key_start("1",item)
  187.       when 1
  188.         key_start("2",item)
  189.       when 2
  190.         key_start("3",item)
  191.       end
  192.     end
  193.     if Input.trigger?(Input::B)
  194.       # 演奏取消 SE
  195.       $game_system.se_play($data_system.cancel_se)
  196.       @item_window.active = true
  197.       @key_window.active = false
  198.       @key_window.index = -1
  199.       return
  200.     end
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 设置键位
  204.   #--------------------------------------------------------------------------
  205.   def key_start(key,item)
  206.     if item.nil?
  207.       @actor.item_key[key] = 0
  208.     else
  209.       @actor.item_key[key] = item.id
  210.     end
  211.     @item_window.active = true
  212.     @key_window.active = false
  213.     @key_window.index = -1
  214.     @key_window.refresh(@actor)
  215.     M.eq
  216.     return
  217.   end
  218. end
复制代码
技能第一格 x:104 y:22
物品第一格 x:284 y:37
上联:金龙腾飞横扫东洋鬼魅
下联:银蛇劲舞彰显中华国威
横批:春泽钓岛

Lv1.梦旅人

萝莉控

梦石
0
星屑
160
在线时间
226 小时
注册时间
2011-8-19
帖子
924
2
发表于 2012-1-25 18:15:22 | 只看该作者
我不明白。说起来你邀请我干什么=_=
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-2-20 17:11

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表