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

Project1

 找回密码
 注册会员
搜索
查看: 3490|回复: 7

[已经解决] 战斗轮盘脚本的问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

发表于 2019-12-9 21:02:40 | 显示全部楼层 |阅读模式
50星屑
小弟最近看中了个战斗轮盘的脚本,但是遇到个问题,就是我调整轮盘的坐标,轮盘就会被遮住
我想把轮盘挪到画面的右上角去不被遮住,然后队伍的框不用往左挤过去,求教要怎么改呀


无标题.png


脚本在这里

RUBY 代码复制
  1. =begin ************************************************************************
  2.   ◆ 画像コマンドスクリプト (ベーススクリプト) Ver.1.82
  3.   ---------------------------------------------------------------------------
  4.     画像コマンドのベーススクリプトです。回転アイコンコマンドが使えます。
  5. =end # ************************************************************************
  6.  
  7. #-information------------------------------------------------------------------
  8. $ziifee ||= {}
  9. $ziifee[:SpriteCommand] = true
  10. #------------------------------------------------------------------------------
  11. #-memo-------------------------------------------------------------------------
  12. #  [必要画像] 以下の画像を Graphics/System にインポートしてください。
  13. #    回転コマンド用カーソル画像 ( ファイル名 : RollIconCursor )
  14. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15. #  このスクリプトは可能な限り素材の中で上部に導入してください。
  16. #  回転アイコンコマンド選択を行いたいクラスに以下を記述します。
  17. #    include ZiifSpriteCommand_RollIcon  # 回転アイコンコマンド選択
  18. #------------------------------------------------------------------------------
  19.  
  20. #==============================================================================
  21. # ■ ZiifManager
  22. #==============================================================================
  23.  
  24. module ZiifManager
  25.   #--------------------------------------------------------------------------
  26.   # ▼ 定数 (アイコン番号)
  27.   #-memo---------------------------------------------------------------------
  28.   #  回転コマンド上に表示するアイコンはここで設定します。
  29.   #  以下の定義の symbol がここで設定するシンボルになります。
  30.   #    add_command(name, symbol, enabled, ext) # コマンドの追加
  31.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  32.   #  IconSet[シンボル] = Hash.new(アイコン番号)
  33.   #  IconSet[:skill][スキルタイプ番号] = アイコン番号  # スキルタイプ
  34.   #--------------------------------------------------------------------------
  35.   IconSet ||= Hash.new(Hash.new(16))           # デフォルト
  36.   IconSet[:fight]       = Hash.new(147)        # 戦う   (バトル)
  37.   IconSet[:escape]      = Hash.new(467)        # 逃げる (バトル)
  38.   IconSet[:attack]      = Hash.new(175)        # 攻撃   (バトル)
  39.   IconSet[:guard]       = Hash.new(506)        # 防御   (バトル)
  40.   IconSet[:item]        = Hash.new(260)        # アイテム
  41.   IconSet[:skill]       = Hash.new(112)        # スキル
  42.   IconSet[:skill][1]    = 115                  # スキルタイプ ID:01
  43.   IconSet[:skill][2]    = 117                  # スキルタイプ ID:02
  44.   IconSet[:equip]       = Hash.new(436)        # 装備
  45.   IconSet[:weapon]      = Hash.new(147)        # 武器
  46.   IconSet[:armor]       = Hash.new(506)        # 防具
  47.   IconSet[:key_item]    = Hash.new(243)        # キーアイテム
  48.   IconSet[:optimize]    = Hash.new(437)        # 最強装備
  49.   IconSet[:clear]       = Hash.new(143)        # 外す
  50.   IconSet[:status]      = Hash.new(121)        # ステータス
  51.   IconSet[:formation]   = Hash.new(183)        # 並び替え
  52.   IconSet[:save]        = Hash.new(224)        # セーブ
  53.   IconSet[:buy]         = Hash.new(270)        # 購入
  54.   IconSet[:sell]        = Hash.new(262)        # 売却
  55.   IconSet[:cancel]      = Hash.new(12)         # キャンセル
  56.   IconSet[:new_game]    = Hash.new(234)        # ニューゲーム
  57.   IconSet[:continue]    = Hash.new(224)        # コンティニュー
  58.   IconSet[:game_end]    = Hash.new(257)        # ゲーム終了
  59.   IconSet[:to_title]    = Hash.new(257)        # タイトルへ
  60.   IconSet[:shutdown]    = Hash.new(143)        # シャットダウン
  61.   #--------------------------------------------------------------------------
  62.   # ● コマンドアイコン番号の取得
  63.   #     command : ウィンドウのコマンド
  64.   #--------------------------------------------------------------------------
  65.   def self.command_icon_index(command)
  66.     IconSet[command[:symbol]][command[:ext]]
  67.   end
  68. end
  69.  
  70. #==============================================================================
  71. # ■ Game_System
  72. #==============================================================================
  73.  
  74. class Game_System
  75.   #--------------------------------------------------------------------------
  76.   # ● 公開インスタンス変数 (オプション拡張用)
  77.   #--------------------------------------------------------------------------
  78.   attr_writer   :ziifop_reverse_roll      # 逆回転 ( true / false )
  79.   attr_writer   :ziifop_roll_input_type   # 回転時 キー入力タイプ (0~2)
  80.   attr_writer   :ziifop_roll_speed        # 回転時 速度 (0~4)
  81.   #--------------------------------------------------------------------------
  82.   # ▼ 逆回転の取得
  83.   #--------------------------------------------------------------------------
  84.   def ziifop_reverse_roll
  85.     return false
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ▼ 回転キー入力タイプの取得 (0:プレス, 1:トリガー, 2:リピート)
  89.   #--------------------------------------------------------------------------
  90.   def ziifop_roll_input_type
  91.     return 0
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ▼ 回転速度の取得 (0:遅い ~ 4:速い)
  95.   #--------------------------------------------------------------------------
  96.   def ziifop_roll_speed
  97.     return 1
  98.   end
  99. end
  100.  
  101. #******************************************************************************
  102. # ▼ 画像コマンド基本部
  103. #******************************************************************************
  104.  
  105. #==============================================================================
  106. # ■ Sprite_ZiifCommandSprite
  107. #------------------------------------------------------------------------------
  108. #  コマンド画像・背景・カーソル表示用スプライトのスーパークラスです。
  109. #==============================================================================
  110.  
  111. class Sprite_ZiifCommandSprite < Sprite
  112.   #--------------------------------------------------------------------------
  113.   # ● オブジェクト初期化
  114.   #--------------------------------------------------------------------------
  115.   def initialize(command_set)
  116.     super(command_set.viewport)
  117.     @command_set = command_set
  118.     init_basic_values
  119.     create_bitmap
  120.     update
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 基本変数の初期化
  124.   #--------------------------------------------------------------------------
  125.   def init_basic_values
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● ビットマップの作成
  129.   #--------------------------------------------------------------------------
  130.   def create_bitmap
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 内容の作成
  134.   #--------------------------------------------------------------------------
  135.   def create_contents
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● 内容の削除
  139.   #--------------------------------------------------------------------------
  140.   def clear_contents
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● スプライトコマンドの取得
  144.   #--------------------------------------------------------------------------
  145.   def command_set
  146.     return @command_set
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● 位置の取得
  150.   #--------------------------------------------------------------------------
  151.   def index
  152.     return command_set.sprite_index(self)
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● コマンドのビューポートの取得
  156.   #--------------------------------------------------------------------------
  157.   def command_set_viewport
  158.     return command_set.viewport
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● コマンドの可視状態の取得
  162.   #--------------------------------------------------------------------------
  163.   def command_set_visible
  164.     return command_set.visible && !command_set.close?
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● コマンドの透明度の取得
  168.   #--------------------------------------------------------------------------
  169.   def command_set_opacity
  170.     return command_set.contents_opacity
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● 位置情報の更新
  174.   #--------------------------------------------------------------------------
  175.   def update_position
  176.     self.viewport = command_set_viewport
  177.     self.visible  = command_set_visible
  178.     self.opacity  = command_set_opacity
  179.   end
  180. end
  181.  
  182. #==============================================================================
  183. # ■ ZiifSpriteCommand
  184. #------------------------------------------------------------------------------
  185. #  画像コマンド選択を行うためのモジュールです。Mix-Inにより使用します。
  186. #==============================================================================
  187.  
  188. module ZiifSpriteCommand
  189.   #--------------------------------------------------------------------------
  190.   # ● 公開インスタンス変数
  191.   #--------------------------------------------------------------------------
  192.   attr_reader   :windowskin               # ウィンドウスキン
  193.   attr_reader   :viewport                 # ビューポート
  194.   attr_reader   :active                   # 選択状態
  195.   attr_reader   :visible                  # 可視状態
  196.   attr_reader   :x                        # X座標
  197.   attr_reader   :y                        # Y座標
  198.   attr_reader   :width                    # 幅
  199.   attr_reader   :height                   # 高さ
  200.   attr_reader   :z                        # Z座標
  201.   attr_reader   :ox                       # 転送元原点 X座標
  202.   attr_reader   :oy                       # 転送元原点 Y座標
  203.   attr_reader   :padding                  # 余白の大きさ
  204.   attr_reader   :padding_bottom           # 下線余白の大きさ
  205.   attr_reader   :opacity                  # 不透明度
  206.   attr_reader   :back_opacity             # 背景の不透明度
  207.   attr_reader   :contents_opacity         # コマンドの不透明度
  208.   attr_reader   :openness                 # オープン度
  209.   attr_reader   :tone                     # 背景の色調
  210.   attr_reader   :index                    # カーソル位置
  211.   attr_reader   :help_window              # ヘルプウィンドウ
  212.   attr_accessor :cursor_fix               # カーソル固定フラグ
  213.   attr_accessor :cursor_all               # カーソル全選択フラグ
  214.   #--------------------------------------------------------------------------
  215.   # ● オブジェクト初期化
  216.   #--------------------------------------------------------------------------
  217.   def initialize(*args)
  218.     init_basic_values(*args)
  219.     init_sprite_command
  220.     update_tone
  221.     refresh
  222.     select(0)
  223.     activate
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● 基本変数の初期化
  227.   #--------------------------------------------------------------------------
  228.   def init_basic_values(x, y, width = window_width, height = window_height)
  229.     @windowskin       = Cache.system("Window")
  230.     @viewport         = nil
  231.     @active           = true
  232.     @visible          = true
  233.     @x                = x
  234.     @y                = y
  235.     @width            = width
  236.     @height = height
  237.     @z                = 100
  238.     @ox               = 0
  239.     @oy               = 0
  240.     @padding          = 12
  241.     @padding_bottom   = 12
  242.     @opacity          = 255
  243.     @back_opacity     = 255
  244.     @contents_opacity = 255
  245.     @openness         = 255
  246.     @tone             = Tone.new
  247.     @index            = -1
  248.     @handler          = {}
  249.     @cursor_fix       = false
  250.     @cursor_all       = false
  251.     @opening          = false
  252.     @closing          = false
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # ● スプライトコマンド変数の初期化
  256.   #--------------------------------------------------------------------------
  257.   def init_sprite_command
  258.     @command_sprites  = []
  259.     @object_sprites   = {}
  260.     create_dummy_bitmap
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 解放
  264.   #--------------------------------------------------------------------------
  265.   def dispose
  266.     dispose_dummy_bitmap
  267.     dispose_object_sprites
  268.     dispose_command_sprites
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● ウィンドウ幅の取得
  272.   #--------------------------------------------------------------------------
  273.   def window_width
  274.     return 96
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● ウィンドウ高さの取得
  278.   #--------------------------------------------------------------------------
  279.   def window_height
  280.     return 88
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 項目数の取得
  284.   #--------------------------------------------------------------------------
  285.   def item_max
  286.     @list.size
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● コマンドリストのクリア
  290.   #--------------------------------------------------------------------------
  291.   def clear_command_list
  292.     @list = []
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● コマンドリストの作成
  296.   #--------------------------------------------------------------------------
  297.   def make_command_list
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● コマンドの追加
  301.   #     name    : コマンド名
  302.   #     symbol  : 対応するシンボル
  303.   #     enabled : 有効状態フラグ
  304.   #     ext     : 任意の拡張データ
  305.   #--------------------------------------------------------------------------
  306.   def add_command(name, symbol, enabled = true, ext = nil)
  307.     @list.push({:name=>name, :symbol=>symbol, :enabled=>enabled, :ext=>ext})
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● コマンド名の取得
  311.   #--------------------------------------------------------------------------
  312.   def command(index)
  313.     @list[index]
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● コマンド名の取得
  317.   #--------------------------------------------------------------------------
  318.   def command_name(index)
  319.     @list[index][:name]
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # ● コマンドの有効状態を取得
  323.   #--------------------------------------------------------------------------
  324.   def command_enabled?(index)
  325.     @list[index][:enabled]
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● コマンドシンボルの取得
  329.   #--------------------------------------------------------------------------
  330.   def command_symbol(index)
  331.     @list[index][:symbol]
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ● コマンドの拡張データの取得
  335.   #--------------------------------------------------------------------------
  336.   def command_ext(index)
  337.     @list[index][:ext]
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● 選択項目のコマンドデータを取得
  341.   #--------------------------------------------------------------------------
  342.   def current_data
  343.     index >= 0 ? @list[index] : nil
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 選択項目のコマンド名を取得
  347.   #--------------------------------------------------------------------------
  348.   def current_item_name
  349.     current_data ? current_data[:name] : ""
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 選択項目の有効状態を取得
  353.   #--------------------------------------------------------------------------
  354.   def current_item_enabled?
  355.     current_data ? current_data[:enabled] : false
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # ● 選択項目のシンボルを取得
  359.   #--------------------------------------------------------------------------
  360.   def current_symbol
  361.     current_data ? current_data[:symbol] : nil
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● 選択項目の拡張データを取得
  365.   #--------------------------------------------------------------------------
  366.   def current_ext
  367.     current_data ? current_data[:ext] : nil
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # ● 指定されたシンボルを持つコマンドにカーソルを移動
  371.   #--------------------------------------------------------------------------
  372.   def select_symbol(symbol)
  373.     @list.each_index {|i| select(i) if @list[i][:symbol] == symbol }
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 指定された拡張データを持つコマンドにカーソルを移動
  377.   #--------------------------------------------------------------------------
  378.   def select_ext(ext)
  379.     @list.each_index {|i| select(i) if @list[i][:ext] == ext }
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ● スプライトコマンドクラスの取得
  383.   #--------------------------------------------------------------------------
  384.   def sprite_command_class
  385.     return Sprite_ZiifCommandSprite
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # ● コマンド背景クラスの取得
  389.   #--------------------------------------------------------------------------
  390.   def sprite_background_class
  391.     return Sprite_ZiifCommandSprite
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # ● コマンドカーソルクラスの取得
  395.   #--------------------------------------------------------------------------
  396.   def sprite_cursor_class
  397.     return Sprite_ZiifCommandSprite
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● コマンドスプライトの位置を取得
  401.   #--------------------------------------------------------------------------
  402.   def sprite_index(sprite)
  403.     @command_sprites.index(sprite)
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● コマンドスプライトの作成
  407.   #--------------------------------------------------------------------------
  408.   def make_command_sprites
  409.     item_max.times {|i| @command_sprites[i] = sprite_command_class.new(self) }
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● コマンドスプライトの解放
  413.   #--------------------------------------------------------------------------
  414.   def dispose_command_sprites
  415.     @command_sprites.each {|sprite| sprite.dispose }
  416.     @command_sprites.clear
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● コマンドスプライトの更新
  420.   #--------------------------------------------------------------------------
  421.   def update_command_sprites
  422.     @command_sprites.each {|sprite| sprite.update }
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● コマンドスプライトの位置情報を更新
  426.   #--------------------------------------------------------------------------
  427.   def update_command_sprites_position
  428.     @command_sprites.each {|sprite| sprite.update_position }
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● オブジェクトスプライトの作成
  432.   #--------------------------------------------------------------------------
  433.   def make_object_sprites
  434.     @object_sprites[:background] = sprite_background_class.new(self)
  435.     @object_sprites[:cursor]     = sprite_cursor_class.new(self)
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● オブジェクトスプライトの解放
  439.   #--------------------------------------------------------------------------
  440.   def dispose_object_sprites
  441.     @object_sprites.each_value {|sprite| sprite.dispose }
  442.     @object_sprites.clear
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ● オブジェクトスプライトの更新
  446.   #--------------------------------------------------------------------------
  447.   def update_object_sprites
  448.     @object_sprites.each_value {|sprite| sprite.update }
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● オブジェクトスプライトの位置情報を更新
  452.   #--------------------------------------------------------------------------
  453.   def update_object_sprites_position
  454.     @object_sprites.each_value {|sprite| sprite.update_position }
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● コマンド内容の作成
  458.   #--------------------------------------------------------------------------
  459.   def create_contents
  460.     dispose_object_sprites
  461.     dispose_command_sprites
  462.     make_command_sprites
  463.     make_object_sprites
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ● フレーム更新
  467.   #--------------------------------------------------------------------------
  468.   def update
  469.     update_tone
  470.     update_open if @opening
  471.     update_close if @closing
  472.     update_move
  473.     update_command_sprites
  474.     update_object_sprites
  475.     process_cursor_move
  476.     process_handling
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 位置情報の更新
  480.   #--------------------------------------------------------------------------
  481.   def update_position
  482.     update_command_sprites_position
  483.     update_object_sprites_position
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● X座標の変更
  487.   #--------------------------------------------------------------------------
  488.   def x=(x)
  489.     @x = x
  490.     update_position
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● Y座標の変更
  494.   #--------------------------------------------------------------------------
  495.   def y=(y)
  496.     @y = y
  497.     update_position
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● 幅の変更
  501.   #--------------------------------------------------------------------------
  502.   def width=(width)
  503.     @width = width
  504.     update_position
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # ● 高さの変更
  508.   #--------------------------------------------------------------------------
  509.   def height=(height)
  510.     @height = height
  511.     update_position
  512.   end
  513.   #--------------------------------------------------------------------------
  514.   # ● Z座標の変更
  515.   #--------------------------------------------------------------------------
  516.   def z=(z)
  517.     @z = z
  518.     update_position
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● X座標、Y座標、幅、高さをまとめて変更
  522.   #--------------------------------------------------------------------------
  523.   def move(x, y, width, height)
  524.     @x      = x
  525.     @y      = y
  526.     @width  = width
  527.     @height = height
  528.     update_position
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● 転送元原点 X座標の変更
  532.   #--------------------------------------------------------------------------
  533.   def ox=(ox)
  534.     @ox = ox
  535.     update_position
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ● 転送元原点 Y座標の変更
  539.   #--------------------------------------------------------------------------
  540.   def oy=(oy)
  541.     @oy = oy
  542.     update_position
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● 余白の大きさの変更
  546.   #--------------------------------------------------------------------------
  547.   def padding=(padding)
  548.     @padding        = padding
  549.     @padding_bottom = padding_bottom
  550.     update_position
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ● 下線余白の大きさの変更
  554.   #--------------------------------------------------------------------------
  555.   def padding_bottom=(padding_bottom)
  556.     @padding_bottom = padding_bottom
  557.     update_position
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● ウィンドウスキンの変更
  561.   #--------------------------------------------------------------------------
  562.   def windowskin=(windowskin)
  563.     @windowskin = windowskin
  564.     update_position
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● ビューポートの変更
  568.   #--------------------------------------------------------------------------
  569.   def viewport=(viewport)
  570.     @viewport = viewport
  571.     update_position
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ● 可視状態の変更
  575.   #--------------------------------------------------------------------------
  576.   def visible=(visible)
  577.     @visible = visible
  578.     update_position
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ● 表示
  582.   #--------------------------------------------------------------------------
  583.   def show
  584.     self.visible = true
  585.     self
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● 非表示
  589.   #--------------------------------------------------------------------------
  590.   def hide
  591.     self.visible = false
  592.     self
  593.   end
  594.   #--------------------------------------------------------------------------
  595.   # ● アクティブ状態の変更
  596.   #--------------------------------------------------------------------------
  597.   def active=(active)
  598.     @active = active
  599.     update_cursor
  600.     call_update_help
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● アクティブ化
  604.   #--------------------------------------------------------------------------
  605.   def activate
  606.     self.active = true
  607.     self
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # ● 非アクティブ化
  611.   #--------------------------------------------------------------------------
  612.   def deactivate
  613.     self.active = false
  614.     self
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● 不透明度の変更
  618.   #--------------------------------------------------------------------------
  619.   def opacity=(opacity)
  620.     @opacity = [[opacity, 255].min, 0].max
  621.     update_position
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● 背景の不透明度の変更
  625.   #--------------------------------------------------------------------------
  626.   def back_opacity=(opacity)
  627.     @back_opacity = [[opacity, 255].min, 0].max
  628.     update_position
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # ● 内容の不透明度の変更
  632.   #--------------------------------------------------------------------------
  633.   def contents_opacity=(opacity)
  634.     @contents_opacity = [[opacity, 255].min, 0].max
  635.     update_position
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # ● オープン度の変更
  639.   #--------------------------------------------------------------------------
  640.   def openness=(openness)
  641.     @openness = [[openness, 255].min, 0].max
  642.     update_position
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● 完全に開いた状態かどうか?
  646.   #--------------------------------------------------------------------------
  647.   def open?
  648.     (@openness == 255)
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● 完全に閉じた状態かどうか?
  652.   #--------------------------------------------------------------------------
  653.   def close?
  654.     (@openness == 0)
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● 開く処理値の取得
  658.   #--------------------------------------------------------------------------
  659.   def opening_value
  660.     return 48
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # ● 閉じる処理値の取得
  664.   #--------------------------------------------------------------------------
  665.   def closing_value
  666.     return 48
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 開く処理の更新
  670.   #--------------------------------------------------------------------------
  671.   def update_open
  672.     self.openness += opening_value
  673.     @opening = false if open?
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● 閉じる処理の更新
  677.   #--------------------------------------------------------------------------
  678.   def update_close
  679.     self.openness -= closing_value
  680.     @closing = false if close?
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ● 開く
  684.   #--------------------------------------------------------------------------
  685.   def open
  686.     @opening = true unless open?
  687.     @closing = false
  688.     self
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # ● 閉じる
  692.   #--------------------------------------------------------------------------
  693.   def close
  694.     @closing = true unless close?
  695.     @opening = false
  696.     self
  697.   end
  698.   #--------------------------------------------------------------------------
  699.   # ● 色調の更新
  700.   #--------------------------------------------------------------------------
  701.   def update_tone
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 移動中かどうか?
  705.   #--------------------------------------------------------------------------
  706.   def move?
  707.     return false
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 停止中かどうか?
  711.   #--------------------------------------------------------------------------
  712.   def stop?
  713.     return true
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ● 位置移動の更新
  717.   #--------------------------------------------------------------------------
  718.   def update_move
  719.   end
  720.   #--------------------------------------------------------------------------
  721.   # ● カーソル位置の設定
  722.   #--------------------------------------------------------------------------
  723.   def index=(index)
  724.     @index = index
  725.     update_cursor
  726.     call_update_help
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ● 項目の選択
  730.   #--------------------------------------------------------------------------
  731.   def select(index)
  732.     self.index = index if index
  733.   end
  734.   #--------------------------------------------------------------------------
  735.   # ● 項目の選択解除
  736.   #--------------------------------------------------------------------------
  737.   def unselect
  738.     self.index = -1
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # ● 動作に対応するハンドラの設定
  742.   #     method : ハンドラとして設定するメソッド (Method オブジェクト)
  743.   #--------------------------------------------------------------------------
  744.   def set_handler(symbol, method)
  745.     @handler[symbol] = method
  746.   end
  747.   #--------------------------------------------------------------------------
  748.   # ● ハンドラの存在確認
  749.   #--------------------------------------------------------------------------
  750.   def handle?(symbol)
  751.     @handler.include?(symbol)
  752.   end
  753.   #--------------------------------------------------------------------------
  754.   # ● ハンドラの呼び出し
  755.   #--------------------------------------------------------------------------
  756.   def call_handler(symbol)
  757.     @handler[symbol].call if handle?(symbol)
  758.   end
  759.   #--------------------------------------------------------------------------
  760.   # ● カーソルの移動可能判定
  761.   #--------------------------------------------------------------------------
  762.   def cursor_movable?
  763.     stop? && active && open? && !@cursor_fix && !@cursor_all && item_max > 0
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● 下キーが押されているかどうか?
  767.   #--------------------------------------------------------------------------
  768.   def input_down?
  769.     Input.repeat?(:DOWN)
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 上キーが押されているかどうか?
  773.   #--------------------------------------------------------------------------
  774.   def input_up?
  775.     Input.repeat?(:UP)
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # ● 右キーが押されているかどうか?
  779.   #--------------------------------------------------------------------------
  780.   def input_right?
  781.     Input.repeat?(:RIGHT)
  782.   end
  783.   #--------------------------------------------------------------------------
  784.   # ● 左キーが押されているかどうか?
  785.   #--------------------------------------------------------------------------
  786.   def input_left?
  787.     Input.repeat?(:LEFT)
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # ● カーソルを下に移動
  791.   #--------------------------------------------------------------------------
  792.   def cursor_down(wrap = false)
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● カーソルを上に移動
  796.   #--------------------------------------------------------------------------
  797.   def cursor_up(wrap = false)
  798.   end
  799.   #--------------------------------------------------------------------------
  800.   # ● カーソルを右に移動
  801.   #--------------------------------------------------------------------------
  802.   def cursor_right(wrap = false)
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ● カーソルを左に移動
  806.   #--------------------------------------------------------------------------
  807.   def cursor_left(wrap = false)
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # ● カーソルの移動前処理
  811.   #--------------------------------------------------------------------------
  812.   def process_before_cursor_move
  813.     @cursor_sound_value = @index
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● カーソルの移動後処理
  817.   #--------------------------------------------------------------------------
  818.   def process_after_cursor_move
  819.     Sound.play_cursor if @index != @cursor_sound_value
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ● カーソルの移動処理
  823.   #--------------------------------------------------------------------------
  824.   def process_cursor_move
  825.     return unless cursor_movable?
  826.     process_before_cursor_move
  827.     cursor_down (Input.trigger?(:DOWN))  if input_down?
  828.     cursor_up   (Input.trigger?(:UP))    if input_up?
  829.     cursor_right(Input.trigger?(:RIGHT)) if input_right?
  830.     cursor_left (Input.trigger?(:LEFT))  if input_left?
  831.     process_after_cursor_move
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 決定やキャンセルなどのハンドリング処理
  835.   #--------------------------------------------------------------------------
  836.   def process_handling
  837.     return unless open? && active && stop?
  838.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  839.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  840.     return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
  841.     return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ● 決定処理の有効状態を取得
  845.   #--------------------------------------------------------------------------
  846.   def ok_enabled?
  847.     return true
  848.   end
  849.   #--------------------------------------------------------------------------
  850.   # ● キャンセル処理の有効状態を取得
  851.   #--------------------------------------------------------------------------
  852.   def cancel_enabled?
  853.     handle?(:cancel)
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● 決定ボタンが押されたときの処理
  857.   #--------------------------------------------------------------------------
  858.   def process_ok
  859.     if current_item_enabled?
  860.       Sound.play_ok
  861.       Input.update
  862.       deactivate
  863.       call_ok_handler
  864.     else
  865.       Sound.play_buzzer
  866.     end
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ● 決定ハンドラの呼び出し
  870.   #--------------------------------------------------------------------------
  871.   def call_ok_handler
  872.     if handle?(current_symbol)
  873.       call_handler(current_symbol)
  874.     elsif handle?(:ok)
  875.       call_ok_handler_default
  876.     else
  877.       activate
  878.     end
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # ● 決定ハンドラの呼び出し (デフォルト)
  882.   #--------------------------------------------------------------------------
  883.   def call_ok_handler_default
  884.     call_handler(:ok)
  885.   end
  886.   #--------------------------------------------------------------------------
  887.   # ● キャンセルボタンが押されたときの処理
  888.   #--------------------------------------------------------------------------
  889.   def process_cancel
  890.     Sound.play_cancel
  891.     Input.update
  892.     deactivate
  893.     call_cancel_handler
  894.   end
  895.   #--------------------------------------------------------------------------
  896.   # ● キャンセルハンドラの呼び出し
  897.   #--------------------------------------------------------------------------
  898.   def call_cancel_handler
  899.     call_handler(:cancel)
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ● L ボタン(PageUp)が押されたときの処理
  903.   #--------------------------------------------------------------------------
  904.   def process_pageup
  905.     Sound.play_cursor
  906.     Input.update
  907.     deactivate
  908.     call_handler(:pageup)
  909.   end
  910.   #--------------------------------------------------------------------------
  911.   # ● R ボタン(PageDown)が押されたときの処理
  912.   #--------------------------------------------------------------------------
  913.   def process_pagedown
  914.     Sound.play_cursor
  915.     Input.update
  916.     deactivate
  917.     call_handler(:pagedown)
  918.   end
  919.   #--------------------------------------------------------------------------
  920.   # ● カーソルの更新
  921.   #--------------------------------------------------------------------------
  922.   def update_cursor
  923.     update_position
  924.   end
  925.   #--------------------------------------------------------------------------
  926.   # ● ヘルプウィンドウの設定
  927.   #--------------------------------------------------------------------------
  928.   def help_window=(help_window)
  929.     @help_window = help_window
  930.     call_update_help
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  934.   #--------------------------------------------------------------------------
  935.   def call_update_help
  936.     update_help if active && @help_window
  937.   end
  938.   #--------------------------------------------------------------------------
  939.   # ● ヘルプウィンドウの更新
  940.   #--------------------------------------------------------------------------
  941.   def update_help
  942.     @help_window.clear
  943.   end
  944.   #--------------------------------------------------------------------------
  945.   # ● 全項目の描画
  946.   #--------------------------------------------------------------------------
  947.   def draw_all_items
  948.     item_max.times {|i| draw_item(i) }
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # ● 項目の描画
  952.   #--------------------------------------------------------------------------
  953.   def draw_item(index)
  954.     @command_sprites[index].create_contents
  955.   end
  956.   #--------------------------------------------------------------------------
  957.   # ● 項目の消去
  958.   #--------------------------------------------------------------------------
  959.   def clear_item(index)
  960.     @command_sprites[index].clear_contents
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ● 項目の再描画
  964.   #--------------------------------------------------------------------------
  965.   def redraw_item(index)
  966.     clear_item(index) if index >= 0
  967.     draw_item(index)  if index >= 0
  968.   end
  969.   #--------------------------------------------------------------------------
  970.   # ● 選択項目の再描画
  971.   #--------------------------------------------------------------------------
  972.   def redraw_current_item
  973.     redraw_item(@index)
  974.   end
  975.   #--------------------------------------------------------------------------
  976.   # ● リフレッシュ
  977.   #--------------------------------------------------------------------------
  978.   def refresh
  979.     clear_command_list
  980.     make_command_list
  981.     create_contents
  982.     draw_all_items
  983.     update_position
  984.   end
  985.   #--------------------------------------------------------------------------
  986.   # ○ ダミービットマップの作成 (ウィンドウ互換用)
  987.   #--------------------------------------------------------------------------
  988.   def create_dummy_bitmap
  989.     @dummy_bitmap = Bitmap.new(32, 32)
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ○ ダミービットマップの解放 (ウィンドウ互換用)
  993.   #--------------------------------------------------------------------------
  994.   def dispose_dummy_bitmap
  995.     @dummy_bitmap.dispose
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # ○ ウィンドウ内容の取得 (ウィンドウ互換用)
  999.   #--------------------------------------------------------------------------
  1000.   def contents
  1001.     @dummy_bitmap
  1002.   end
  1003.   #--------------------------------------------------------------------------
  1004.   # ○ カーソルの矩形 (ウィンドウ互換用)
  1005.   #--------------------------------------------------------------------------
  1006.   def cursor_rect
  1007.     Rect.new(self.x, self.y, self.width, self.height)
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ○ スクロール用矢印の可視状態 (ウィンドウ互換用)
  1011.   #--------------------------------------------------------------------------
  1012.   def arrows_visible
  1013.     return true
  1014.   end
  1015.   #--------------------------------------------------------------------------
  1016.   # ○ スクロール用矢印の可視状態の変更 (ウィンドウ互換用)
  1017.   #--------------------------------------------------------------------------
  1018.   def arrows_visible=(arrows_visible)
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ○ ポーズの可視状態 (ウィンドウ互換用)
  1022.   #--------------------------------------------------------------------------
  1023.   def pause
  1024.     return false
  1025.   end
  1026.   #--------------------------------------------------------------------------
  1027.   # ○ ポーズの可視状態の変更 (ウィンドウ互換用)
  1028.   #--------------------------------------------------------------------------
  1029.   def pause=(pause)
  1030.   end
  1031. end
  1032.  
  1033. #******************************************************************************
  1034. # ▼ 回転アイコンコマンド部
  1035. #******************************************************************************
  1036.  
  1037. #==============================================================================
  1038. # ■ Sprite_ZiifRollIconCommand
  1039. #------------------------------------------------------------------------------
  1040. #  回転コマンドアイコン表示用のスプライトです。
  1041. #==============================================================================
  1042.  
  1043. class Sprite_ZiifRollIconCommand < Sprite_ZiifCommandSprite
  1044.   #--------------------------------------------------------------------------
  1045.   # ● 解放
  1046.   #--------------------------------------------------------------------------
  1047.   def dispose
  1048.     self.bitmap.dispose
  1049.     super
  1050.   end
  1051.   #--------------------------------------------------------------------------
  1052.   # ● ビットマップの作成
  1053.   #--------------------------------------------------------------------------
  1054.   def create_bitmap
  1055.     self.bitmap = Bitmap.new(24, 24)
  1056.     self.ox     = self.bitmap.width / 2
  1057.     self.oy     = self.bitmap.height / 2
  1058.   end
  1059.   #--------------------------------------------------------------------------
  1060.   # ● アイコン番号の取得
  1061.   #--------------------------------------------------------------------------
  1062.   def icon_index
  1063.     ZiifManager.command_icon_index(command_set.command(self.index))
  1064.   end
  1065.   #--------------------------------------------------------------------------
  1066.   # ● アイコン番号の取得
  1067.   #--------------------------------------------------------------------------
  1068.   def enabled
  1069.     command_set.command_enabled?(self.index)
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # ● 半透明描画用のアルファ値を取得
  1073.   #--------------------------------------------------------------------------
  1074.   def translucent_alpha
  1075.     return 160
  1076.   end
  1077.   #--------------------------------------------------------------------------
  1078.   # ● 内容の作成
  1079.   #--------------------------------------------------------------------------
  1080.   def create_contents
  1081.     draw_icon
  1082.   end
  1083.   #--------------------------------------------------------------------------
  1084.   # ● アイコンを描画
  1085.   #--------------------------------------------------------------------------
  1086.   def draw_icon
  1087.     bitmap     = Cache.system("Iconset")
  1088.     icon_index = self.icon_index
  1089.     rect       = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1090.     self.bitmap.blt(0, 0, bitmap, rect, enabled ? 255 : translucent_alpha)
  1091.   end
  1092.   #--------------------------------------------------------------------------
  1093.   # ● 内容の削除
  1094.   #--------------------------------------------------------------------------
  1095.   def clear_contents
  1096.     self.bitmap.clear
  1097.   end
  1098.   #--------------------------------------------------------------------------
  1099.   # ● 位置情報の更新
  1100.   #--------------------------------------------------------------------------
  1101.   def update_position
  1102.     super
  1103.     update_roll
  1104.   end
  1105.   #--------------------------------------------------------------------------
  1106.   # ● 回転幅の取得
  1107.   #--------------------------------------------------------------------------
  1108.   def roll_width
  1109.     command_set.width * command_set.openness / 510
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 回転高さの取得
  1113.   #--------------------------------------------------------------------------
  1114.   def roll_height
  1115.     command_set.height * command_set.openness / 510
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # ● 回転角度の取得
  1119.   #--------------------------------------------------------------------------
  1120.   def roll_angle
  1121.     angle  = (self.index - command_set.index) * command_set.move_size
  1122.     angle += command_set.roll_angle
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● 回転位置の更新
  1126.   #--------------------------------------------------------------------------
  1127.   def update_roll
  1128.     angle  = roll_angle
  1129.     self.x = roll_width  * Math.sin(angle)    + command_set.x
  1130.     self.y = roll_height * (-Math.cos(angle)) + command_set.y
  1131.     self.z = command_set.z
  1132.   end
  1133. end
  1134.  
  1135. #==============================================================================
  1136. # ■ Sprite_ZiifRollIconBackground
  1137. #------------------------------------------------------------------------------
  1138. #  画像コマンド背景のスプライトです。
  1139. #==============================================================================
  1140.  
  1141. class Sprite_ZiifRollIconBackground < Sprite_ZiifCommandSprite
  1142.   #--------------------------------------------------------------------------
  1143.   # ● 解放
  1144.   #--------------------------------------------------------------------------
  1145.   def dispose
  1146.     self.bitmap.dispose if command_set.background_filename.empty?
  1147.     super
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ● ビットマップの作成
  1151.   #--------------------------------------------------------------------------
  1152.   def create_bitmap
  1153.     self.bitmap = Cache.system(command_set.background_filename)
  1154.     self.ox     = self.bitmap.width / 2
  1155.     self.oy     = self.bitmap.height / 2
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● コマンドの透明度の取得
  1159.   #--------------------------------------------------------------------------
  1160.   def command_set_opacity
  1161.     opacity  = command_set.opacity
  1162.     opacity *= command_set.back_opacity
  1163.     opacity *= command_set.openness
  1164.     opacity /= 65025
  1165.   end
  1166.   #--------------------------------------------------------------------------
  1167.   # ● 位置情報の更新
  1168.   #--------------------------------------------------------------------------
  1169.   def update_position
  1170.     super
  1171.     self.x = command_set.x
  1172.     self.y = command_set.y
  1173.     self.z = command_set.z - 10
  1174.   end
  1175. end
  1176.  
  1177. #==============================================================================
  1178. # ■ Sprite_ZiifRollIconCursor
  1179. #------------------------------------------------------------------------------
  1180. #  画像コマンドカーソルのスプライトです。
  1181. #==============================================================================
  1182.  
  1183. class Sprite_ZiifRollIconCursor < Sprite_ZiifCommandSprite
  1184.   #--------------------------------------------------------------------------
  1185.   # ● 解放
  1186.   #--------------------------------------------------------------------------
  1187.   def dispose
  1188.     self.bitmap.dispose if command_set.cursor_filename.empty?
  1189.     super
  1190.   end
  1191.   #--------------------------------------------------------------------------
  1192.   # ● ビットマップの作成
  1193.   #--------------------------------------------------------------------------
  1194.   def create_bitmap
  1195.     self.bitmap   = Cache.system(command_set.cursor_filename)
  1196.     self.ox       = self.bitmap.width / 2
  1197.     self.oy       = self.bitmap.height / 2
  1198.     @effect_count = 0
  1199.   end
  1200.   #--------------------------------------------------------------------------
  1201.   # ● コマンドの透明度の取得
  1202.   #--------------------------------------------------------------------------
  1203.   def command_set_opacity
  1204.     if @effect_count < 32
  1205.       value = 176 + @effect_count * 4
  1206.     else
  1207.       value = 432 - @effect_count * 4
  1208.     end
  1209.     return (value * command_set.contents_opacity / 255)
  1210.   end
  1211.   #--------------------------------------------------------------------------
  1212.   # ● フレーム更新
  1213.   #--------------------------------------------------------------------------
  1214.   def update
  1215.     super
  1216.     update_effect
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # ● 演出効果の更新
  1220.   #--------------------------------------------------------------------------
  1221.   def update_effect
  1222.     self.opacity   = command_set_opacity
  1223.     @effect_count  = 0 if @effect_count == 64
  1224.     @effect_count += 1
  1225.   end
  1226.   #--------------------------------------------------------------------------
  1227.   # ● 回転幅の取得
  1228.   #--------------------------------------------------------------------------
  1229.   def roll_width
  1230.     return 0
  1231.   end
  1232.   #--------------------------------------------------------------------------
  1233.   # ● 回転高さの取得
  1234.   #--------------------------------------------------------------------------
  1235.   def roll_height
  1236.     (- command_set.height * command_set.openness / 510)
  1237.   end
  1238.   #--------------------------------------------------------------------------
  1239.   # ● 位置情報の更新
  1240.   #--------------------------------------------------------------------------
  1241.   def update_position
  1242.     super
  1243.     self.x = command_set.x + roll_width
  1244.     self.y = command_set.y + roll_height
  1245.     self.z = command_set.z - 5
  1246.   end
  1247. end
  1248.  
  1249. #==============================================================================
  1250. # ■ Window_ZiifRollIconCommandName
  1251. #------------------------------------------------------------------------------
  1252. #  回転アイコンコマンドの選択コマンド名を表示するウィンドウです。
  1253. #==============================================================================
  1254.  
  1255. class Window_ZiifRollIconCommandName < Window_Base
  1256.   #--------------------------------------------------------------------------
  1257.   # ● オブジェクト初期化
  1258.   #--------------------------------------------------------------------------
  1259.   def initialize(command_set)
  1260.     super(0, 0, command_set.width, fitting_height(1))
  1261.     @command_set = command_set
  1262.     self.opacity = 0
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● スプライトコマンドの取得
  1266.   #--------------------------------------------------------------------------
  1267.   def command_set
  1268.     return @command_set
  1269.   end
  1270.   #--------------------------------------------------------------------------
  1271.   # ● X座標の取得
  1272.   #--------------------------------------------------------------------------
  1273.   def window_x
  1274.     (command_set.x - self.width / 2)
  1275.   end
  1276.   #--------------------------------------------------------------------------
  1277.   # ● Y座標の取得
  1278.   #--------------------------------------------------------------------------
  1279.   def window_y
  1280.     (command_set.y - self.height / 2)
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # ● コマンドのビューポートの取得
  1284.   #--------------------------------------------------------------------------
  1285.   def command_set_viewport
  1286.     return command_set.viewport
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● コマンドの可視状態の取得
  1290.   #--------------------------------------------------------------------------
  1291.   def command_set_visible
  1292.     return command_set.visible && command_set.open?
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ● コマンドの透明度の取得
  1296.   #--------------------------------------------------------------------------
  1297.   def command_set_opacity
  1298.     return command_set.contents_opacity
  1299.   end
  1300.   #--------------------------------------------------------------------------
  1301.   # ● 位置情報の更新
  1302.   #--------------------------------------------------------------------------
  1303.   def update_position
  1304.     set_information
  1305.     update_base_position
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● 基本の位置情報の更新
  1309.   #--------------------------------------------------------------------------
  1310.   def update_base_position
  1311.     self.viewport         = command_set_viewport
  1312.     self.visible          = command_set_visible
  1313.     self.contents_opacity = command_set_opacity
  1314.     self.x                = window_x + command_set.info_window_offset_x
  1315.     self.y                = window_y + command_set.info_window_offset_y
  1316.     self.z                = command_set.z + 10
  1317.   end
  1318.   #--------------------------------------------------------------------------
  1319.   # ● 表示情報の設定
  1320.   #--------------------------------------------------------------------------
  1321.   def set_information
  1322.     return if command_set.current_item_name == @name
  1323.     @name = command_set.current_item_name
  1324.     refresh
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ● リフレッシュ
  1328.   #--------------------------------------------------------------------------
  1329.   def refresh
  1330.     contents.clear
  1331.     texts = command_set.info_text_separate? ? @name.scan(/\S+/) : [@name]
  1332.     texts.push("") if texts.empty?
  1333.     self.width  = texts.collect {|text| text_size(text).width + 8 }.max
  1334.     self.width += standard_padding * 2
  1335.     self.height = fitting_height(texts.size)
  1336.     create_contents
  1337.     texts.each_with_index do |text, line|
  1338.       draw_text(0, line_height * line, contents.width, line_height, text, 1)
  1339.     end
  1340.   end
  1341. end
  1342.  
  1343. #==============================================================================
  1344. # ■ ZiifSpriteCommand_RollIcon
  1345. #------------------------------------------------------------------------------
  1346. #  回転アイコンコマンド選択を行うモジュールです。Mix-Inにより使用します。
  1347. #==============================================================================
  1348.  
  1349. module ZiifSpriteCommand_RollIcon
  1350.   #--------------------------------------------------------------------------
  1351.   # ● Mix-In
  1352.   #--------------------------------------------------------------------------
  1353.   include ZiifSpriteCommand               # 画像コマンド選択モジュール
  1354.   #--------------------------------------------------------------------------
  1355.   # ● 公開インスタンス変数
  1356.   #--------------------------------------------------------------------------
  1357.   attr_reader   :move_size                # 移動サイズ
  1358.   attr_reader   :move_speed               # 移動速度
  1359.   attr_reader   :move_count               # 移動カウント
  1360.   attr_reader   :move_type                # 移動タイプ
  1361.   #--------------------------------------------------------------------------
  1362.   # ● スプライトコマンド変数の初期化
  1363.   #--------------------------------------------------------------------------
  1364.   def init_sprite_command
  1365.     super
  1366.     @move_size  = 0
  1367.     @move_speed = 64
  1368.     @move_count = 0
  1369.     @move_type  = nil
  1370.   end
  1371.   #--------------------------------------------------------------------------
  1372.   # ● 逆回転の判定
  1373.   #--------------------------------------------------------------------------
  1374.   def reverse_roll?
  1375.     return $game_system.ziifop_reverse_roll
  1376.   end
  1377.   #--------------------------------------------------------------------------
  1378.   # ● 角度の差の取得
  1379.   #--------------------------------------------------------------------------
  1380.   def angle_difference
  1381.     (item_max > 0 ? Math::PI * 2 / item_max : 0)
  1382.   end
  1383.   #--------------------------------------------------------------------------
  1384.   # ● 回転速度の取得
  1385.   #--------------------------------------------------------------------------
  1386.   def roll_speed
  1387.     ([64 - item_max * 3, 16].max * correct_roll_speed)
  1388.   end
  1389.   #--------------------------------------------------------------------------
  1390.   # ● 回転速度の補正値の取得
  1391.   #--------------------------------------------------------------------------
  1392.   def correct_roll_speed
  1393.     case $game_system.ziifop_roll_speed
  1394.     when 0; return 0.6   # 遅い
  1395.     when 1; return 0.8   # やや遅い
  1396.     when 2; return 1     # 普通
  1397.     when 3; return 1.2   # やや速い
  1398.     when 4; return 1.4   # 速い
  1399.     end
  1400.   end
  1401.   #--------------------------------------------------------------------------
  1402.   # ● 回転動作時の角度の取得
  1403.   #--------------------------------------------------------------------------
  1404.   def roll_angle
  1405.     (move? ? move_count * move_speed * correct_roll_angle / 360 : 0)
  1406.   end
  1407.   #--------------------------------------------------------------------------
  1408.   # ● 回転方向の補正値の取得
  1409.   #--------------------------------------------------------------------------
  1410.   def correct_roll_angle
  1411.     case @move_type
  1412.     when :right ; return 1   # 右回転
  1413.     when :left  ; return -1  # 左回転
  1414.     else        ; return 0
  1415.     end
  1416.   end
  1417.   #--------------------------------------------------------------------------
  1418.   # ● 回転カウント値の設定
  1419.   #--------------------------------------------------------------------------
  1420.   def roll_count
  1421.     (move_size * 360 / move_speed)
  1422.   end
  1423.   #--------------------------------------------------------------------------
  1424.   # ● 背景画像のファイル名を取得
  1425.   #--------------------------------------------------------------------------
  1426.   def background_filename
  1427.     return ""
  1428.   end
  1429.   #--------------------------------------------------------------------------
  1430.   # ● カーソル画像のファイル名を取得
  1431.   #--------------------------------------------------------------------------
  1432.   def cursor_filename
  1433.     return "RollIconCursor"
  1434.   end
  1435.   #--------------------------------------------------------------------------
  1436.   # ● 情報ウィンドウの空白文字での改行判定
  1437.   #--------------------------------------------------------------------------
  1438.   def info_text_separate?
  1439.     return false
  1440.   end
  1441.   #--------------------------------------------------------------------------
  1442.   # ● 情報ウィンドウのX座標調整
  1443.   #--------------------------------------------------------------------------
  1444.   def info_window_offset_x
  1445.     return 0
  1446.   end
  1447.   #--------------------------------------------------------------------------
  1448.   # ● 情報ウィンドウのY座標調整
  1449.   #--------------------------------------------------------------------------
  1450.   def info_window_offset_y
  1451.     return 0
  1452.   end
  1453.   #--------------------------------------------------------------------------
  1454.   # ● スプライトコマンドクラスの取得
  1455.   #--------------------------------------------------------------------------
  1456.   def sprite_command_class
  1457.     return Sprite_ZiifRollIconCommand
  1458.   end
  1459.   #--------------------------------------------------------------------------
  1460.   # ● コマンド背景クラスの取得
  1461.   #--------------------------------------------------------------------------
  1462.   def sprite_background_class
  1463.     return Sprite_ZiifRollIconBackground
  1464.   end
  1465.   #--------------------------------------------------------------------------
  1466.   # ● コマンドカーソルクラスの取得
  1467.   #--------------------------------------------------------------------------
  1468.   def sprite_cursor_class
  1469.     return Sprite_ZiifRollIconCursor
  1470.   end
  1471.   #--------------------------------------------------------------------------
  1472.   # ● 情報ウィンドウクラスの取得
  1473.   #--------------------------------------------------------------------------
  1474.   def info_window_class
  1475.     return Window_ZiifRollIconCommandName
  1476.   end
  1477.   #--------------------------------------------------------------------------
  1478.   # ● オブジェクトスプライトの作成
  1479.   #--------------------------------------------------------------------------
  1480.   def make_object_sprites
  1481.     @object_sprites[:info_window] = info_window_class.new(self)
  1482.     super
  1483.   end
  1484.   #--------------------------------------------------------------------------
  1485.   # ● コマンド内容の作成
  1486.   #--------------------------------------------------------------------------
  1487.   def create_contents
  1488.     super
  1489.     set_roll_value
  1490.   end
  1491.   #--------------------------------------------------------------------------
  1492.   # ● 回転値の設定
  1493.   #--------------------------------------------------------------------------
  1494.   def set_roll_value
  1495.     @move_size  = angle_difference
  1496.     @move_speed = roll_speed
  1497.   end
  1498.   #--------------------------------------------------------------------------
  1499.   # ● 動作中かどうか?
  1500.   #--------------------------------------------------------------------------
  1501.   def move?
  1502.     @move_type
  1503.   end
  1504.   #--------------------------------------------------------------------------
  1505.   # ● 停止中かどうか?
  1506.   #--------------------------------------------------------------------------
  1507.   def stop?
  1508.     !@move_type
  1509.   end
  1510.   #--------------------------------------------------------------------------
  1511.   # ● 位置移動の更新
  1512.   #--------------------------------------------------------------------------
  1513.   def update_move
  1514.     if move?
  1515.       @move_count -= 1
  1516.       @move_type   = nil if @move_count <= 0
  1517.       update_cursor
  1518.     end
  1519.   end
  1520.   #--------------------------------------------------------------------------
  1521.   # ● コマンドを右に回転
  1522.   #--------------------------------------------------------------------------
  1523.   def roll_right
  1524.     @index      = (@index + 1) % item_max
  1525.     @move_type  = :right
  1526.     @move_count = roll_count
  1527.     call_update_help
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● コマンドを左に回転
  1531.   #--------------------------------------------------------------------------
  1532.   def roll_left
  1533.     @index      = (@index - 1 + item_max) % item_max
  1534.     @move_type  = :left
  1535.     @move_count = roll_count
  1536.     call_update_help
  1537.   end
  1538.   #--------------------------------------------------------------------------
  1539.   # ● 回転キーが押されているかどうか?
  1540.   #--------------------------------------------------------------------------
  1541.   def input_roll?(symbol)
  1542.     case $game_system.ziifop_roll_input_type
  1543.     when 0; return Input.press?(symbol)     # プレス
  1544.     when 1; return Input.trigger?(symbol)   # トリガー
  1545.     when 2; return Input.repeat?(symbol)    # リピート
  1546.     else  ; return Input.repeat?(symbol)
  1547.     end
  1548.   end
  1549.   #--------------------------------------------------------------------------
  1550.   # ● カーソルの移動前処理
  1551.   #--------------------------------------------------------------------------
  1552.   def process_before_cursor_move
  1553.     @cursor_sound_value = false
  1554.   end
  1555.   #--------------------------------------------------------------------------
  1556.   # ● カーソルの移動後処理
  1557.   #--------------------------------------------------------------------------
  1558.   def process_after_cursor_move
  1559.     Sound.play_cursor if @cursor_sound_value
  1560.   end
  1561.   #--------------------------------------------------------------------------
  1562.   # ● 右キーが押されているかどうか?
  1563.   #--------------------------------------------------------------------------
  1564.   def input_right?
  1565.     input_roll?(:RIGHT)
  1566.   end
  1567.   #--------------------------------------------------------------------------
  1568.   # ● 左キーが押されているかどうか?
  1569.   #--------------------------------------------------------------------------
  1570.   def input_left?
  1571.     input_roll?(:LEFT)
  1572.   end
  1573.   #--------------------------------------------------------------------------
  1574.   # ● カーソルを右に移動
  1575.   #--------------------------------------------------------------------------
  1576.   def cursor_right(wrap = false)
  1577.     reverse_roll? ? roll_left : roll_right
  1578.     @cursor_sound_value = true
  1579.   end
  1580.   #--------------------------------------------------------------------------
  1581.   # ● カーソルを左に移動
  1582.   #--------------------------------------------------------------------------
  1583.   def cursor_left(wrap = false)
  1584.     reverse_roll? ? roll_right : roll_left
  1585.     @cursor_sound_value = true
  1586.   end
  1587. end




RUBY 代码复制
  1. =begin ************************************************************************
  2.   ◆ 回転式バトルコマンド Ver.1.11
  3.   ---------------------------------------------------------------------------
  4.     バトルコマンドを回転式アイコンコマンドに変更します。
  5. =end # ************************************************************************
  6.  
  7. #-information------------------------------------------------------------------
  8. $ziifee ||= {}
  9. $ziifee[:RollBattleCommand] = true
  10. #------------------------------------------------------------------------------
  11. #-memo-------------------------------------------------------------------------
  12. #  [必要スクリプト]
  13. #    画像コマンドスクリプト (Ver.1.50以上)
  14. #  [必要画像] 以下の画像を Graphics/System にインポートしてください。
  15. #    バトルコマンド用背景画像 ( ファイル名 : Ring96x88 )
  16. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  17. #  このスクリプトは、画像コマンドスクリプトの下に入れてください。
  18. #  アイコンの変更は、画像コマンドスクリプトの中で行えます。
  19. #------------------------------------------------------------------------------
  20.  
  21. module ZiifRollBattleCommand
  22.   # ▼ コマンド表示後に表示位置を調整する ( true / false )
  23.   AdjustPartyWindow = true      # パーティウィンドウ
  24.   AdjustActorWindow = true      # アクターウィンドウ
  25. end
  26.  
  27. #******************************************************************************
  28. # ▼ 回転式コマンド導入部
  29. #******************************************************************************
  30.  
  31. class Window_PartyCommand; include ZiifSpriteCommand_RollIcon; end
  32. class Window_ActorCommand; include ZiifSpriteCommand_RollIcon; end
  33.  
  34. #******************************************************************************
  35. # ▼ レイアウト部
  36. #******************************************************************************
  37.  
  38. #==============================================================================
  39. # ■ Sprite_ZiifRollIconActorBattleCommand
  40. #==============================================================================
  41.  
  42. class Sprite_ZiifRollIconActorBattleCommand < Sprite_ZiifRollIconCommand
  43.   #--------------------------------------------------------------------------
  44.   # ● アイコン番号の取得
  45.   #--------------------------------------------------------------------------
  46.   def icon_index
  47.     if command_set.command_symbol(self.index) == :attack
  48.       return command_set.attack_icon_index
  49.     end
  50.     return super
  51.   end
  52. end
  53.  
  54. #==============================================================================
  55. # ■ Window_PartyCommand
  56. #==============================================================================
  57.  
  58. class Window_PartyCommand
  59.   #--------------------------------------------------------------------------
  60.   # ● 幅の取得
  61.   #--------------------------------------------------------------------------
  62.   def window_width
  63.     return 96
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● 高さの取得
  67.   #--------------------------------------------------------------------------
  68.   def window_height
  69.     return 88
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 背景画像のファイル名を取得
  73.   #--------------------------------------------------------------------------
  74.   def background_filename
  75.     return "Ring96x88"
  76.   end
  77. end
  78.  
  79. #==============================================================================
  80. # ■ Window_ActorCommand
  81. #==============================================================================
  82.  
  83. class Window_ActorCommand
  84.   #--------------------------------------------------------------------------
  85.   # ● 幅の取得
  86.   #--------------------------------------------------------------------------
  87.   def window_width
  88.     return 96
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ● 高さの取得
  92.   #--------------------------------------------------------------------------
  93.   def window_height
  94.     return 88
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 背景画像のファイル名を取得
  98.   #--------------------------------------------------------------------------
  99.   def background_filename
  100.     return "Ring96x88"
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● スプライトコマンドクラスの取得
  104.   #--------------------------------------------------------------------------
  105.   def sprite_command_class
  106.     return Sprite_ZiifRollIconActorBattleCommand
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 攻撃アイコン番号を取得
  110.   #--------------------------------------------------------------------------
  111.   def attack_icon_index
  112.     if @actor && !@actor.weapons.compact.empty?
  113.       return @actor.weapons.compact.first.icon_index
  114.     end
  115.     ZiifManager::IconSet[:attack][nil]
  116.   end
  117. end
  118.  
  119. #==============================================================================
  120. # ■ Scene_Battle
  121. #==============================================================================
  122.  
  123. class Scene_Battle
  124.   #--------------------------------------------------------------------------
  125.   # ● パーティコマンドウィンドウの作成
  126.   #--------------------------------------------------------------------------
  127.   alias :ziif_roll_battle_command_create_party_command_window :create_party_command_window
  128.   def create_party_command_window
  129.     ziif_roll_battle_command_create_party_command_window
  130.     if ZiifRollBattleCommand::AdjustPartyWindow
  131.       @party_command_window.x += 64
  132.       @party_command_window.y += 60
  133.     end
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● アクターコマンドウィンドウの作成
  137.   #--------------------------------------------------------------------------
  138.   alias :ziif_roll_battle_command_create_actor_command_window :create_actor_command_window
  139.   def create_actor_command_window
  140.     ziif_roll_battle_command_create_actor_command_window
  141.     if ZiifRollBattleCommand::AdjustActorWindow
  142.       @actor_command_window.x += 64
  143.       @actor_command_window.y += 60
  144.     end
  145.   end
  146. end

最佳答案

查看完整内容

它覆盖了默认的 @party_command_window 和 @actor_command_window ,然而这俩都在 Scene_Battle 中被绑定了一个 viewport viewport的作用是划分出一个小的显示区域 绑定了viewport的窗口或精灵,它的坐标原点修改为了viewport的位置,并且超出viewport范围的部分不会显示 若没有特别绑定,则取整个屏幕的范围 你可以在 Scene_Battle 中找到 create_actor_command_window 方法,把里面的 .viewport = @info_viewport 这一行注释了 ...

Lv6.析梦学徒

老鹰

梦石
39
星屑
33313
在线时间
6543 小时
注册时间
2012-5-26
帖子
3176

极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

发表于 2019-12-9 21:02:41 | 显示全部楼层
它覆盖了默认的 @party_command_window 和 @actor_command_window ,然而这俩都在 Scene_Battle 中被绑定了一个 viewport

viewport的作用是划分出一个小的显示区域
绑定了viewport的窗口或精灵,它的坐标原点修改为了viewport的位置,并且超出viewport范围的部分不会显示
若没有特别绑定,则取整个屏幕的范围

你可以在 Scene_Battle 中找到 create_actor_command_window 方法,把里面的 .viewport = @info_viewport 这一行注释了,就能在整个屏幕里显示了,不过同时注意调整它自身的x、y、z

点评

受你的启发,都搞定了,谢谢了  发表于 2019-12-10 17:42
现在就剩一个问题了,就是下面的队伍窗口固定在中间,别在选择战斗指令还有角色指令的时候往两边移动  发表于 2019-12-10 17:39
哈哈,终于找出来了,谢谢啦!  发表于 2019-12-10 17:37
我注释了这一句之后,轮盘就不见了,怎么调坐标都调不出来 - -x和y都从500到-500都试了  发表于 2019-12-10 17:33

评分

参与人数 2+2 收起 理由
踢腿水上飘 + 1 认可答案
哇哇哇啊叭叭 + 1 我很赞同

查看全部评分

回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
735
在线时间
42 小时
注册时间
2019-11-26
帖子
28
发表于 2019-12-9 21:29:24 | 显示全部楼层
第一个脚本第239行@z=100那里,把100改成200试试?

点评

我改过这里,并不行啊~  发表于 2019-12-9 22:42
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 23:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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