Project1
标题:
待机脚本添加空选项
[打印本页]
作者:
凉凉の雨
时间:
2009-4-4 09:48
提示:
作者被禁止或删除 内容自动屏蔽
作者:
紫苏
时间:
2009-4-4 20:41
的确挺麻烦,主要是因为这个脚本把待机的队员直接放到 $game_party.actors 中,在战斗之前从这个数组中删除不出场的队员,战斗结束添加回来……这可能是为了方便菜单状态窗口、存/读档窗口中显示整个队员数组以及队员数组元素的交换
如果想要将前线队员撤下而不是与候补交换,则必须考虑到逐个描绘 actor 信息的地方~因为撤下而不交换队员就会在 $game_party.actors 中产生一些空元素 nil,自然就不能描绘了
可以试试看下面这个,主要修改了 Window_MenuStatus 的队员交换,Window_Base 的 actor 信息描绘,Window_SaveFile 的行走图描绘和 Scene_Save 中保存 nil 元素:
#==============================================================================
# 本?本?自www.66RPG.com,使用和???保留此信息
#==============================================================================
# ▼▲▼ XRXS26. 人物扩张系统 ver..05 ▼▲▼
# by 桜雅 在土
#==============================================================================
# □ 初始化定义
#==============================================================================
module XRXS26
FRONT_MEMBER_LIMIT = 4 # 战斗参战人数最大值
BACKWARD_MEMBER_LIMIT = 6 # 待机人数最大值
BACKWARD_EXP_GAINABLE = true # 待机人物是否获得经验
MENU_STATUS_STRETCH = false # 3人以下的时候,菜单是否拉伸大小
end
#------------------------------------------------------------------------------
# 菜单页面状态
#------------------------------------------------------------------------------
class Window_MenuStatus < Window_Selectable
# 列数
COLUMN_MAX = 1
# 光标高度
CURSOR_HEIGHT = 96
# 一行的高度
LINE_HEIGHT = 116
end
#------------------------------------------------------------------------------
# 菜??景
#------------------------------------------------------------------------------
class Scene_Menu
MENU_MEMBER_CHANGE_KEY_GO = Input::RIGHT # 进入键
MENU_MEMBER_CHANGE_KEY_END = Input::LEFT # 离开键
MENU_MEMBER_CHANGE_INDEX_MIN = 0 # 可更换角色最小编号
FORCETOBATTLE_ACTORS = [] # 不能待机的角色编号
UMBATTLABLE_ACTORS = [] # 不能加入战斗的角色编号
UNMOVABLE_ACTORS = [] # 不能移动的角色编号
end
#------------------------------------------------------------------------------
#
# 解説
# Game_Partyの @actors のうち先頭から↑FRONT_MEMBER_LIMIT番目までのアクターを
# 戦闘メンバーとして、それ以上を待機メンバーとして扱います。
#
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ○ インクルード
#--------------------------------------------------------------------------
include XRXS26
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :backword_actors # 待機アクター
attr_accessor :front_size
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias xrxs26_initialize initialize
def initialize
xrxs26_initialize
# 待機メンバー配列を初期化
@backword_actors = []
@front_size = 0
end
#--------------------------------------------------------------------------
# ● アクターを加える
#--------------------------------------------------------------------------
def add_actor(actor_id)
# アクターを取得
actor = $game_actors[actor_id]
# このアクターがパーティにいない場合
if not @actors.include?(actor)
# 満員でないならメンバーに追加
if @actors.size < (FRONT_MEMBER_LIMIT + BACKWARD_MEMBER_LIMIT)
if @front_size < FRONT_MEMBER_LIMIT
@front_size += 1
end
# # アクターを追加
@actors.push(actor)
# プレイヤーをリフレッシュ
$game_player.refresh
end
end
end
def refresh
new_actors = []
for i in
[email protected]
if $data_actors[@actors[i].id] != nil
new_actors.push(@actors[i] == nil ? nil : $game_actors[@actors[i].id])
end
end
@actors = new_actors
end
def check_map_slip_damage
for actor in @actors
next if actor == nil
if actor.hp > 0 and actor.slip_damage?
actor.hp -= [actor.maxhp / 100, 1].max
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
$game_temp.gameover = $game_party.all_dead?
end
end
end
end
class Window_Base
def draw_actor_name(actor, x, y)
return if actor == nil
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
def draw_actor_class(actor, x, y)
return if actor == nil
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 236, 32, actor.class_name)
end
alias xrxs26_draw_actor_level draw_actor_level
def draw_actor_level(actor, x, y)
return if actor == nil
xrxs26_draw_actor_level(actor, x, y)
end
alias xrxs26_make_battler_state_text make_battler_state_text
def make_battler_state_text(battler, width, need_normal)
return if battler == nil
xrxs26_make_battler_state_text(battler, width, need_normal)
end
def draw_actor_state(actor, x, y, width = 120)
return if actor == nil
text = make_battler_state_text(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text)
end
alias xrxs26_draw_actor_hp draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
return if actor == nil
xrxs26_draw_actor_hp(actor, x, y, width = 144)
end
alias xrxs26_draw_actor_sp draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
return if actor == nil
xrxs26_draw_actor_sp(actor, x, y, width = 144)
end
end
class Scene_Save
def write_save_data(file)
characters = []
for i in 0...$game_party.actors.size
if $game_party.actors[i] == nil
characters.push(nil)
else
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
end
# 寫入描繪遊戲存檔用的角色資料
Marshal.dump(characters, file)
# 寫入測量遊戲時間用的畫面計數
Marshal.dump(Graphics.frame_count, file)
# 增加 1 次存檔次數
$game_system.save_count += 1
# 儲存魔法編號
# (將編輯器儲存的值以隨機值取代)
$game_system.magic_number = $data_system.magic_number
# 寫入各種遊戲物件
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end
class Window_SaveFile
def refresh
self.contents.clear
# 描繪檔案編號
self.contents.font.color = normal_color
name = "檔案 #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
# 遊戲存檔存在的情況下
if @file_exist
# 描繪角色
for i in
[email protected]
next if @characters[i] == nil
bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
#x = 300 - @characters.size * 32 + i * 64 - cw / 2
x = i * 64
#p @characters[i], x
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
# 描繪遊戲時間
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
# 描繪時間字串
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
end
#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● インクルード
#--------------------------------------------------------------------------
include XRXS26
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias xrxs26_initialize initialize
def initialize
xrxs26_initialize
#
# 以下、五人目以降のアクタースプライトの追加処理---
#
# アクターが表示されるビューポートを、とりあえず先頭の人から取得しとく(素
actor_viewport = @actor_sprites[0].viewport
# 戦闘参加メンバーが5人以上の場合
if FRONT_MEMBER_LIMIT > 4
for i in 5..FRONT_MEMBER_LIMIT
# アクタースプライトを追加
@actor_sprites.push(Sprite_Battler.new(actor_viewport))
@actor_sprites[i-1].battler = $game_party.actors[i-1]
end
end
# ビューポートを更新
actor_viewport.update
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● インクルード
#--------------------------------------------------------------------------
include XRXS26
#--------------------------------------------------------------------------
# ● メイン処理 をパーティメンバー処理ではさむ
#--------------------------------------------------------------------------
alias xrxs26_main main
def main
# 待機メンバーへ退避----------
$game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
$game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
$game_party.actors.compact!
# メイン処理
xrxs26_main
# 待機メンバーから復帰
$game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
$game_party.backword_actors.clear
end
#--------------------------------------------------------------------------
# ● アフターバトルフェーズ開始
#--------------------------------------------------------------------------
alias xrxs26_start_phase5 start_phase5
def start_phase5
# 「待機メンバー経験値獲得」が有効 and 待機アクターが一人以上いる
if BACKWARD_EXP_GAINABLE and $game_party.backword_actors.size >= 1
# 待機メンバーから復帰
$game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
$game_party.backword_actors.clear
# 呼び戻す
xrxs26_start_phase5
# 待機メンバーへ退避----------
$game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
$game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
$game_party.actors.compact!
else
# 呼び戻す
xrxs26_start_phase5
end
end
end
# ▽△▽ XRXL 4. 第二カーソル 機構 ▽△▽
# by 桜雅 在土
#==============================================================================
# --- XRXS. 第二カーソル 機構 ---
#------------------------------------------------------------------------------
# ウィンドウに .index2 プロパティを追加します。
#==============================================================================
module XRXS_Cursor2
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, w, h)
super(x, y, h, w)
# 補助ウィンドウ(透明)を作成:カーソル専用
@xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
@xrxsc2_window.opacity = 0
@xrxsc2_window.active = false
@xrxsc2_window.index = -1
end
#--------------------------------------------------------------------------
# ○ 第二カーソルの設置
#--------------------------------------------------------------------------
def index2
return @xrxsc2_window.index
end
def index2=(index)
@xrxsc2_window.index = index
if index == -1
@xrxsc2_window.cursor_rect.empty
else
@xrxsc2_window.x = self.x
@xrxsc2_window.y = self.y
@xrxsc2_window.cursor_rect = self.cursor_rect
end
end
#--------------------------------------------------------------------------
# ○ 先頭の行の設定
#--------------------------------------------------------------------------
def top_row=(row)
super
# 補助ウィンドウの oy を更新
pre_oy = @xrxsc2_window.oy
@xrxsc2_window.oy = self.oy
@xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
end
#--------------------------------------------------------------------------
# ○ 解放
#--------------------------------------------------------------------------
def dispose
@xrxsc2_window.dispose
super
end
#--------------------------------------------------------------------------
# ○ X, Y 座標
#--------------------------------------------------------------------------
def x=(n)
super
@xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
end
def y=(n)
super
@xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
end
end
# ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
# by 桜雅 在土
#==============================================================================
# ■ Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ○ インクルード
#--------------------------------------------------------------------------
include XRXS26
include XRXS_Cursor2
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :column_max # 列数
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
h = 480
if MENU_STATUS_STRETCH
h = FRONT_MEMBER_LIMIT * 116 + 16
end
super(0, 0, 480, h)
h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
self.contents = Bitmap.new(width - 32, h)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ○ 1 ページに表示できる行数の取得
#--------------------------------------------------------------------------
def page_row_max
if MENU_STATUS_STRETCH
return FRONT_MEMBER_LIMIT # 戦闘パーティ最大数
else
return [FRONT_MEMBER_LIMIT, 4].max # 戦闘パーティ最大数(最低4)
end
end
#--------------------------------------------------------------------------
# ○ 先頭の行の取得
#--------------------------------------------------------------------------
def top_row
# ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
return self.oy / LINE_HEIGHT
end
#--------------------------------------------------------------------------
# ○ 先頭の行の設定
#--------------------------------------------------------------------------
def top_row=(row)
super
self.oy = self.oy/32 * LINE_HEIGHT
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
super
unless @index < 0
y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
end
end
end
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ○ インクルード
#--------------------------------------------------------------------------
include XRXS26
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias xrxs26ax_update update
def update
# インデックスを保存
@status_index = @status_window.index
# 呼び戻す
xrxs26ax_update
end
#--------------------------------------------------------------------------
# ● フレーム更新 (コマンドウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
alias xrxs26ax_update_command update_command
def update_command
# 呼び戻す
xrxs26ax_update_command
# 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
@command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# カーソル位置を記憶
@command_index_before_menu_member_change = @command_window.index
# 入れ替えウィンドウへ移行
@command_window.active = false
@command_window.index = -1
@status_window.active = true
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (ステータスウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
alias xrxs26ax_update_status update_status
def update_status
# 呼び戻す
if @command_window.index != -1
xrxs26ax_update_status
return
end
# B ボタンか入れ替え終了キーが押されたとき
if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
@status_window.index2 == -1 and
@status_index%@status_window.column_max == 0)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# コマンドウィンドウをアクティブにする
@command_window.active = true
@command_window.index = 0
@status_window.active = false
@status_window.index = -1
return
end
# B ボタンが押されたとき
if Input.trigger?(Input::B) and @status_window.index2 >= 0
@status_window.index = @status_window.index2
@status_window.index2 = -1
return
end
# 決定キーが押されたとき
if Input.trigger?(Input::C)
if @status_window.index2 == -1
if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# メンバーの入れ替え一人目の決定
@status_window.index2 = @status_window.index
else
if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
if (@status_window.index < FRONT_MEMBER_LIMIT or
@status_window.index2 < FRONT_MEMBER_LIMIT) and
(UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
if (@status_window.index >= FRONT_MEMBER_LIMIT or
@status_window.index2 >= FRONT_MEMBER_LIMIT) and
(FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# メンバーの入れ替え二人目の決定と入れ替えの実行
actor2 = $game_party.actors[@status_window.index]
actor = $game_party.actors[@status_window.index2]
$game_party.actors[@status_window.index2] = actor2
$game_party.actors[@status_window.index] = actor
##########################################################
if @status_window.index >= FRONT_MEMBER_LIMIT or
@status_window.index2 >= FRONT_MEMBER_LIMIT
$game_party.front_size -= 1
end
bA = $game_party.actors[@status_window.index] == nil
bB = $game_party.actors[@status_window.index2] == nil
if (bA ^ bB) and (@status_window.index < FRONT_MEMBER_LIMIT or
@status_window.index2 < FRONT_MEMBER_LIMIT)
for i in 0...4
if $game_party.actors[i] == nil
for j in i + 1...4
if $game_party.actors[j] != nil
$game_party.actors[i] = $game_party.actors[j]
$game_party.actors[j] = nil
break
end
end
end
end
end
##########################################################
@status_window.index = @status_window.index2
@status_window.index2 = -1
# プレイヤーをリフレッシュ
$game_player.refresh
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
return
end
end
end
#============================================================================================
# 本脚本来自www.66RPG.com,转载和使用请保留此信息
#============================================================================================
# ▼▲▼ 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 = 10#$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, 175, 92, 28, "待機人物:")
for i in 0...$game_party.actors.size
####################################
next if $game_party.actors[i] == nil
####################################
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
复制代码
2009/04/06 编辑:上面这个脚本存在很多 BUG,更新之后的版本在这里:
http://rpg.blue/viewthread.php?t ... 2D4%2D6+4%3A00%3A32
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1