Project1

标题: 战斗中技能快捷键的修改 [打印本页]

作者: 火ZHI意志    时间: 2010-10-1 09:42
标题: 战斗中技能快捷键的修改
本帖最后由 火ZHI意志 于 2010-10-1 09:45 编辑

战斗中技能快捷键脚本下载地址
http://rpg.blue/forum.php?mod=vi ... B%E6%8D%B7%E9%94%AE
我的要求就是把横的快捷键选择框改成竖的,在右边,高度要满足480个像素
就是:
                        1 图标
                       技能名称
                        2 图标
                       技能名称
以下类推……

能容纳几个快捷键就容纳几个,技能名称的字大小不能低于13
注意高度一定要充满480个像素,什么遮挡住角色状态的问题以及其他问题我自会处理…………
作者: Cola酱    时间: 2010-10-1 09:42
本帖最后由 Cola酱 于 2010-10-1 10:59 编辑

呼 改好了
效果图:


话说那个13个字符的限制很BT啊
这样只能放下5个了
==========================分    割    线=========================
脚本Scene_Battle 3###(就是他改的那个)
82行:@kjj = Window_Skill_s.new(@active_battler) 改为@kjj = Window_Skill_s.new(@active_battler)
下面这个替换原来的Window_Skill_s
  1.   class Window_Skill_s < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #--------------------------------------------------------------------------
  5.   def initialize(actor)
  6.     @actor = actor
  7.     super(0, 480-96, 640, 96)
  8.     #super(480, 0, 160, 480)
  9.     self.contents = Bitmap.new(width - 32, height - 32)
  10.     @item_max = 5
  11.     @column_max = 5
  12.     @commands = ["1","2","3","4","5"]
  13.     refresh
  14.     self.index = 0
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 刷新
  18.   #--------------------------------------------------------------------------
  19.   def refresh
  20.     self.contents.clear
  21.     for i in 0...@item_max
  22.       draw_item(i)
  23.     end
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 描绘项目
  27.   #     index : 项目编号
  28.   #--------------------------------------------------------------------------
  29.   def draw_item(index)
  30.     x = index*60*2+30#4 + index * 160
  31.     self.contents.font.size = 18
  32.     self.contents.draw_text(x-25, 0, 32, 32, @commands[index])
  33.     if @actor.skill_s[index] != ""
  34.       
  35.     bitmap = RPG::Cache.icon($data_skills[@actor.skill_s[index]].icon_name)
  36.     opacity = self.contents.font.color == normal_color ? 255 : 128
  37.     self.contents.blt(x-10, 8, bitmap, Rect.new(0, 0, 24, 24), opacity)  
  38.       
  39.     self.contents.draw_text(x-48, 32, 160, 32, $data_skills[@actor.skill_s[index]].name,1)
  40.     end
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● 刷新光标矩形
  44.   #--------------------------------------------------------------------------
  45.   def update_cursor_rect
  46.     if @index < 0
  47.       self.cursor_rect.empty
  48.     else
  49.       if $game_temp.in_battle
  50.       self.cursor_rect.empty
  51.       else
  52.       self.cursor_rect.set(@index*120, 0, 64+48+12, 64)
  53.       end
  54.     end
  55.   end
  56. end

复制代码
再把这个插入到MAIN前
  1.   class Window_Skill_sr < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #--------------------------------------------------------------------------
  5.   def initialize(actor)
  6.     @actor = actor
  7.     #super(0, 480-96, 640, 96)
  8.     super(480, 0, 160, 320)
  9.     self.contents = Bitmap.new(width - 32, height - 32)
  10.     @item_max = 5
  11.     @column_max = 1
  12.     @commands = ["1","2","3","4","5"]
  13.     refresh
  14.     self.index = 0
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 刷新
  18.   #--------------------------------------------------------------------------
  19.   def refresh
  20.     self.contents.clear
  21.     for i in 0...@item_max
  22.       draw_item(i)
  23.     end
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 描绘项目
  27.   #     index : 项目编号
  28.   #--------------------------------------------------------------------------
  29.   def draw_item(index)
  30.     x = 32
  31.     y = index*60
  32.     self.contents.font.size = 18
  33.     self.contents.draw_text(x-25, y, 32, 32, @commands[index])
  34.     if @actor.skill_s[index] != ""
  35.       
  36.       bitmap = RPG::Cache.icon($data_skills[@actor.skill_s[index]].icon_name)
  37.       opacity = self.contents.font.color == normal_color ? 255 : 128
  38.       self.contents.blt(x-12, 8+y, bitmap, Rect.new(0, 0, 24, 24), opacity)  
  39.       
  40.     self.contents.draw_text(x-48 , y+32, 160, 32, $data_skills[@actor.skill_s[index]].name,1)
  41.     end
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● 刷新光标矩形
  45.   #--------------------------------------------------------------------------
  46.   def update_cursor_rect
  47.     if @index < 0
  48.       self.cursor_rect.empty
  49.     else
  50.       if $game_temp.in_battle
  51.       self.cursor_rect.empty
  52.       else
  53.       self.cursor_rect.set(@index*60, 0, 64, 64)
  54.       end
  55.     end
  56.   end
  57. end

复制代码
MS就可以了

这个是工程 快捷键gx.rar (187.21 KB, 下载次数: 129)

不过高度不是480
因为这样会有一大块空白
等会再改一下吧
作者: 火ZHI意志    时间: 2010-10-1 11:57
话说高度为480的能给我吗
有一大片空白的问题我自己会解决的
作者: Cola酱    时间: 2010-10-2 18:55
回复 火ZHI意志 的帖子
不好意思
本来说昨天晚上的
但是今天才有空
脚本我就不发了
直接是工程
改了那个s和sr
我不会滚动选择
所以就很猥琐地减小了字体
快捷键gx.rar (191.21 KB, 下载次数: 92)
作者: 火ZHI意志    时间: 2010-10-2 19:10
其实我也不会…………非常感谢~~~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1