查看: 3785|回复: 2

[已经解决] 求教一下战斗指令窗口的位置问题

[复制链接]
梦石
0
星屑
809
在线时间
176 小时
注册时间
2017-1-15
回帖
50
发表于 2019-12-18 09:07:41 | 显示全部楼层 |阅读模式
悬赏100星屑已解决
本帖最后由 foot1982 于 2019-12-18 09:15 编辑

我想要把战斗指令窗口给挪到行动角色的头顶上

在Scene_Battle里面 备注掉了
#    @actor_command_window.viewport = @info_viewport
和
#    @actor_command_window.x = Graphics.width

结果变成如图
指令窗口的位置是改了,但是接下来就不知道怎么做了,坐标是可以调整,但是不知道怎么根据行动人物的不同放在相应的人物头像顶上
另外,还想要的一个效果是选择了战斗指令,出现后来这个技能窗口,物品窗口,目标选择窗口之类的时候,把这个战斗指令窗口给隐藏掉
特来求教要怎么做才好。

111111.png

最佳答案

查看完整内容

@foot1982 [pre lang="ruby"]#============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  战斗画面 #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- ...
梦石
10
星屑
39550
在线时间
1919 小时
注册时间
2010-11-14
回帖
3214

R考场第七期纪念奖

发表于 2019-12-18 09:07:42 | 显示全部楼层
本帖最后由 KB.Driver 于 2019-12-18 22:00 编辑

  
  1. #==============================================================================
  2. # ■ Window_ActorCommand
  3. #------------------------------------------------------------------------------
  4. #  战斗画面中,选择角色行动的窗口。
  5. #==============================================================================

  6. class Window_ActorCommand
  7.   #--------------------------------------------------------------------------
  8.   # ● 设置
  9.   #--------------------------------------------------------------------------
  10.   alias setup_for_position_fixing setup
  11.   def setup(actor)
  12.     setup_for_position_fixing(actor)
  13.     index = $game_party.members.index(actor)
  14.     status_window = SceneManager.scene.instance_variable_get(:@status_window)
  15.     self.x = index * status_window.width / $game_party.max_battle_members
  16.     self.y = Graphics.height - status_window.height - self.height
  17.   end
  18. end
复制代码




@foot1982

  1. #==============================================================================
  2. # ■ Scene_Battle
  3. #------------------------------------------------------------------------------
  4. #  战斗画面
  5. #==============================================================================

  6. class Scene_Battle
  7.   #--------------------------------------------------------------------------
  8.   # ● 指令“攻击”
  9.   #--------------------------------------------------------------------------
  10.   alias command_attack_for_hiding_actor_command_window command_attack
  11.   def command_attack
  12.     command_attack_for_hiding_actor_command_window
  13.     @actor_command_window.hide
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 指令“技能”
  17.   #--------------------------------------------------------------------------
  18.   alias command_skill_for_hiding_actor_command_window command_skill
  19.   def command_skill
  20.     command_skill_for_hiding_actor_command_window
  21.     @actor_command_window.hide
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 指令“物品”
  25.   #--------------------------------------------------------------------------
  26.   alias command_item_for_hiding_actor_command_window command_item
  27.   def command_item
  28.     command_item_for_hiding_actor_command_window
  29.     @actor_command_window.hide
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 敌人“取消”
  33.   #--------------------------------------------------------------------------
  34.   alias on_enemy_cancel_for_showing_actor_command_window on_enemy_cancel
  35.   def on_enemy_cancel
  36.     on_enemy_cancel_for_showing_actor_command_window
  37.     if (w = @actor_command_window).current_symbol == :attack then w.show end
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 技能“取消”
  41.   #--------------------------------------------------------------------------
  42.   alias on_skill_cancel_for_showing_actor_command_window on_skill_cancel
  43.   def on_skill_cancel
  44.     on_skill_cancel_for_showing_actor_command_window
  45.     @actor_command_window.show
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ● 物品“取消”
  49.   #--------------------------------------------------------------------------
  50.   alias on_item_cancel_for_showing_actor_command_window on_item_cancel
  51.   def on_item_cancel
  52.     on_item_cancel_for_showing_actor_command_window
  53.     @actor_command_window.show
  54.   end
  55. end

  56. #==============================================================================
  57. # ■ Window_ActorCommand
  58. #------------------------------------------------------------------------------
  59. #  战斗画面中,选择角色行动的窗口。
  60. #==============================================================================

  61. class Window_ActorCommand
  62.   #--------------------------------------------------------------------------
  63.   # ● 设置
  64.   #--------------------------------------------------------------------------
  65.   alias setup_for_position_fixing setup
  66.   def setup(actor)
  67.     setup_for_position_fixing(actor)
  68.     index = $game_party.members.index(actor)
  69.     status_window = SceneManager.scene.instance_variable_get(:@status_window)
  70.     whole_width = status_window.width
  71.     self.x = index * whole_width / $game_party.max_battle_members
  72.     self.y = Graphics.height - status_window.height - self.height
  73.     self.show
  74.   end
  75. end
复制代码

点评

谢谢大佬,窗口坐标调整到了相对位置了,不过还有一个就是进入目标,技能,物品选择的时候希望能把ActorCommand这个窗口给隐藏掉,要怎么做呢?  发表于 2019-12-18 20:39

评分

参与人数 1赞 +1 收起 理由
foot1982 + 1 认可答案

查看全部评分

用头画头像,用脚写脚本
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部