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

Project1

 找回密码
 注册会员
搜索
查看: 2009|回复: 2
打印 上一主题 下一主题

[已经解决] 求优化方向键选项支脚本。

[复制链接]

Lv3.寻梦者

闇吼者の災悪眷族
不気味存在締造者

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
帖子
6491
跳转到指定楼层
1
发表于 2014-9-8 22:13:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 三途亚梦 于 2014-9-8 22:14 编辑

请求对下面给出的脚本进行优化!

该脚本来自日站“回想領域”様
这个是站点链接:http://kaisou-ryouiki.sakura.ne.jp/

折叠中是脚本内容



实测发现使用这个脚本之后选项支的文字显示将不再支持控制符,
我个人非常中意这个脚本,所以不想因为它不支持控制符就放弃使用它。

委托内容自然是让该脚本任然能够完美使用并且能够支持控制符。

如果这个优化很费事的话可以转为用VIP或支付宝付款进行悬赏。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
13 小时
注册时间
2014-7-1
帖子
5
2
发表于 2014-9-9 08:11:21 | 只看该作者
本帖最后由 天羽美羽 于 2014-9-9 14:25 编辑

把Window_Base里的方法照搬就行啦

RUBY 代码复制
  1. =begin
  2.       RGSS3
  3.       
  4.       ★ 方向キー入力型選択肢 ★
  5.  
  6.       選択肢の形式をコマンド選択型から方向キー入力型に変更します。
  7.       決定キーは使用せず、選択肢のある方向に対応した方向キーを入力することで、
  8.       選択肢を選びます。
  9.       
  10.       あまり長い文字列がある選択肢には向かない・・
  11.       
  12.       ● 機能と使用法 ●==================================================
  13.       使用方法はデフォルトのイベントコマンド「選択肢の表示」とほぼ同じです。
  14.       --------------------------------------------------------------------
  15.       [デフォルトと異なる点]
  16.       デフォルトでは例えば2択の選択肢を作りたい場合、
  17.       イベントコマンド「選択肢の表示」で選択肢1と選択肢2の欄に文字列を設定します。
  18.       
  19.       このスクリプトを導入して同じことを実現しようとした場合、
  20.       「選択肢1と選択肢3の欄を使う」「選択肢3と選択肢4の欄を使う」といったことが
  21.       可能になります。
  22.       選択肢の1~4の欄は、選択肢が表示される位置を意味するようになり、
  23.       何も入力されていない欄は選択肢として判定されません。
  24.       --------------------------------------------------------------------
  25.       選択肢1~4の位置関係は以下のとおりです。
  26.        選択肢 1 : 左に選択肢が表示されます。
  27.        選択肢 2 : 右に選択肢が表示されます。
  28.        選択肢 3 : 上に選択肢が表示されます。
  29.        選択肢 4 : 下に選択肢が表示されます。
  30.       --------------------------------------------------------------------
  31.       ↓ 即席:設定例の図
  32.       [url]http://kaisou-ryouiki.sakura.ne.jp/material/manual/img/choice_manual.png[/url]
  33.       ====================================================================
  34.       
  35.       ver1.00
  36.  
  37.       Last Update : 2014/01/07
  38.       01/07 : 新規
  39.       
  40.       ろかん   [url]http://kaisou-ryouiki.sakura.ne.jp/[/url]
  41. =end
  42.  
  43. $rsi ||= {}
  44. $rsi["方向キー入力型選択肢"] = true
  45.  
  46. class Sprite_ChoiceItem < Sprite
  47.   #--------------------------------------------------------------------------
  48.   # ● オブジェクト初期化
  49.   #--------------------------------------------------------------------------
  50.   def initialize(index, parent)
  51.     super(nil)
  52.     @index = index
  53.     @parent = parent
  54.     setup
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 初期設定
  58.   #--------------------------------------------------------------------------
  59.   def setup
  60.     create_basebitmep
  61.     self.z = 500
  62.     self.ox = @base_bitmap.width / 2
  63.     self.oy = @base_bitmap.height / 2
  64.     self.visible = false
  65.     case @index
  66.     when 0
  67.       self.x = Graphics.width / 4 - 10
  68.       self.y = Graphics.height / 2
  69.     when 1
  70.       self.x = Graphics.width / 4 * 3 + 10
  71.       self.y = Graphics.height / 2
  72.     when 2
  73.       self.x = Graphics.width / 2
  74.       self.y = Graphics.height / 4 - 10
  75.     when 3
  76.       self.x = Graphics.width / 2
  77.       self.y = Graphics.height / 4 * 3 + 10
  78.     end
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● ベースビットマップの作成
  82.   #--------------------------------------------------------------------------
  83.   def create_basebitmep
  84.     @base_bitmap = Bitmap.new(170, 22)
  85.     @base_bitmap.gradient_fill_rect(0, 0, 85, 22, gradient_color2, gradient_color1)
  86.     @base_bitmap.gradient_fill_rect(85, 0, 85, 22, gradient_color1, gradient_color2)
  87.     @base_bitmap.font.size = 20
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● 背景グラデーションカラーの取得1
  91.   #--------------------------------------------------------------------------
  92.   def gradient_color1
  93.     Color.new(0, 0, 80, 180)
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 背景グラデーションカラーの取得2
  97.   #--------------------------------------------------------------------------
  98.   def gradient_color2
  99.     Color.new(0, 0, 80, 20)
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● リフレッシュ
  103.   #--------------------------------------------------------------------------
  104.   def refresh
  105.     self.bitmap.dispose if self.bitmap
  106.     self.bitmap = @base_bitmap.dup
  107.     if $game_message.choices[@index] && !$game_message.choices[@index].empty?
  108.       self.visible = true
  109.       draw_text_ex 0,0,$game_message.choices[@index]
  110.       #self.bitmap.draw_text(0, 1, 170, 22, convert_escape_characters($game_message.choices[@index]), 1)
  111.     else
  112.       self.visible = false
  113.     end
  114.     self.opacity = 0
  115.     self.zoom_x = 1
  116.     self.zoom_y = 1
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 解放
  120.   #--------------------------------------------------------------------------
  121.   def dispose
  122.     @base_bitmap.dispose
  123.     self.bitmap.dispose if self.bitmap
  124.     super
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● フレーム更新
  128.   #--------------------------------------------------------------------------
  129.   def update
  130.     super
  131.     if @parent.active
  132.       self.opacity += 28
  133.     else
  134.       unless self.opacity.zero?
  135.         if @parent.index == @index
  136.           self.zoom_x += 0.08
  137.           self.zoom_y += 0.03
  138.           self.opacity -= 13
  139.         else
  140.           self.opacity -= 28
  141.         end
  142.       end
  143.     end
  144.   end
  145.   def contents
  146.     self.bitmap
  147.   end
  148.     #--------------------------------------------------------------------------
  149.   # ● 获取文字颜色
  150.   #     n : 文字颜色编号(0..31)
  151.   #--------------------------------------------------------------------------
  152.   def text_color(n)
  153.     windowskin = Cache.system("Window")
  154.     windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  155.   end
  156.  
  157.   #--------------------------------------------------------------------------
  158.   # ● 获取各种文字颜色
  159.   #--------------------------------------------------------------------------
  160.   def normal_color;      text_color(0);   end;    # 普通
  161.   def system_color;      text_color(16);  end;    # 系统
  162.   def crisis_color;      text_color(17);  end;    # 危险
  163.   def knockout_color;    text_color(18);  end;    # 无法战斗
  164.   def gauge_back_color;  text_color(19);  end;    # 值槽背景
  165.   def hp_gauge_color1;   text_color(20);  end;    # HP 值槽 1
  166.   def hp_gauge_color2;   text_color(21);  end;    # HP 值槽 2
  167.   def mp_gauge_color1;   text_color(22);  end;    # MP 值槽 1
  168.   def mp_gauge_color2;   text_color(23);  end;    # MP 值槽 2
  169.   def mp_cost_color;     text_color(23);  end;    # 消费 TP
  170.   def power_up_color;    text_color(24);  end;    # 能力值提升(更换装备时)
  171.   def power_down_color;  text_color(25);  end;    # 能力值降低(更换装备时)
  172.   def tp_gauge_color1;   text_color(28);  end;    # TP 值槽 1
  173.   def tp_gauge_color2;   text_color(29);  end;    # TP 值槽 2
  174.   def tp_cost_color;     text_color(29);  end;    # 消费 TP
  175.   #--------------------------------------------------------------------------
  176.   # ● 获取保留项目的背景色
  177.   #--------------------------------------------------------------------------
  178.   #--------------------------------------------------------------------------
  179.   # ● 更改内容绘制颜色
  180.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  181.   #--------------------------------------------------------------------------
  182.   def change_color(color, enabled = true)
  183.     contents.font.color.set(color)
  184.     contents.font.color.alpha = translucent_alpha unless enabled
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 绘制带有控制符的文本内容
  188.   #--------------------------------------------------------------------------
  189.   def draw_text_ex(x, y, text)
  190.     reset_font_settings
  191.     text = convert_escape_characters(text)
  192.     size = text.size * self.bitmap.font.size
  193.     if text.include?("\eI")
  194.     size -= (6 * self.bitmap.font.size - 32)
  195.     elsif text.include?("\e")
  196.     size -= 6 * self.bitmap.font.size
  197.     end
  198.     x += 85
  199.     x -= size / 2
  200.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  201.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 重置字体设置
  205.   #--------------------------------------------------------------------------
  206.   def reset_font_settings
  207.     change_color(normal_color)
  208.     contents.font.size = Font.default_size
  209.     contents.font.bold = false
  210.     contents.font.italic = false
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ● 进行控制符的事前变换
  214.   #    在实际绘制前、将控制符替换为实际的内容。
  215.   #    为了减少歧异,文字「\」会被首先替换为转义符(\e)。
  216.   #--------------------------------------------------------------------------
  217.   def convert_escape_characters(text)
  218.     result = text.to_s.clone
  219.     result.gsub!(/\\/)            { "\e" }
  220.     result.gsub!(/\e\e/)          { "\\" }
  221.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  222.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  223.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  224.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  225.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  226.     result
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 获取第 n 号角色的名字
  230.   #--------------------------------------------------------------------------
  231.   def actor_name(n)
  232.     actor = n >= 1 ? $game_actors[n] : nil
  233.     actor ? actor.name : ""
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ● 获取第 n 号队伍成员的名字
  237.   #--------------------------------------------------------------------------
  238.   def party_member_name(n)
  239.     actor = n >= 1 ? $game_party.members[n - 1] : nil
  240.     actor ? actor.name : ""
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● 文字的处理
  244.   #     c    : 文字
  245.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  246.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  247.   #--------------------------------------------------------------------------
  248.   def process_character(c, text, pos)
  249.     case c
  250.     when "\r"   # 回车
  251.       return
  252.     when "\n"   # 换行
  253.       process_new_line(text, pos)
  254.     when "\f"   # 翻页
  255.       process_new_page(text, pos)
  256.     when "\e"   # 控制符
  257.       process_escape_character(obtain_escape_code(text), text, pos)
  258.     else        # 普通文字
  259.       process_normal_character(c, pos)
  260.     end
  261.   end
  262.     #--------------------------------------------------------------------------
  263.   # ● 绘制内容
  264.   #     args : 与 Bitmap#draw_text 相同
  265.   #--------------------------------------------------------------------------
  266.   def draw_text(*args)
  267.     contents.draw_text(*args)
  268.   end
  269.  
  270.   #--------------------------------------------------------------------------
  271.   # ● 处理普通文字
  272.   #--------------------------------------------------------------------------
  273.   def process_normal_character(c, pos)
  274.     text_width = text_size(c).width
  275.     draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  276.     pos[:x] += text_width
  277.   end
  278.     #--------------------------------------------------------------------------
  279.   # ● 获取内容尺寸
  280.   #--------------------------------------------------------------------------
  281.   def text_size(str)
  282.     contents.text_size(str)
  283.   end
  284.  
  285.   #--------------------------------------------------------------------------
  286.   # ● 处理换行文字
  287.   #--------------------------------------------------------------------------
  288.   def process_new_line(text, pos)
  289.     pos[:x] = pos[:new_x]
  290.     pos[:y] += pos[:height]
  291.     pos[:height] = calc_line_height(text)
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # ● 处理翻页文字
  295.   #--------------------------------------------------------------------------
  296.   def process_new_page(text, pos)
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 获取控制符的实际形式(这个方法会破坏原始数据)
  300.   #--------------------------------------------------------------------------
  301.   def obtain_escape_code(text)
  302.     text.slice!(/^[\$\.\|\^!><\{\}\\]|^[A-Z]+/i)
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # ● 获取控制符的参数(这个方法会破坏原始数据)
  306.   #--------------------------------------------------------------------------
  307.   def obtain_escape_param(text)
  308.     text.slice!(/^\[\d+\]/)[/\d+/].to_i rescue 0
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 控制符的处理
  312.   #     code : 控制符的实际形式(比如“\C[1]”是“C”)
  313.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  314.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  315.   #--------------------------------------------------------------------------
  316.   def process_escape_character(code, text, pos)
  317.     case code.upcase
  318.     when 'C'
  319.       change_color(text_color(obtain_escape_param(text)))
  320.     when 'I'
  321.       process_draw_icon(obtain_escape_param(text), pos)
  322.     when '{'
  323.       make_font_bigger
  324.     when '}'
  325.       make_font_smaller
  326.     end
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ● 处理控制符指定的图标绘制
  330.   #--------------------------------------------------------------------------
  331.   def process_draw_icon(icon_index, pos)
  332.     draw_icon(icon_index, pos[:x], pos[:y])
  333.     pos[:x] += 24
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 放大字体尺寸
  337.   #--------------------------------------------------------------------------
  338.   def make_font_bigger
  339.     contents.font.size += 8 if contents.font.size <= 64
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 缩小字体尺寸
  343.   #--------------------------------------------------------------------------
  344.   def make_font_smaller
  345.     contents.font.size -= 8 if contents.font.size >= 16
  346.   end
  347.     #--------------------------------------------------------------------------
  348.   # ● 获取行高
  349.   #--------------------------------------------------------------------------
  350.   def line_height
  351.     return 24
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # ● 获取标准的边距尺寸
  355.   #--------------------------------------------------------------------------
  356.   def standard_padding
  357.     return 12
  358.   end
  359.  
  360.   #--------------------------------------------------------------------------
  361.   # ● 计算行高
  362.   #     restore_font_size : 计算完成后是否恢复原本的字体尺寸?
  363.   #--------------------------------------------------------------------------
  364.   def calc_line_height(text, restore_font_size = true)
  365.     result = [line_height, contents.font.size].max
  366.     last_font_size = contents.font.size
  367.     text.slice(/^.*$/).scan(/\e[\{\}]/).each do |esc|
  368.       make_font_bigger  if esc == "\e{"
  369.       make_font_smaller if esc == "\e}"
  370.       result = [result, contents.font.size].max
  371.     end
  372.     contents.font.size = last_font_size if restore_font_size
  373.     result
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 绘制值槽
  377.   #     rate   : 比率(1.0 为满值)
  378.   #     color1 : 渐变色的左端
  379.   #     color2 : 渐变色的右端
  380.   #--------------------------------------------------------------------------
  381.   def draw_gauge(x, y, width, rate, color1, color2)
  382.     fill_w = (width * rate).to_i
  383.     gauge_y = y + line_height - 8
  384.     contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  385.     contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # ● 绘制图标
  389.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  390.   #--------------------------------------------------------------------------
  391.   def draw_icon(icon_index, x, y, enabled = true)
  392.     bitmap = Cache.system("Iconset")
  393.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  394.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● 绘制角色肖像图
  398.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  399.   #--------------------------------------------------------------------------
  400.   def draw_face(face_name, face_index, x, y, enabled = true)
  401.     bitmap = Cache.face(face_name)
  402.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
  403.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  404.     bitmap.dispose
  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # ● 绘制人物行走图
  408.   #--------------------------------------------------------------------------
  409.   def draw_character(character_name, character_index, x, y)
  410.     return unless character_name
  411.     bitmap = Cache.character(character_name)
  412.     sign = character_name[/^[\!\$]./]
  413.     if sign && sign.include?('$')
  414.       cw = bitmap.width / 3
  415.       ch = bitmap.height / 4
  416.     else
  417.       cw = bitmap.width / 12
  418.       ch = bitmap.height / 8
  419.     end
  420.     n = character_index
  421.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  422.     contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● 绘制名字
  426.   #--------------------------------------------------------------------------
  427.   def draw_actor_name(actor, x, y, width = 112)
  428.     change_color(hp_color(actor))
  429.     draw_text(x, y, width, line_height, actor.name)
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 绘制职业
  433.   #--------------------------------------------------------------------------
  434.   def draw_actor_class(actor, x, y, width = 112)
  435.     change_color(normal_color)
  436.     draw_text(x, y, width, line_height, actor.class.name)
  437.   end
  438.   #--------------------------------------------------------------------------
  439.   # ● 绘制称号
  440.   #--------------------------------------------------------------------------
  441.   def draw_actor_nickname(actor, x, y, width = 180)
  442.     change_color(normal_color)
  443.     draw_text(x, y, width, line_height, actor.nickname)
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ● 绘制等级
  447.   #--------------------------------------------------------------------------
  448.   def draw_actor_level(actor, x, y)
  449.     change_color(system_color)
  450.     draw_text(x, y, 32, line_height, Vocab::level_a)
  451.     change_color(normal_color)
  452.     draw_text(x + 32, y, 24, line_height, actor.level, 2)
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ● 绘制强化/弱化状态的图标
  456.   #--------------------------------------------------------------------------
  457.   def draw_actor_icons(actor, x, y, width = 96)
  458.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  459.     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  460.   end
  461. end
  462.  
  463. class Spriteset_DirectionChoice
  464.   #--------------------------------------------------------------------------
  465.   # ● 公開インスタンス変数
  466.   #--------------------------------------------------------------------------
  467.   attr_reader   :active
  468.   attr_reader   :index
  469.   #--------------------------------------------------------------------------
  470.   # ● オブジェクト初期化
  471.   #--------------------------------------------------------------------------
  472.   def initialize
  473.     @active = false
  474.     @index = -1
  475.     create_sprites
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● 選択肢スプライトの作成
  479.   #--------------------------------------------------------------------------
  480.   def create_sprites
  481.     @command_sprites = []
  482.     4.times{|i| @command_sprites << Sprite_ChoiceItem.new(i, self)}
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ● 入力処理の開始
  486.   #--------------------------------------------------------------------------
  487.   def start
  488.     @active = true
  489.     @index = -1
  490.     @command_sprites.each{|sprite| sprite.refresh}
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● 入力処理の終了
  494.   #--------------------------------------------------------------------------
  495.   def terminate
  496.     @active = false
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ● 選択肢が完全に閉じているか
  500.   #--------------------------------------------------------------------------
  501.   def close?
  502.     @command_sprites.all?{|sprite| sprite.opacity.zero?}
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 解放
  506.   #--------------------------------------------------------------------------
  507.   def dispose
  508.     @command_sprites.each{|sprite| sprite.dispose}
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● キャンセル処理の有効状態を取得
  512.   #--------------------------------------------------------------------------
  513.   def cancel_enabled?
  514.     $game_message.choice_cancel_type > 0
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● 選択肢の有効判定
  518.   #--------------------------------------------------------------------------
  519.   def active_choice?(i)
  520.     $game_message.choices[i] && !$game_message.choices[i].empty?
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ● 選択肢の選択後処理
  524.   #--------------------------------------------------------------------------
  525.   def choiced_process(index)
  526.     @index = index
  527.     $game_message.choice_proc.call(index)
  528.     @command_sprites[index].flash(Color.new(255, 255, 255, 200), 35)
  529.     Sound.play_ok
  530.     Input.update
  531.     terminate
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ● フレーム更新
  535.   #--------------------------------------------------------------------------
  536.   def update
  537.     @command_sprites.each{|sprite| sprite.update}
  538.     if @active
  539.       if cancel_enabled? && Input.trigger?(:B)
  540.         $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
  541.         Sound.play_cancel
  542.         Input.update
  543.         terminate
  544.       else
  545.         if Input.trigger?(:DOWN)
  546.           choiced_process(3) if active_choice?(3)
  547.         elsif Input.trigger?(:LEFT)
  548.           choiced_process(0) if active_choice?(0)
  549.         elsif Input.trigger?(:RIGHT)
  550.           choiced_process(1) if active_choice?(1)
  551.         elsif Input.trigger?(:UP)
  552.           choiced_process(2) if active_choice?(2)
  553.         end
  554.       end
  555.     end
  556.   end
  557.  
  558.  
  559. end
  560.  
  561. class Window_Message < Window_Base
  562.   #--------------------------------------------------------------------------
  563.   # ● 全ウィンドウの作成
  564.   #--------------------------------------------------------------------------
  565.   alias _create_all_windows_recreate_choice create_all_windows
  566.   def create_all_windows
  567.     _create_all_windows_recreate_choice
  568.     @choice_window.dispose
  569.     @choice_window = Spriteset_DirectionChoice.new
  570.   end
  571. end

点评

给你搬完了  发表于 2014-9-9 13:36
icon还是可以照搬Window_Base还是什么的  发表于 2014-9-9 12:41
基本解决,但是目前还无法显示图标图案。  发表于 2014-9-9 11:58

评分

参与人数 2星屑 +5 梦石 +1 收起 理由
三途亚梦 + 5 认可答案
VIPArcher + 1 这货是小鸟的概率好大。

查看全部评分

回复 支持 反对

使用道具 举报

Lv3.寻梦者

闇吼者の災悪眷族
不気味存在締造者

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
帖子
6491
3
 楼主| 发表于 2014-9-9 16:19:42 | 只看该作者
非常感谢2L的热心帮助。

虽然想要该 方向键选项 能够完美支持控制符,但是考虑到该脚本需要读取文本宽度对过长的文本进行调整的处理,
仍然继续完美显示图标会成为一件麻烦事。

反正像现在这样只支持变量、角色名的控制符也足够用了。结贴吧~

@VIPArcher  
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 11:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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