- 注册时间
- 2008-9-20
- 最后登录
- 2019-5-19
⑤进阶
- 积分
- 777
|
发表于 2009-1-30 14:17:48
|
显示全部楼层
Re:例如要做出队列中有9人,前4人默认参战,后5人替补,
菜单界面脚本全部内容:- # ▼▲▼ XRXS26BX. +BUZZデザイン ▼▲▼ built 033109
- # by 桜雅 在土
- #==============================================================================
- # □ 初始化定义
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #
- # 不显示能力值的角色编号
- #
- NO_PARAMETER_ACTORS = []
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :newitem_window
- attr_reader :bottomkeyhelp_window
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias xrxs26bx_initialize initialize
- def initialize
- # 呼び戻す
- xrxs26bx_initialize
- # 寄生してウィンドウを作成
- # ボトルキーヘルプウィンドウ
- @bottomkeyhelp_window = Window_BottomKeyHelp.new
- @bottomkeyhelp_window.visible = false
- # 設定変更
- self.height = 448
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- @column_max = 2
- y = (FRONT_MEMBER_LIMIT+1)/2 * 64 + 28
- self.contents.font.size = 16
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 92, 28, "战斗人数")
- self.contents.draw_text(4, y, 92, 28, "待机人数")
- for i in 0...$game_party.actors.size
- x = 64 + i%2 * 224
- y = i/2 * 72 + 24
- actor = $game_party.actors[i]
- if i >= FRONT_MEMBER_LIMIT
- y += 32
- self.contents.font.color = disabled_color
- self.contents.draw_text(x, y, 120, 32, actor.name)
- else
- draw_actor_name(actor , x , y )
- end
- draw_actor_graphic(actor, x - 40, y + 64)
- unless NO_PARAMETER_ACTORS.include?(actor.id)
- draw_actor_level(actor , x + 94, y )
- draw_actor_hp(actor , x, y + 16)
- draw_actor_sp(actor , x, y + 32)
- draw_actor_state(actor , x, y + 48)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ フレーム更新
- #--------------------------------------------------------------------------
- def update
- # ウィンドウを更新
- @bottomkeyhelp_window.update
- super
- end
- #--------------------------------------------------------------------------
- # ○ 解放
- #--------------------------------------------------------------------------
- def dispose
- @bottomkeyhelp_window.dispose
- super
- end
- #--------------------------------------------------------------------------
- # ● カーソルの矩形更新
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- y = @index/2 * 72 + 28
- if @index >= FRONT_MEMBER_LIMIT
- y += 32
- end
- self.cursor_rect.set(@index%2 * 224, y, 224, 72)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs26bx_update update
- def update
- # 登録
- if @bottomkeyhelp_window.nil?
- @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
- @bottomkeyhelp_window.visible = true
- set_keyhelp1
- end
- # 呼び戻す
- xrxs26bx_update
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26bx_update_command update_command
- def update_command
- # 呼び戻す
- xrxs26bx_update_command
- # 入れ替え移行キーが押されたとき
- if @command_window.index == -1 and @status_window.active
- set_keyhelp2
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26bx_update_status update_status
- def update_status
- # 保存
- last_index = @status_window.index2
- # 呼び戻す
- xrxs26bx_update_status
- #
- if last_index != @status_window.index2
- # 一人目を選択した場合
- if @status_window.index2 >= 0
- set_keyhelp3
- else
- set_keyhelp2
- end
- end
- # 戻った場合
- unless @status_window.active
- set_keyhelp1
- end
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 1
- #--------------------------------------------------------------------------
- def set_keyhelp1
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("B","关闭本窗口")
- @bottomkeyhelp_window.add("C","确定")
- @bottomkeyhelp_window.add("→","人物顺序调整")
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 2
- #--------------------------------------------------------------------------
- def set_keyhelp2
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("←,B","返回")
- @bottomkeyhelp_window.add("C","第一个人物确定")
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 3
- #--------------------------------------------------------------------------
- def set_keyhelp3
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("B","返回")
- @bottomkeyhelp_window.add("C","第二个人物确定")
- end
- end
-
- #==============================================================================
- # □ Window_BottomKeyHelp
- #------------------------------------------------------------------------------
- # 画面下で操作説明をする透明なウィンドウです。
- #==============================================================================
- class Window_BottomKeyHelp < Window_Base
- #--------------------------------------------------------------------------
- # ○ オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super(0, 432, 640, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- clear
- end
- #--------------------------------------------------------------------------
- # ○ クリア
- #--------------------------------------------------------------------------
- def clear
- self.contents.clear
- @now_x = 608
- end
- #--------------------------------------------------------------------------
- # ○ 追加
- #--------------------------------------------------------------------------
- def add(key, explanation)
- # 計算
- self.contents.font.size = 20
- x = self.contents.text_size(key).width
- self.contents.font.size = 16
- x += self.contents.text_size(explanation).width + 8
- @now_x -= x
- # 描写
- self.contents.font.size = 20
- self.contents.font.color = system_color
- self.contents.draw_text(@now_x, 0, x, 32, key, 0)
- self.contents.font.size = 16
- self.contents.font.color = normal_color
- self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
- # 余白
- @now_x -= 32
- end
- end
复制代码 |
|