查看: 4333|回复: 7

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

[复制链接]
梦石
0
星屑
2019
在线时间
940 小时
注册时间
2015-10-26
回帖
293

开拓者

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


无标题.png


脚本在这里

  1. =begin ************************************************************************
  2.   ◆ 画像コマンドスクリプト (ベーススクリプト) Ver.1.82
  3.   ---------------------------------------------------------------------------
  4.     画像コマンドのベーススクリプトです。回転アイコンコマンドが使えます。
  5. =end # ************************************************************************

  6. #-information------------------------------------------------------------------
  7. $ziifee ||= {}
  8. $ziifee[:SpriteCommand] = true
  9. #------------------------------------------------------------------------------
  10. #-memo-------------------------------------------------------------------------
  11. #  [必要画像] 以下の画像を Graphics/System にインポートしてください。
  12. #    回転コマンド用カーソル画像 ( ファイル名 : RollIconCursor )
  13. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14. #  このスクリプトは可能な限り素材の中で上部に導入してください。
  15. #  回転アイコンコマンド選択を行いたいクラスに以下を記述します。
  16. #    include ZiifSpriteCommand_RollIcon  # 回転アイコンコマンド選択
  17. #------------------------------------------------------------------------------

  18. #==============================================================================
  19. # ■ ZiifManager
  20. #==============================================================================

  21. module ZiifManager
  22.   #--------------------------------------------------------------------------
  23.   # ▼ 定数 (アイコン番号)
  24.   #-memo---------------------------------------------------------------------
  25.   #  回転コマンド上に表示するアイコンはここで設定します。
  26.   #  以下の定義の symbol がここで設定するシンボルになります。
  27.   #    add_command(name, symbol, enabled, ext) # コマンドの追加
  28.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  29.   #  IconSet[シンボル] = Hash.new(アイコン番号)
  30.   #  IconSet[:skill][スキルタイプ番号] = アイコン番号  # スキルタイプ
  31.   #--------------------------------------------------------------------------
  32.   IconSet ||= Hash.new(Hash.new(16))           # デフォルト
  33.   IconSet[:fight]       = Hash.new(147)        # 戦う   (バトル)
  34.   IconSet[:escape]      = Hash.new(467)        # 逃げる (バトル)
  35.   IconSet[:attack]      = Hash.new(175)        # 攻撃   (バトル)
  36.   IconSet[:guard]       = Hash.new(506)        # 防御   (バトル)
  37.   IconSet[:item]        = Hash.new(260)        # アイテム
  38.   IconSet[:skill]       = Hash.new(112)        # スキル
  39.   IconSet[:skill][1]    = 115                  # スキルタイプ ID:01
  40.   IconSet[:skill][2]    = 117                  # スキルタイプ ID:02
  41.   IconSet[:equip]       = Hash.new(436)        # 装備
  42.   IconSet[:weapon]      = Hash.new(147)        # 武器
  43.   IconSet[:armor]       = Hash.new(506)        # 防具
  44.   IconSet[:key_item]    = Hash.new(243)        # キーアイテム
  45.   IconSet[:optimize]    = Hash.new(437)        # 最強装備
  46.   IconSet[:clear]       = Hash.new(143)        # 外す
  47.   IconSet[:status]      = Hash.new(121)        # ステータス
  48.   IconSet[:formation]   = Hash.new(183)        # 並び替え
  49.   IconSet[:save]        = Hash.new(224)        # セーブ
  50.   IconSet[:buy]         = Hash.new(270)        # 購入
  51.   IconSet[:sell]        = Hash.new(262)        # 売却
  52.   IconSet[:cancel]      = Hash.new(12)         # キャンセル
  53.   IconSet[:new_game]    = Hash.new(234)        # ニューゲーム
  54.   IconSet[:continue]    = Hash.new(224)        # コンティニュー
  55.   IconSet[:game_end]    = Hash.new(257)        # ゲーム終了
  56.   IconSet[:to_title]    = Hash.new(257)        # タイトルへ
  57.   IconSet[:shutdown]    = Hash.new(143)        # シャットダウン
  58.   #--------------------------------------------------------------------------
  59.   # ● コマンドアイコン番号の取得
  60.   #     command : ウィンドウのコマンド
  61.   #--------------------------------------------------------------------------
  62.   def self.command_icon_index(command)
  63.     IconSet[command[:symbol]][command[:ext]]
  64.   end
  65. end

  66. #==============================================================================
  67. # ■ Game_System
  68. #==============================================================================

  69. class Game_System
  70.   #--------------------------------------------------------------------------
  71.   # ● 公開インスタンス変数 (オプション拡張用)
  72.   #--------------------------------------------------------------------------
  73.   attr_writer   :ziifop_reverse_roll      # 逆回転 ( true / false )
  74.   attr_writer   :ziifop_roll_input_type   # 回転時 キー入力タイプ (0~2)
  75.   attr_writer   :ziifop_roll_speed        # 回転時 速度 (0~4)
  76.   #--------------------------------------------------------------------------
  77.   # ▼ 逆回転の取得
  78.   #--------------------------------------------------------------------------
  79.   def ziifop_reverse_roll
  80.     return false
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ▼ 回転キー入力タイプの取得 (0:プレス, 1:トリガー, 2:リピート)
  84.   #--------------------------------------------------------------------------
  85.   def ziifop_roll_input_type
  86.     return 0
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ▼ 回転速度の取得 (0:遅い ~ 4:速い)
  90.   #--------------------------------------------------------------------------
  91.   def ziifop_roll_speed
  92.     return 1
  93.   end
  94. end

  95. #******************************************************************************
  96. # ▼ 画像コマンド基本部
  97. #******************************************************************************

  98. #==============================================================================
  99. # ■ Sprite_ZiifCommandSprite
  100. #------------------------------------------------------------------------------
  101. #  コマンド画像・背景・カーソル表示用スプライトのスーパークラスです。
  102. #==============================================================================

  103. class Sprite_ZiifCommandSprite < Sprite
  104.   #--------------------------------------------------------------------------
  105.   # ● オブジェクト初期化
  106.   #--------------------------------------------------------------------------
  107.   def initialize(command_set)
  108.     super(command_set.viewport)
  109.     @command_set = command_set
  110.     init_basic_values
  111.     create_bitmap
  112.     update
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 基本変数の初期化
  116.   #--------------------------------------------------------------------------
  117.   def init_basic_values
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● ビットマップの作成
  121.   #--------------------------------------------------------------------------
  122.   def create_bitmap
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 内容の作成
  126.   #--------------------------------------------------------------------------
  127.   def create_contents
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 内容の削除
  131.   #--------------------------------------------------------------------------
  132.   def clear_contents
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● スプライトコマンドの取得
  136.   #--------------------------------------------------------------------------
  137.   def command_set
  138.     return @command_set
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● 位置の取得
  142.   #--------------------------------------------------------------------------
  143.   def index
  144.     return command_set.sprite_index(self)
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● コマンドのビューポートの取得
  148.   #--------------------------------------------------------------------------
  149.   def command_set_viewport
  150.     return command_set.viewport
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● コマンドの可視状態の取得
  154.   #--------------------------------------------------------------------------
  155.   def command_set_visible
  156.     return command_set.visible && !command_set.close?
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● コマンドの透明度の取得
  160.   #--------------------------------------------------------------------------
  161.   def command_set_opacity
  162.     return command_set.contents_opacity
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 位置情報の更新
  166.   #--------------------------------------------------------------------------
  167.   def update_position
  168.     self.viewport = command_set_viewport
  169.     self.visible  = command_set_visible
  170.     self.opacity  = command_set_opacity
  171.   end
  172. end

  173. #==============================================================================
  174. # ■ ZiifSpriteCommand
  175. #------------------------------------------------------------------------------
  176. #  画像コマンド選択を行うためのモジュールです。Mix-Inにより使用します。
  177. #==============================================================================

  178. module ZiifSpriteCommand
  179.   #--------------------------------------------------------------------------
  180.   # ● 公開インスタンス変数
  181.   #--------------------------------------------------------------------------
  182.   attr_reader   :windowskin               # ウィンドウスキン
  183.   attr_reader   :viewport                 # ビューポート
  184.   attr_reader   :active                   # 選択状態
  185.   attr_reader   :visible                  # 可視状態
  186.   attr_reader   :x                        # X座標
  187.   attr_reader   :y                        # Y座標
  188.   attr_reader   :width                    # 幅
  189.   attr_reader   :height                   # 高さ
  190.   attr_reader   :z                        # Z座標
  191.   attr_reader   :ox                       # 転送元原点 X座標
  192.   attr_reader   :oy                       # 転送元原点 Y座標
  193.   attr_reader   :padding                  # 余白の大きさ
  194.   attr_reader   :padding_bottom           # 下線余白の大きさ
  195.   attr_reader   :opacity                  # 不透明度
  196.   attr_reader   :back_opacity             # 背景の不透明度
  197.   attr_reader   :contents_opacity         # コマンドの不透明度
  198.   attr_reader   :openness                 # オープン度
  199.   attr_reader   :tone                     # 背景の色調
  200.   attr_reader   :index                    # カーソル位置
  201.   attr_reader   :help_window              # ヘルプウィンドウ
  202.   attr_accessor :cursor_fix               # カーソル固定フラグ
  203.   attr_accessor :cursor_all               # カーソル全選択フラグ
  204.   #--------------------------------------------------------------------------
  205.   # ● オブジェクト初期化
  206.   #--------------------------------------------------------------------------
  207.   def initialize(*args)
  208.     init_basic_values(*args)
  209.     init_sprite_command
  210.     update_tone
  211.     refresh
  212.     select(0)
  213.     activate
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● 基本変数の初期化
  217.   #--------------------------------------------------------------------------
  218.   def init_basic_values(x, y, width = window_width, height = window_height)
  219.     @windowskin       = Cache.system("Window")
  220.     @viewport         = nil
  221.     @active           = true
  222.     @visible          = true
  223.     @x                = x
  224.     @y                = y
  225.     @width            = width
  226.     @height = height
  227.     @z                = 100
  228.     @ox               = 0
  229.     @oy               = 0
  230.     @padding          = 12
  231.     @padding_bottom   = 12
  232.     @opacity          = 255
  233.     @back_opacity     = 255
  234.     @contents_opacity = 255
  235.     @openness         = 255
  236.     @tone             = Tone.new
  237.     @index            = -1
  238.     @handler          = {}
  239.     @cursor_fix       = false
  240.     @cursor_all       = false
  241.     @opening          = false
  242.     @closing          = false
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● スプライトコマンド変数の初期化
  246.   #--------------------------------------------------------------------------
  247.   def init_sprite_command
  248.     @command_sprites  = []
  249.     @object_sprites   = {}
  250.     create_dummy_bitmap
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● 解放
  254.   #--------------------------------------------------------------------------
  255.   def dispose
  256.     dispose_dummy_bitmap
  257.     dispose_object_sprites
  258.     dispose_command_sprites
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● ウィンドウ幅の取得
  262.   #--------------------------------------------------------------------------
  263.   def window_width
  264.     return 96
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● ウィンドウ高さの取得
  268.   #--------------------------------------------------------------------------
  269.   def window_height
  270.     return 88
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ● 項目数の取得
  274.   #--------------------------------------------------------------------------
  275.   def item_max
  276.     @list.size
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● コマンドリストのクリア
  280.   #--------------------------------------------------------------------------
  281.   def clear_command_list
  282.     @list = []
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # ● コマンドリストの作成
  286.   #--------------------------------------------------------------------------
  287.   def make_command_list
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # ● コマンドの追加
  291.   #     name    : コマンド名
  292.   #     symbol  : 対応するシンボル
  293.   #     enabled : 有効状態フラグ
  294.   #     ext     : 任意の拡張データ
  295.   #--------------------------------------------------------------------------
  296.   def add_command(name, symbol, enabled = true, ext = nil)
  297.     @list.push({:name=>name, :symbol=>symbol, :enabled=>enabled, :ext=>ext})
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● コマンド名の取得
  301.   #--------------------------------------------------------------------------
  302.   def command(index)
  303.     @list[index]
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● コマンド名の取得
  307.   #--------------------------------------------------------------------------
  308.   def command_name(index)
  309.     @list[index][:name]
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● コマンドの有効状態を取得
  313.   #--------------------------------------------------------------------------
  314.   def command_enabled?(index)
  315.     @list[index][:enabled]
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● コマンドシンボルの取得
  319.   #--------------------------------------------------------------------------
  320.   def command_symbol(index)
  321.     @list[index][:symbol]
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● コマンドの拡張データの取得
  325.   #--------------------------------------------------------------------------
  326.   def command_ext(index)
  327.     @list[index][:ext]
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 選択項目のコマンドデータを取得
  331.   #--------------------------------------------------------------------------
  332.   def current_data
  333.     index >= 0 ? @list[index] : nil
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 選択項目のコマンド名を取得
  337.   #--------------------------------------------------------------------------
  338.   def current_item_name
  339.     current_data ? current_data[:name] : ""
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 選択項目の有効状態を取得
  343.   #--------------------------------------------------------------------------
  344.   def current_item_enabled?
  345.     current_data ? current_data[:enabled] : false
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ● 選択項目のシンボルを取得
  349.   #--------------------------------------------------------------------------
  350.   def current_symbol
  351.     current_data ? current_data[:symbol] : nil
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # ● 選択項目の拡張データを取得
  355.   #--------------------------------------------------------------------------
  356.   def current_ext
  357.     current_data ? current_data[:ext] : nil
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● 指定されたシンボルを持つコマンドにカーソルを移動
  361.   #--------------------------------------------------------------------------
  362.   def select_symbol(symbol)
  363.     @list.each_index {|i| select(i) if @list[i][:symbol] == symbol }
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● 指定された拡張データを持つコマンドにカーソルを移動
  367.   #--------------------------------------------------------------------------
  368.   def select_ext(ext)
  369.     @list.each_index {|i| select(i) if @list[i][:ext] == ext }
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● スプライトコマンドクラスの取得
  373.   #--------------------------------------------------------------------------
  374.   def sprite_command_class
  375.     return Sprite_ZiifCommandSprite
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● コマンド背景クラスの取得
  379.   #--------------------------------------------------------------------------
  380.   def sprite_background_class
  381.     return Sprite_ZiifCommandSprite
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● コマンドカーソルクラスの取得
  385.   #--------------------------------------------------------------------------
  386.   def sprite_cursor_class
  387.     return Sprite_ZiifCommandSprite
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ● コマンドスプライトの位置を取得
  391.   #--------------------------------------------------------------------------
  392.   def sprite_index(sprite)
  393.     @command_sprites.index(sprite)
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ● コマンドスプライトの作成
  397.   #--------------------------------------------------------------------------
  398.   def make_command_sprites
  399.     item_max.times {|i| @command_sprites[i] = sprite_command_class.new(self) }
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● コマンドスプライトの解放
  403.   #--------------------------------------------------------------------------
  404.   def dispose_command_sprites
  405.     @command_sprites.each {|sprite| sprite.dispose }
  406.     @command_sprites.clear
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # ● コマンドスプライトの更新
  410.   #--------------------------------------------------------------------------
  411.   def update_command_sprites
  412.     @command_sprites.each {|sprite| sprite.update }
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● コマンドスプライトの位置情報を更新
  416.   #--------------------------------------------------------------------------
  417.   def update_command_sprites_position
  418.     @command_sprites.each {|sprite| sprite.update_position }
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● オブジェクトスプライトの作成
  422.   #--------------------------------------------------------------------------
  423.   def make_object_sprites
  424.     @object_sprites[:background] = sprite_background_class.new(self)
  425.     @object_sprites[:cursor]     = sprite_cursor_class.new(self)
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ● オブジェクトスプライトの解放
  429.   #--------------------------------------------------------------------------
  430.   def dispose_object_sprites
  431.     @object_sprites.each_value {|sprite| sprite.dispose }
  432.     @object_sprites.clear
  433.   end
  434.   #--------------------------------------------------------------------------
  435.   # ● オブジェクトスプライトの更新
  436.   #--------------------------------------------------------------------------
  437.   def update_object_sprites
  438.     @object_sprites.each_value {|sprite| sprite.update }
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● オブジェクトスプライトの位置情報を更新
  442.   #--------------------------------------------------------------------------
  443.   def update_object_sprites_position
  444.     @object_sprites.each_value {|sprite| sprite.update_position }
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # ● コマンド内容の作成
  448.   #--------------------------------------------------------------------------
  449.   def create_contents
  450.     dispose_object_sprites
  451.     dispose_command_sprites
  452.     make_command_sprites
  453.     make_object_sprites
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● フレーム更新
  457.   #--------------------------------------------------------------------------
  458.   def update
  459.     update_tone
  460.     update_open if @opening
  461.     update_close if @closing
  462.     update_move
  463.     update_command_sprites
  464.     update_object_sprites
  465.     process_cursor_move
  466.     process_handling
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ● 位置情報の更新
  470.   #--------------------------------------------------------------------------
  471.   def update_position
  472.     update_command_sprites_position
  473.     update_object_sprites_position
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # ● X座標の変更
  477.   #--------------------------------------------------------------------------
  478.   def x=(x)
  479.     @x = x
  480.     update_position
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ● Y座標の変更
  484.   #--------------------------------------------------------------------------
  485.   def y=(y)
  486.     @y = y
  487.     update_position
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ● 幅の変更
  491.   #--------------------------------------------------------------------------
  492.   def width=(width)
  493.     @width = width
  494.     update_position
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ● 高さの変更
  498.   #--------------------------------------------------------------------------
  499.   def height=(height)
  500.     @height = height
  501.     update_position
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ● Z座標の変更
  505.   #--------------------------------------------------------------------------
  506.   def z=(z)
  507.     @z = z
  508.     update_position
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● X座標、Y座標、幅、高さをまとめて変更
  512.   #--------------------------------------------------------------------------
  513.   def move(x, y, width, height)
  514.     @x      = x
  515.     @y      = y
  516.     @width  = width
  517.     @height = height
  518.     update_position
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● 転送元原点 X座標の変更
  522.   #--------------------------------------------------------------------------
  523.   def ox=(ox)
  524.     @ox = ox
  525.     update_position
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # ● 転送元原点 Y座標の変更
  529.   #--------------------------------------------------------------------------
  530.   def oy=(oy)
  531.     @oy = oy
  532.     update_position
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● 余白の大きさの変更
  536.   #--------------------------------------------------------------------------
  537.   def padding=(padding)
  538.     @padding        = padding
  539.     @padding_bottom = padding_bottom
  540.     update_position
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # ● 下線余白の大きさの変更
  544.   #--------------------------------------------------------------------------
  545.   def padding_bottom=(padding_bottom)
  546.     @padding_bottom = padding_bottom
  547.     update_position
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # ● ウィンドウスキンの変更
  551.   #--------------------------------------------------------------------------
  552.   def windowskin=(windowskin)
  553.     @windowskin = windowskin
  554.     update_position
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # ● ビューポートの変更
  558.   #--------------------------------------------------------------------------
  559.   def viewport=(viewport)
  560.     @viewport = viewport
  561.     update_position
  562.   end
  563.   #--------------------------------------------------------------------------
  564.   # ● 可視状態の変更
  565.   #--------------------------------------------------------------------------
  566.   def visible=(visible)
  567.     @visible = visible
  568.     update_position
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 表示
  572.   #--------------------------------------------------------------------------
  573.   def show
  574.     self.visible = true
  575.     self
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● 非表示
  579.   #--------------------------------------------------------------------------
  580.   def hide
  581.     self.visible = false
  582.     self
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● アクティブ状態の変更
  586.   #--------------------------------------------------------------------------
  587.   def active=(active)
  588.     @active = active
  589.     update_cursor
  590.     call_update_help
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● アクティブ化
  594.   #--------------------------------------------------------------------------
  595.   def activate
  596.     self.active = true
  597.     self
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 非アクティブ化
  601.   #--------------------------------------------------------------------------
  602.   def deactivate
  603.     self.active = false
  604.     self
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # ● 不透明度の変更
  608.   #--------------------------------------------------------------------------
  609.   def opacity=(opacity)
  610.     @opacity = [[opacity, 255].min, 0].max
  611.     update_position
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● 背景の不透明度の変更
  615.   #--------------------------------------------------------------------------
  616.   def back_opacity=(opacity)
  617.     @back_opacity = [[opacity, 255].min, 0].max
  618.     update_position
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ● 内容の不透明度の変更
  622.   #--------------------------------------------------------------------------
  623.   def contents_opacity=(opacity)
  624.     @contents_opacity = [[opacity, 255].min, 0].max
  625.     update_position
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● オープン度の変更
  629.   #--------------------------------------------------------------------------
  630.   def openness=(openness)
  631.     @openness = [[openness, 255].min, 0].max
  632.     update_position
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 完全に開いた状態かどうか?
  636.   #--------------------------------------------------------------------------
  637.   def open?
  638.     (@openness == 255)
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ● 完全に閉じた状態かどうか?
  642.   #--------------------------------------------------------------------------
  643.   def close?
  644.     (@openness == 0)
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # ● 開く処理値の取得
  648.   #--------------------------------------------------------------------------
  649.   def opening_value
  650.     return 48
  651.   end
  652.   #--------------------------------------------------------------------------
  653.   # ● 閉じる処理値の取得
  654.   #--------------------------------------------------------------------------
  655.   def closing_value
  656.     return 48
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ● 開く処理の更新
  660.   #--------------------------------------------------------------------------
  661.   def update_open
  662.     self.openness += opening_value
  663.     @opening = false if open?
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # ● 閉じる処理の更新
  667.   #--------------------------------------------------------------------------
  668.   def update_close
  669.     self.openness -= closing_value
  670.     @closing = false if close?
  671.   end
  672.   #--------------------------------------------------------------------------
  673.   # ● 開く
  674.   #--------------------------------------------------------------------------
  675.   def open
  676.     @opening = true unless open?
  677.     @closing = false
  678.     self
  679.   end
  680.   #--------------------------------------------------------------------------
  681.   # ● 閉じる
  682.   #--------------------------------------------------------------------------
  683.   def close
  684.     @closing = true unless close?
  685.     @opening = false
  686.     self
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ● 色調の更新
  690.   #--------------------------------------------------------------------------
  691.   def update_tone
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # ● 移動中かどうか?
  695.   #--------------------------------------------------------------------------
  696.   def move?
  697.     return false
  698.   end
  699.   #--------------------------------------------------------------------------
  700.   # ● 停止中かどうか?
  701.   #--------------------------------------------------------------------------
  702.   def stop?
  703.     return true
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # ● 位置移動の更新
  707.   #--------------------------------------------------------------------------
  708.   def update_move
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # ● カーソル位置の設定
  712.   #--------------------------------------------------------------------------
  713.   def index=(index)
  714.     @index = index
  715.     update_cursor
  716.     call_update_help
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ● 項目の選択
  720.   #--------------------------------------------------------------------------
  721.   def select(index)
  722.     self.index = index if index
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # ● 項目の選択解除
  726.   #--------------------------------------------------------------------------
  727.   def unselect
  728.     self.index = -1
  729.   end
  730.   #--------------------------------------------------------------------------
  731.   # ● 動作に対応するハンドラの設定
  732.   #     method : ハンドラとして設定するメソッド (Method オブジェクト)
  733.   #--------------------------------------------------------------------------
  734.   def set_handler(symbol, method)
  735.     @handler[symbol] = method
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # ● ハンドラの存在確認
  739.   #--------------------------------------------------------------------------
  740.   def handle?(symbol)
  741.     @handler.include?(symbol)
  742.   end
  743.   #--------------------------------------------------------------------------
  744.   # ● ハンドラの呼び出し
  745.   #--------------------------------------------------------------------------
  746.   def call_handler(symbol)
  747.     @handler[symbol].call if handle?(symbol)
  748.   end
  749.   #--------------------------------------------------------------------------
  750.   # ● カーソルの移動可能判定
  751.   #--------------------------------------------------------------------------
  752.   def cursor_movable?
  753.     stop? && active && open? && !@cursor_fix && !@cursor_all && item_max > 0
  754.   end
  755.   #--------------------------------------------------------------------------
  756.   # ● 下キーが押されているかどうか?
  757.   #--------------------------------------------------------------------------
  758.   def input_down?
  759.     Input.repeat?(:DOWN)
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # ● 上キーが押されているかどうか?
  763.   #--------------------------------------------------------------------------
  764.   def input_up?
  765.     Input.repeat?(:UP)
  766.   end
  767.   #--------------------------------------------------------------------------
  768.   # ● 右キーが押されているかどうか?
  769.   #--------------------------------------------------------------------------
  770.   def input_right?
  771.     Input.repeat?(:RIGHT)
  772.   end
  773.   #--------------------------------------------------------------------------
  774.   # ● 左キーが押されているかどうか?
  775.   #--------------------------------------------------------------------------
  776.   def input_left?
  777.     Input.repeat?(:LEFT)
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ● カーソルを下に移動
  781.   #--------------------------------------------------------------------------
  782.   def cursor_down(wrap = false)
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # ● カーソルを上に移動
  786.   #--------------------------------------------------------------------------
  787.   def cursor_up(wrap = false)
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # ● カーソルを右に移動
  791.   #--------------------------------------------------------------------------
  792.   def cursor_right(wrap = false)
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● カーソルを左に移動
  796.   #--------------------------------------------------------------------------
  797.   def cursor_left(wrap = false)
  798.   end
  799.   #--------------------------------------------------------------------------
  800.   # ● カーソルの移動前処理
  801.   #--------------------------------------------------------------------------
  802.   def process_before_cursor_move
  803.     @cursor_sound_value = @index
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ● カーソルの移動後処理
  807.   #--------------------------------------------------------------------------
  808.   def process_after_cursor_move
  809.     Sound.play_cursor if @index != @cursor_sound_value
  810.   end
  811.   #--------------------------------------------------------------------------
  812.   # ● カーソルの移動処理
  813.   #--------------------------------------------------------------------------
  814.   def process_cursor_move
  815.     return unless cursor_movable?
  816.     process_before_cursor_move
  817.     cursor_down (Input.trigger?(:DOWN))  if input_down?
  818.     cursor_up   (Input.trigger?(:UP))    if input_up?
  819.     cursor_right(Input.trigger?(:RIGHT)) if input_right?
  820.     cursor_left (Input.trigger?(:LEFT))  if input_left?
  821.     process_after_cursor_move
  822.   end
  823.   #--------------------------------------------------------------------------
  824.   # ● 決定やキャンセルなどのハンドリング処理
  825.   #--------------------------------------------------------------------------
  826.   def process_handling
  827.     return unless open? && active && stop?
  828.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  829.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  830.     return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
  831.     return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 決定処理の有効状態を取得
  835.   #--------------------------------------------------------------------------
  836.   def ok_enabled?
  837.     return true
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # ● キャンセル処理の有効状態を取得
  841.   #--------------------------------------------------------------------------
  842.   def cancel_enabled?
  843.     handle?(:cancel)
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # ● 決定ボタンが押されたときの処理
  847.   #--------------------------------------------------------------------------
  848.   def process_ok
  849.     if current_item_enabled?
  850.       Sound.play_ok
  851.       Input.update
  852.       deactivate
  853.       call_ok_handler
  854.     else
  855.       Sound.play_buzzer
  856.     end
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # ● 決定ハンドラの呼び出し
  860.   #--------------------------------------------------------------------------
  861.   def call_ok_handler
  862.     if handle?(current_symbol)
  863.       call_handler(current_symbol)
  864.     elsif handle?(:ok)
  865.       call_ok_handler_default
  866.     else
  867.       activate
  868.     end
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ● 決定ハンドラの呼び出し (デフォルト)
  872.   #--------------------------------------------------------------------------
  873.   def call_ok_handler_default
  874.     call_handler(:ok)
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● キャンセルボタンが押されたときの処理
  878.   #--------------------------------------------------------------------------
  879.   def process_cancel
  880.     Sound.play_cancel
  881.     Input.update
  882.     deactivate
  883.     call_cancel_handler
  884.   end
  885.   #--------------------------------------------------------------------------
  886.   # ● キャンセルハンドラの呼び出し
  887.   #--------------------------------------------------------------------------
  888.   def call_cancel_handler
  889.     call_handler(:cancel)
  890.   end
  891.   #--------------------------------------------------------------------------
  892.   # ● L ボタン(PageUp)が押されたときの処理
  893.   #--------------------------------------------------------------------------
  894.   def process_pageup
  895.     Sound.play_cursor
  896.     Input.update
  897.     deactivate
  898.     call_handler(:pageup)
  899.   end
  900.   #--------------------------------------------------------------------------
  901.   # ● R ボタン(PageDown)が押されたときの処理
  902.   #--------------------------------------------------------------------------
  903.   def process_pagedown
  904.     Sound.play_cursor
  905.     Input.update
  906.     deactivate
  907.     call_handler(:pagedown)
  908.   end
  909.   #--------------------------------------------------------------------------
  910.   # ● カーソルの更新
  911.   #--------------------------------------------------------------------------
  912.   def update_cursor
  913.     update_position
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # ● ヘルプウィンドウの設定
  917.   #--------------------------------------------------------------------------
  918.   def help_window=(help_window)
  919.     @help_window = help_window
  920.     call_update_help
  921.   end
  922.   #--------------------------------------------------------------------------
  923.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  924.   #--------------------------------------------------------------------------
  925.   def call_update_help
  926.     update_help if active && @help_window
  927.   end
  928.   #--------------------------------------------------------------------------
  929.   # ● ヘルプウィンドウの更新
  930.   #--------------------------------------------------------------------------
  931.   def update_help
  932.     @help_window.clear
  933.   end
  934.   #--------------------------------------------------------------------------
  935.   # ● 全項目の描画
  936.   #--------------------------------------------------------------------------
  937.   def draw_all_items
  938.     item_max.times {|i| draw_item(i) }
  939.   end
  940.   #--------------------------------------------------------------------------
  941.   # ● 項目の描画
  942.   #--------------------------------------------------------------------------
  943.   def draw_item(index)
  944.     @command_sprites[index].create_contents
  945.   end
  946.   #--------------------------------------------------------------------------
  947.   # ● 項目の消去
  948.   #--------------------------------------------------------------------------
  949.   def clear_item(index)
  950.     @command_sprites[index].clear_contents
  951.   end
  952.   #--------------------------------------------------------------------------
  953.   # ● 項目の再描画
  954.   #--------------------------------------------------------------------------
  955.   def redraw_item(index)
  956.     clear_item(index) if index >= 0
  957.     draw_item(index)  if index >= 0
  958.   end
  959.   #--------------------------------------------------------------------------
  960.   # ● 選択項目の再描画
  961.   #--------------------------------------------------------------------------
  962.   def redraw_current_item
  963.     redraw_item(@index)
  964.   end
  965.   #--------------------------------------------------------------------------
  966.   # ● リフレッシュ
  967.   #--------------------------------------------------------------------------
  968.   def refresh
  969.     clear_command_list
  970.     make_command_list
  971.     create_contents
  972.     draw_all_items
  973.     update_position
  974.   end
  975.   #--------------------------------------------------------------------------
  976.   # ○ ダミービットマップの作成 (ウィンドウ互換用)
  977.   #--------------------------------------------------------------------------
  978.   def create_dummy_bitmap
  979.     @dummy_bitmap = Bitmap.new(32, 32)
  980.   end
  981.   #--------------------------------------------------------------------------
  982.   # ○ ダミービットマップの解放 (ウィンドウ互換用)
  983.   #--------------------------------------------------------------------------
  984.   def dispose_dummy_bitmap
  985.     @dummy_bitmap.dispose
  986.   end
  987.   #--------------------------------------------------------------------------
  988.   # ○ ウィンドウ内容の取得 (ウィンドウ互換用)
  989.   #--------------------------------------------------------------------------
  990.   def contents
  991.     @dummy_bitmap
  992.   end
  993.   #--------------------------------------------------------------------------
  994.   # ○ カーソルの矩形 (ウィンドウ互換用)
  995.   #--------------------------------------------------------------------------
  996.   def cursor_rect
  997.     Rect.new(self.x, self.y, self.width, self.height)
  998.   end
  999.   #--------------------------------------------------------------------------
  1000.   # ○ スクロール用矢印の可視状態 (ウィンドウ互換用)
  1001.   #--------------------------------------------------------------------------
  1002.   def arrows_visible
  1003.     return true
  1004.   end
  1005.   #--------------------------------------------------------------------------
  1006.   # ○ スクロール用矢印の可視状態の変更 (ウィンドウ互換用)
  1007.   #--------------------------------------------------------------------------
  1008.   def arrows_visible=(arrows_visible)
  1009.   end
  1010.   #--------------------------------------------------------------------------
  1011.   # ○ ポーズの可視状態 (ウィンドウ互換用)
  1012.   #--------------------------------------------------------------------------
  1013.   def pause
  1014.     return false
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ○ ポーズの可視状態の変更 (ウィンドウ互換用)
  1018.   #--------------------------------------------------------------------------
  1019.   def pause=(pause)
  1020.   end
  1021. end

  1022. #******************************************************************************
  1023. # ▼ 回転アイコンコマンド部
  1024. #******************************************************************************

  1025. #==============================================================================
  1026. # ■ Sprite_ZiifRollIconCommand
  1027. #------------------------------------------------------------------------------
  1028. #  回転コマンドアイコン表示用のスプライトです。
  1029. #==============================================================================

  1030. class Sprite_ZiifRollIconCommand < Sprite_ZiifCommandSprite
  1031.   #--------------------------------------------------------------------------
  1032.   # ● 解放
  1033.   #--------------------------------------------------------------------------
  1034.   def dispose
  1035.     self.bitmap.dispose
  1036.     super
  1037.   end
  1038.   #--------------------------------------------------------------------------
  1039.   # ● ビットマップの作成
  1040.   #--------------------------------------------------------------------------
  1041.   def create_bitmap
  1042.     self.bitmap = Bitmap.new(24, 24)
  1043.     self.ox     = self.bitmap.width / 2
  1044.     self.oy     = self.bitmap.height / 2
  1045.   end
  1046.   #--------------------------------------------------------------------------
  1047.   # ● アイコン番号の取得
  1048.   #--------------------------------------------------------------------------
  1049.   def icon_index
  1050.     ZiifManager.command_icon_index(command_set.command(self.index))
  1051.   end
  1052.   #--------------------------------------------------------------------------
  1053.   # ● アイコン番号の取得
  1054.   #--------------------------------------------------------------------------
  1055.   def enabled
  1056.     command_set.command_enabled?(self.index)
  1057.   end
  1058.   #--------------------------------------------------------------------------
  1059.   # ● 半透明描画用のアルファ値を取得
  1060.   #--------------------------------------------------------------------------
  1061.   def translucent_alpha
  1062.     return 160
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # ● 内容の作成
  1066.   #--------------------------------------------------------------------------
  1067.   def create_contents
  1068.     draw_icon
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ● アイコンを描画
  1072.   #--------------------------------------------------------------------------
  1073.   def draw_icon
  1074.     bitmap     = Cache.system("Iconset")
  1075.     icon_index = self.icon_index
  1076.     rect       = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1077.     self.bitmap.blt(0, 0, bitmap, rect, enabled ? 255 : translucent_alpha)
  1078.   end
  1079.   #--------------------------------------------------------------------------
  1080.   # ● 内容の削除
  1081.   #--------------------------------------------------------------------------
  1082.   def clear_contents
  1083.     self.bitmap.clear
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # ● 位置情報の更新
  1087.   #--------------------------------------------------------------------------
  1088.   def update_position
  1089.     super
  1090.     update_roll
  1091.   end
  1092.   #--------------------------------------------------------------------------
  1093.   # ● 回転幅の取得
  1094.   #--------------------------------------------------------------------------
  1095.   def roll_width
  1096.     command_set.width * command_set.openness / 510
  1097.   end
  1098.   #--------------------------------------------------------------------------
  1099.   # ● 回転高さの取得
  1100.   #--------------------------------------------------------------------------
  1101.   def roll_height
  1102.     command_set.height * command_set.openness / 510
  1103.   end
  1104.   #--------------------------------------------------------------------------
  1105.   # ● 回転角度の取得
  1106.   #--------------------------------------------------------------------------
  1107.   def roll_angle
  1108.     angle  = (self.index - command_set.index) * command_set.move_size
  1109.     angle += command_set.roll_angle
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 回転位置の更新
  1113.   #--------------------------------------------------------------------------
  1114.   def update_roll
  1115.     angle  = roll_angle
  1116.     self.x = roll_width  * Math.sin(angle)    + command_set.x
  1117.     self.y = roll_height * (-Math.cos(angle)) + command_set.y
  1118.     self.z = command_set.z
  1119.   end
  1120. end

  1121. #==============================================================================
  1122. # ■ Sprite_ZiifRollIconBackground
  1123. #------------------------------------------------------------------------------
  1124. #  画像コマンド背景のスプライトです。
  1125. #==============================================================================

  1126. class Sprite_ZiifRollIconBackground < Sprite_ZiifCommandSprite
  1127.   #--------------------------------------------------------------------------
  1128.   # ● 解放
  1129.   #--------------------------------------------------------------------------
  1130.   def dispose
  1131.     self.bitmap.dispose if command_set.background_filename.empty?
  1132.     super
  1133.   end
  1134.   #--------------------------------------------------------------------------
  1135.   # ● ビットマップの作成
  1136.   #--------------------------------------------------------------------------
  1137.   def create_bitmap
  1138.     self.bitmap = Cache.system(command_set.background_filename)
  1139.     self.ox     = self.bitmap.width / 2
  1140.     self.oy     = self.bitmap.height / 2
  1141.   end
  1142.   #--------------------------------------------------------------------------
  1143.   # ● コマンドの透明度の取得
  1144.   #--------------------------------------------------------------------------
  1145.   def command_set_opacity
  1146.     opacity  = command_set.opacity
  1147.     opacity *= command_set.back_opacity
  1148.     opacity *= command_set.openness
  1149.     opacity /= 65025
  1150.   end
  1151.   #--------------------------------------------------------------------------
  1152.   # ● 位置情報の更新
  1153.   #--------------------------------------------------------------------------
  1154.   def update_position
  1155.     super
  1156.     self.x = command_set.x
  1157.     self.y = command_set.y
  1158.     self.z = command_set.z - 10
  1159.   end
  1160. end

  1161. #==============================================================================
  1162. # ■ Sprite_ZiifRollIconCursor
  1163. #------------------------------------------------------------------------------
  1164. #  画像コマンドカーソルのスプライトです。
  1165. #==============================================================================

  1166. class Sprite_ZiifRollIconCursor < Sprite_ZiifCommandSprite
  1167.   #--------------------------------------------------------------------------
  1168.   # ● 解放
  1169.   #--------------------------------------------------------------------------
  1170.   def dispose
  1171.     self.bitmap.dispose if command_set.cursor_filename.empty?
  1172.     super
  1173.   end
  1174.   #--------------------------------------------------------------------------
  1175.   # ● ビットマップの作成
  1176.   #--------------------------------------------------------------------------
  1177.   def create_bitmap
  1178.     self.bitmap   = Cache.system(command_set.cursor_filename)
  1179.     self.ox       = self.bitmap.width / 2
  1180.     self.oy       = self.bitmap.height / 2
  1181.     @effect_count = 0
  1182.   end
  1183.   #--------------------------------------------------------------------------
  1184.   # ● コマンドの透明度の取得
  1185.   #--------------------------------------------------------------------------
  1186.   def command_set_opacity
  1187.     if @effect_count < 32
  1188.       value = 176 + @effect_count * 4
  1189.     else
  1190.       value = 432 - @effect_count * 4
  1191.     end
  1192.     return (value * command_set.contents_opacity / 255)
  1193.   end
  1194.   #--------------------------------------------------------------------------
  1195.   # ● フレーム更新
  1196.   #--------------------------------------------------------------------------
  1197.   def update
  1198.     super
  1199.     update_effect
  1200.   end
  1201.   #--------------------------------------------------------------------------
  1202.   # ● 演出効果の更新
  1203.   #--------------------------------------------------------------------------
  1204.   def update_effect
  1205.     self.opacity   = command_set_opacity
  1206.     @effect_count  = 0 if @effect_count == 64
  1207.     @effect_count += 1
  1208.   end
  1209.   #--------------------------------------------------------------------------
  1210.   # ● 回転幅の取得
  1211.   #--------------------------------------------------------------------------
  1212.   def roll_width
  1213.     return 0
  1214.   end
  1215.   #--------------------------------------------------------------------------
  1216.   # ● 回転高さの取得
  1217.   #--------------------------------------------------------------------------
  1218.   def roll_height
  1219.     (- command_set.height * command_set.openness / 510)
  1220.   end
  1221.   #--------------------------------------------------------------------------
  1222.   # ● 位置情報の更新
  1223.   #--------------------------------------------------------------------------
  1224.   def update_position
  1225.     super
  1226.     self.x = command_set.x + roll_width
  1227.     self.y = command_set.y + roll_height
  1228.     self.z = command_set.z - 5
  1229.   end
  1230. end

  1231. #==============================================================================
  1232. # ■ Window_ZiifRollIconCommandName
  1233. #------------------------------------------------------------------------------
  1234. #  回転アイコンコマンドの選択コマンド名を表示するウィンドウです。
  1235. #==============================================================================

  1236. class Window_ZiifRollIconCommandName < Window_Base
  1237.   #--------------------------------------------------------------------------
  1238.   # ● オブジェクト初期化
  1239.   #--------------------------------------------------------------------------
  1240.   def initialize(command_set)
  1241.     super(0, 0, command_set.width, fitting_height(1))
  1242.     @command_set = command_set
  1243.     self.opacity = 0
  1244.   end
  1245.   #--------------------------------------------------------------------------
  1246.   # ● スプライトコマンドの取得
  1247.   #--------------------------------------------------------------------------
  1248.   def command_set
  1249.     return @command_set
  1250.   end
  1251.   #--------------------------------------------------------------------------
  1252.   # ● X座標の取得
  1253.   #--------------------------------------------------------------------------
  1254.   def window_x
  1255.     (command_set.x - self.width / 2)
  1256.   end
  1257.   #--------------------------------------------------------------------------
  1258.   # ● Y座標の取得
  1259.   #--------------------------------------------------------------------------
  1260.   def window_y
  1261.     (command_set.y - self.height / 2)
  1262.   end
  1263.   #--------------------------------------------------------------------------
  1264.   # ● コマンドのビューポートの取得
  1265.   #--------------------------------------------------------------------------
  1266.   def command_set_viewport
  1267.     return command_set.viewport
  1268.   end
  1269.   #--------------------------------------------------------------------------
  1270.   # ● コマンドの可視状態の取得
  1271.   #--------------------------------------------------------------------------
  1272.   def command_set_visible
  1273.     return command_set.visible && command_set.open?
  1274.   end
  1275.   #--------------------------------------------------------------------------
  1276.   # ● コマンドの透明度の取得
  1277.   #--------------------------------------------------------------------------
  1278.   def command_set_opacity
  1279.     return command_set.contents_opacity
  1280.   end
  1281.   #--------------------------------------------------------------------------
  1282.   # ● 位置情報の更新
  1283.   #--------------------------------------------------------------------------
  1284.   def update_position
  1285.     set_information
  1286.     update_base_position
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● 基本の位置情報の更新
  1290.   #--------------------------------------------------------------------------
  1291.   def update_base_position
  1292.     self.viewport         = command_set_viewport
  1293.     self.visible          = command_set_visible
  1294.     self.contents_opacity = command_set_opacity
  1295.     self.x                = window_x + command_set.info_window_offset_x
  1296.     self.y                = window_y + command_set.info_window_offset_y
  1297.     self.z                = command_set.z + 10
  1298.   end
  1299.   #--------------------------------------------------------------------------
  1300.   # ● 表示情報の設定
  1301.   #--------------------------------------------------------------------------
  1302.   def set_information
  1303.     return if command_set.current_item_name == @name
  1304.     @name = command_set.current_item_name
  1305.     refresh
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● リフレッシュ
  1309.   #--------------------------------------------------------------------------
  1310.   def refresh
  1311.     contents.clear
  1312.     texts = command_set.info_text_separate? ? @name.scan(/\S+/) : [@name]
  1313.     texts.push("") if texts.empty?
  1314.     self.width  = texts.collect {|text| text_size(text).width + 8 }.max
  1315.     self.width += standard_padding * 2
  1316.     self.height = fitting_height(texts.size)
  1317.     create_contents
  1318.     texts.each_with_index do |text, line|
  1319.       draw_text(0, line_height * line, contents.width, line_height, text, 1)
  1320.     end
  1321.   end
  1322. end

  1323. #==============================================================================
  1324. # ■ ZiifSpriteCommand_RollIcon
  1325. #------------------------------------------------------------------------------
  1326. #  回転アイコンコマンド選択を行うモジュールです。Mix-Inにより使用します。
  1327. #==============================================================================

  1328. module ZiifSpriteCommand_RollIcon
  1329.   #--------------------------------------------------------------------------
  1330.   # ● Mix-In
  1331.   #--------------------------------------------------------------------------
  1332.   include ZiifSpriteCommand               # 画像コマンド選択モジュール
  1333.   #--------------------------------------------------------------------------
  1334.   # ● 公開インスタンス変数
  1335.   #--------------------------------------------------------------------------
  1336.   attr_reader   :move_size                # 移動サイズ
  1337.   attr_reader   :move_speed               # 移動速度
  1338.   attr_reader   :move_count               # 移動カウント
  1339.   attr_reader   :move_type                # 移動タイプ
  1340.   #--------------------------------------------------------------------------
  1341.   # ● スプライトコマンド変数の初期化
  1342.   #--------------------------------------------------------------------------
  1343.   def init_sprite_command
  1344.     super
  1345.     @move_size  = 0
  1346.     @move_speed = 64
  1347.     @move_count = 0
  1348.     @move_type  = nil
  1349.   end
  1350.   #--------------------------------------------------------------------------
  1351.   # ● 逆回転の判定
  1352.   #--------------------------------------------------------------------------
  1353.   def reverse_roll?
  1354.     return $game_system.ziifop_reverse_roll
  1355.   end
  1356.   #--------------------------------------------------------------------------
  1357.   # ● 角度の差の取得
  1358.   #--------------------------------------------------------------------------
  1359.   def angle_difference
  1360.     (item_max > 0 ? Math::PI * 2 / item_max : 0)
  1361.   end
  1362.   #--------------------------------------------------------------------------
  1363.   # ● 回転速度の取得
  1364.   #--------------------------------------------------------------------------
  1365.   def roll_speed
  1366.     ([64 - item_max * 3, 16].max * correct_roll_speed)
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ● 回転速度の補正値の取得
  1370.   #--------------------------------------------------------------------------
  1371.   def correct_roll_speed
  1372.     case $game_system.ziifop_roll_speed
  1373.     when 0; return 0.6   # 遅い
  1374.     when 1; return 0.8   # やや遅い
  1375.     when 2; return 1     # 普通
  1376.     when 3; return 1.2   # やや速い
  1377.     when 4; return 1.4   # 速い
  1378.     end
  1379.   end
  1380.   #--------------------------------------------------------------------------
  1381.   # ● 回転動作時の角度の取得
  1382.   #--------------------------------------------------------------------------
  1383.   def roll_angle
  1384.     (move? ? move_count * move_speed * correct_roll_angle / 360 : 0)
  1385.   end
  1386.   #--------------------------------------------------------------------------
  1387.   # ● 回転方向の補正値の取得
  1388.   #--------------------------------------------------------------------------
  1389.   def correct_roll_angle
  1390.     case @move_type
  1391.     when :right ; return 1   # 右回転
  1392.     when :left  ; return -1  # 左回転
  1393.     else        ; return 0
  1394.     end
  1395.   end
  1396.   #--------------------------------------------------------------------------
  1397.   # ● 回転カウント値の設定
  1398.   #--------------------------------------------------------------------------
  1399.   def roll_count
  1400.     (move_size * 360 / move_speed)
  1401.   end
  1402.   #--------------------------------------------------------------------------
  1403.   # ● 背景画像のファイル名を取得
  1404.   #--------------------------------------------------------------------------
  1405.   def background_filename
  1406.     return ""
  1407.   end
  1408.   #--------------------------------------------------------------------------
  1409.   # ● カーソル画像のファイル名を取得
  1410.   #--------------------------------------------------------------------------
  1411.   def cursor_filename
  1412.     return "RollIconCursor"
  1413.   end
  1414.   #--------------------------------------------------------------------------
  1415.   # ● 情報ウィンドウの空白文字での改行判定
  1416.   #--------------------------------------------------------------------------
  1417.   def info_text_separate?
  1418.     return false
  1419.   end
  1420.   #--------------------------------------------------------------------------
  1421.   # ● 情報ウィンドウのX座標調整
  1422.   #--------------------------------------------------------------------------
  1423.   def info_window_offset_x
  1424.     return 0
  1425.   end
  1426.   #--------------------------------------------------------------------------
  1427.   # ● 情報ウィンドウのY座標調整
  1428.   #--------------------------------------------------------------------------
  1429.   def info_window_offset_y
  1430.     return 0
  1431.   end
  1432.   #--------------------------------------------------------------------------
  1433.   # ● スプライトコマンドクラスの取得
  1434.   #--------------------------------------------------------------------------
  1435.   def sprite_command_class
  1436.     return Sprite_ZiifRollIconCommand
  1437.   end
  1438.   #--------------------------------------------------------------------------
  1439.   # ● コマンド背景クラスの取得
  1440.   #--------------------------------------------------------------------------
  1441.   def sprite_background_class
  1442.     return Sprite_ZiifRollIconBackground
  1443.   end
  1444.   #--------------------------------------------------------------------------
  1445.   # ● コマンドカーソルクラスの取得
  1446.   #--------------------------------------------------------------------------
  1447.   def sprite_cursor_class
  1448.     return Sprite_ZiifRollIconCursor
  1449.   end
  1450.   #--------------------------------------------------------------------------
  1451.   # ● 情報ウィンドウクラスの取得
  1452.   #--------------------------------------------------------------------------
  1453.   def info_window_class
  1454.     return Window_ZiifRollIconCommandName
  1455.   end
  1456.   #--------------------------------------------------------------------------
  1457.   # ● オブジェクトスプライトの作成
  1458.   #--------------------------------------------------------------------------
  1459.   def make_object_sprites
  1460.     @object_sprites[:info_window] = info_window_class.new(self)
  1461.     super
  1462.   end
  1463.   #--------------------------------------------------------------------------
  1464.   # ● コマンド内容の作成
  1465.   #--------------------------------------------------------------------------
  1466.   def create_contents
  1467.     super
  1468.     set_roll_value
  1469.   end
  1470.   #--------------------------------------------------------------------------
  1471.   # ● 回転値の設定
  1472.   #--------------------------------------------------------------------------
  1473.   def set_roll_value
  1474.     @move_size  = angle_difference
  1475.     @move_speed = roll_speed
  1476.   end
  1477.   #--------------------------------------------------------------------------
  1478.   # ● 動作中かどうか?
  1479.   #--------------------------------------------------------------------------
  1480.   def move?
  1481.     @move_type
  1482.   end
  1483.   #--------------------------------------------------------------------------
  1484.   # ● 停止中かどうか?
  1485.   #--------------------------------------------------------------------------
  1486.   def stop?
  1487.     !@move_type
  1488.   end
  1489.   #--------------------------------------------------------------------------
  1490.   # ● 位置移動の更新
  1491.   #--------------------------------------------------------------------------
  1492.   def update_move
  1493.     if move?
  1494.       @move_count -= 1
  1495.       @move_type   = nil if @move_count <= 0
  1496.       update_cursor
  1497.     end
  1498.   end
  1499.   #--------------------------------------------------------------------------
  1500.   # ● コマンドを右に回転
  1501.   #--------------------------------------------------------------------------
  1502.   def roll_right
  1503.     @index      = (@index + 1) % item_max
  1504.     @move_type  = :right
  1505.     @move_count = roll_count
  1506.     call_update_help
  1507.   end
  1508.   #--------------------------------------------------------------------------
  1509.   # ● コマンドを左に回転
  1510.   #--------------------------------------------------------------------------
  1511.   def roll_left
  1512.     @index      = (@index - 1 + item_max) % item_max
  1513.     @move_type  = :left
  1514.     @move_count = roll_count
  1515.     call_update_help
  1516.   end
  1517.   #--------------------------------------------------------------------------
  1518.   # ● 回転キーが押されているかどうか?
  1519.   #--------------------------------------------------------------------------
  1520.   def input_roll?(symbol)
  1521.     case $game_system.ziifop_roll_input_type
  1522.     when 0; return Input.press?(symbol)     # プレス
  1523.     when 1; return Input.trigger?(symbol)   # トリガー
  1524.     when 2; return Input.repeat?(symbol)    # リピート
  1525.     else  ; return Input.repeat?(symbol)
  1526.     end
  1527.   end
  1528.   #--------------------------------------------------------------------------
  1529.   # ● カーソルの移動前処理
  1530.   #--------------------------------------------------------------------------
  1531.   def process_before_cursor_move
  1532.     @cursor_sound_value = false
  1533.   end
  1534.   #--------------------------------------------------------------------------
  1535.   # ● カーソルの移動後処理
  1536.   #--------------------------------------------------------------------------
  1537.   def process_after_cursor_move
  1538.     Sound.play_cursor if @cursor_sound_value
  1539.   end
  1540.   #--------------------------------------------------------------------------
  1541.   # ● 右キーが押されているかどうか?
  1542.   #--------------------------------------------------------------------------
  1543.   def input_right?
  1544.     input_roll?(:RIGHT)
  1545.   end
  1546.   #--------------------------------------------------------------------------
  1547.   # ● 左キーが押されているかどうか?
  1548.   #--------------------------------------------------------------------------
  1549.   def input_left?
  1550.     input_roll?(:LEFT)
  1551.   end
  1552.   #--------------------------------------------------------------------------
  1553.   # ● カーソルを右に移動
  1554.   #--------------------------------------------------------------------------
  1555.   def cursor_right(wrap = false)
  1556.     reverse_roll? ? roll_left : roll_right
  1557.     @cursor_sound_value = true
  1558.   end
  1559.   #--------------------------------------------------------------------------
  1560.   # ● カーソルを左に移動
  1561.   #--------------------------------------------------------------------------
  1562.   def cursor_left(wrap = false)
  1563.     reverse_roll? ? roll_right : roll_left
  1564.     @cursor_sound_value = true
  1565.   end
  1566. end
复制代码



  1. =begin ************************************************************************
  2.   ◆ 回転式バトルコマンド Ver.1.11
  3.   ---------------------------------------------------------------------------
  4.     バトルコマンドを回転式アイコンコマンドに変更します。
  5. =end # ************************************************************************

  6. #-information------------------------------------------------------------------
  7. $ziifee ||= {}
  8. $ziifee[:RollBattleCommand] = true
  9. #------------------------------------------------------------------------------
  10. #-memo-------------------------------------------------------------------------
  11. #  [必要スクリプト]
  12. #    画像コマンドスクリプト (Ver.1.50以上)
  13. #  [必要画像] 以下の画像を Graphics/System にインポートしてください。
  14. #    バトルコマンド用背景画像 ( ファイル名 : Ring96x88 )
  15. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  16. #  このスクリプトは、画像コマンドスクリプトの下に入れてください。
  17. #  アイコンの変更は、画像コマンドスクリプトの中で行えます。
  18. #------------------------------------------------------------------------------

  19. module ZiifRollBattleCommand
  20.   # ▼ コマンド表示後に表示位置を調整する ( true / false )
  21.   AdjustPartyWindow = true      # パーティウィンドウ
  22.   AdjustActorWindow = true      # アクターウィンドウ
  23. end

  24. #******************************************************************************
  25. # ▼ 回転式コマンド導入部
  26. #******************************************************************************

  27. class Window_PartyCommand; include ZiifSpriteCommand_RollIcon; end
  28. class Window_ActorCommand; include ZiifSpriteCommand_RollIcon; end

  29. #******************************************************************************
  30. # ▼ レイアウト部
  31. #******************************************************************************

  32. #==============================================================================
  33. # ■ Sprite_ZiifRollIconActorBattleCommand
  34. #==============================================================================

  35. class Sprite_ZiifRollIconActorBattleCommand < Sprite_ZiifRollIconCommand
  36.   #--------------------------------------------------------------------------
  37.   # ● アイコン番号の取得
  38.   #--------------------------------------------------------------------------
  39.   def icon_index
  40.     if command_set.command_symbol(self.index) == :attack
  41.       return command_set.attack_icon_index
  42.     end
  43.     return super
  44.   end
  45. end

  46. #==============================================================================
  47. # ■ Window_PartyCommand
  48. #==============================================================================

  49. class Window_PartyCommand
  50.   #--------------------------------------------------------------------------
  51.   # ● 幅の取得
  52.   #--------------------------------------------------------------------------
  53.   def window_width
  54.     return 96
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 高さの取得
  58.   #--------------------------------------------------------------------------
  59.   def window_height
  60.     return 88
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● 背景画像のファイル名を取得
  64.   #--------------------------------------------------------------------------
  65.   def background_filename
  66.     return "Ring96x88"
  67.   end
  68. end

  69. #==============================================================================
  70. # ■ Window_ActorCommand
  71. #==============================================================================

  72. class Window_ActorCommand
  73.   #--------------------------------------------------------------------------
  74.   # ● 幅の取得
  75.   #--------------------------------------------------------------------------
  76.   def window_width
  77.     return 96
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● 高さの取得
  81.   #--------------------------------------------------------------------------
  82.   def window_height
  83.     return 88
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   # ● 背景画像のファイル名を取得
  87.   #--------------------------------------------------------------------------
  88.   def background_filename
  89.     return "Ring96x88"
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● スプライトコマンドクラスの取得
  93.   #--------------------------------------------------------------------------
  94.   def sprite_command_class
  95.     return Sprite_ZiifRollIconActorBattleCommand
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● 攻撃アイコン番号を取得
  99.   #--------------------------------------------------------------------------
  100.   def attack_icon_index
  101.     if @actor && !@actor.weapons.compact.empty?
  102.       return @actor.weapons.compact.first.icon_index
  103.     end
  104.     ZiifManager::IconSet[:attack][nil]
  105.   end
  106. end

  107. #==============================================================================
  108. # ■ Scene_Battle
  109. #==============================================================================

  110. class Scene_Battle
  111.   #--------------------------------------------------------------------------
  112.   # ● パーティコマンドウィンドウの作成
  113.   #--------------------------------------------------------------------------
  114.   alias :ziif_roll_battle_command_create_party_command_window :create_party_command_window
  115.   def create_party_command_window
  116.     ziif_roll_battle_command_create_party_command_window
  117.     if ZiifRollBattleCommand::AdjustPartyWindow
  118.       @party_command_window.x += 64
  119.       @party_command_window.y += 60
  120.     end
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● アクターコマンドウィンドウの作成
  124.   #--------------------------------------------------------------------------
  125.   alias :ziif_roll_battle_command_create_actor_command_window :create_actor_command_window
  126.   def create_actor_command_window
  127.     ziif_roll_battle_command_create_actor_command_window
  128.     if ZiifRollBattleCommand::AdjustActorWindow
  129.       @actor_command_window.x += 64
  130.       @actor_command_window.y += 60
  131.     end
  132.   end
  133. end
复制代码

最佳答案

查看完整内容

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

老鹰

梦石
40
星屑
38044
在线时间
7127 小时
注册时间
2012-5-26
回帖
3306

极短24评委极短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 我很赞同

查看全部评分

回复

使用道具 举报

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

点评

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

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部