查看: 1483|回复: 1

[已经过期] 鼠標未動,光標先行?

[复制链接]
梦石
0
星屑
65
在线时间
55 小时
注册时间
2008-7-4
回帖
28
发表于 2015-5-15 03:55:21 | 显示全部楼层 |阅读模式

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

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

×
我用這個鼠標腳本

https://rpg.blue/thread-284480-1-1.html

加上一個選項融合和美化

http://home.gamer.com.tw/creationDetail.php?sn=2600649
http://home.gamer.com.tw/creationDetail.php?sn=2117607

why.png

然後就這樣。。。
鼠標和光標的位置不一樣。。。
QQ:858394783
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-5-15 10:21:00 | 显示全部楼层
本帖最后由 tseyik 于 2015-5-15 10:23 编辑

我建議選択肢用這個
http://woodpenguin.web.fc2.com/rgss3/choice_ex.html
選択肢拡張
  1. =begin

  2. ▼ 選択肢拡張 ver. 3.2

  3. RPGツクールVXAce用スクリプト

  4. 制作 : 木星ペンギン
  5. URL  : http://woodpenguin.blog.fc2.com/

  6. ------------------------------------------------------------------------------
  7. 概要

  8. □ 選択肢を連続して設定した場合、つなげて一つの選択肢にする機能の追加。
  9. □ 条件を設定することで、その項目を表示しない機能の追加。
  10. □ 選択肢のカーソル初期位置を指定する機能と
  11.     現在のカーソル位置を変数に入れる機能の追加。

  12. □ 選択肢ウィンドウの位置を一時的に変更する機能の追加。
  13. □ 条件を設定することで、その項目を半透明にして選択不可にする機能の追加。
  14. □ 選択肢毎にヘルプメッセージを表示できる機能の追加。

  15. ------------------------------------------------------------------------------
  16. 使い方

  17. □ 選択肢の表示を続けて配置すると、一つの選択肢にまとめられます。
  18.   ・「キャンセルの場合」の処理は、無効以外を設定したものが適用され、
  19.      複数ある場合は後の選択肢のものが適用されます。
  20.   
  21. □ 選択肢の文章中に if(条件) と入れ、その条件が偽になると項目が表示されなくなります。
  22.   ・条件は eval によって評価されます。(詳細は【組み込み関数】を参照)
  23.   ・s でスイッチ、v で変数を参照できます。
  24.   ・「キャンセルの場合」の項目が表示されない場合、無効と同じ処理をします。

  25. □ 注釈に以下の文字列を入れることで、指定された変数の値が
  26.     カーソルの初期位置になります。
  27.   
  28.     カーソル記憶(n)
  29.    
  30.       n : カーソル初期位置の入った変数番号
  31.   
  32.   ・選択肢のカーソルの位置が変更されるたびに、
  33.     この変数に選択肢の番号が入れられるようになります。
  34.   
  35. □ 注釈に以下の文字列を入れることで、選択肢ウィンドウの表示位置を
  36.    一時的に変更することが出来ます。
  37.   
  38.     選択肢位置(x, y[, row])
  39.    
  40.       x   : ウィンドウを表示する X 座標。
  41.       y   : ウィンドウを表示する Y 座標。
  42.       row : 選択肢を表示する最大行数。
  43.             指定しない場合は、通常の最大行数を無視して
  44.             すべての選択肢が表示されます。
  45.   
  46. □ 注釈に以下の文字列を入れることで、選択肢ウィンドウの背景が非表示になります。
  47.   
  48.     背景OFF
  49.    
  50. □ 選択肢の文章中に en(条件) と入れ、その条件が偽になると項目が半透明で表示されます。
  51.   ・条件は eval によって評価されます。(詳細は【組み込み関数】を参照)
  52.   ・s でスイッチ、v で変数を参照できます。
  53.   ・「キャンセルの場合」の項目が半透明の場合、ブザーが鳴ります。
  54.   
  55. □ 各項目の下に、注釈で以下の文字列を入れると、続きの注釈を
  56.     項目のヘルプメッセージとしてカーソルを合わせたときに標示することができます。
  57.   
  58.     選択肢ヘルプ
  59.    
  60. □ 詳細は下記のサイトを参照してください。

  61.   http://woodpenguin.web.fc2.com/rgss3/choice_ex.html
  62.   
  63. =end
  64. module WdTk
  65. module ChoiceEX
  66. #//////////////////////////////////////////////////////////////////////////////
  67. #
  68. # 設定項目
  69. #
  70. #//////////////////////////////////////////////////////////////////////////////
  71.   #--------------------------------------------------------------------------
  72.   # ● 選択肢の最大行数
  73.   #     選択肢を表示するウィンドウの行数の最大数です。
  74.   #     選択肢がこの数より小さければ、選択肢の数に合わせます。
  75.   #--------------------------------------------------------------------------
  76.   RowMax = 4
  77.   
  78.   #--------------------------------------------------------------------------
  79.   # ● 選択肢ヘルプを読み取る文字列
  80.   #--------------------------------------------------------------------------
  81.   Help = "選択肢ヘルプ"
  82.   
  83. end

  84. #//////////////////////////////////////////////////////////////////////////////
  85. #
  86. # 以降、変更する必要なし
  87. #
  88. #//////////////////////////////////////////////////////////////////////////////

  89.   @material ||= []
  90.   @material << :ChoiceEX
  91.   def self.include?(sym)
  92.     @material.include?(sym)
  93.   end
  94.   
  95. end

  96. #==============================================================================
  97. # ■ Game_Message
  98. #==============================================================================
  99. class Game_Message
  100.   #--------------------------------------------------------------------------
  101.   # ● 公開インスタンス変数
  102.   #--------------------------------------------------------------------------
  103.   attr_accessor :choice_x                 # 選択肢ウィンドウの表示 X 座標
  104.   attr_accessor :choice_y                 # 選択肢ウィンドウの表示 Y 座標
  105.   attr_accessor :choice_row_max           # 選択肢ウィンドウの表示行数
  106.   attr_accessor :choice_help              # 選択肢のヘルプ
  107.   attr_accessor :choice_var_id            # 選択肢のカーソル位置を入れる変数ID
  108.   attr_accessor :choice_background        # 選択肢ウィンドウ背景の表示状態
  109.   #--------------------------------------------------------------------------
  110.   # ○ クリア
  111.   #--------------------------------------------------------------------------
  112.   alias _wdtk_choice_clear clear
  113.   def clear
  114.     _wdtk_choice_clear
  115.     @choice_x = @choice_y = nil
  116.     @choice_row_max = WdTk::ChoiceEX::RowMax
  117.     @choice_help = {}
  118.     @choice_var_id = 0
  119.     @choice_background = 0
  120.   end
  121. end

  122. #==============================================================================
  123. # ■ Game_Interpreter
  124. #==============================================================================
  125. class Game_Interpreter
  126.   #--------------------------------------------------------------------------
  127.   # ☆ 選択肢のセットアップ
  128.   #--------------------------------------------------------------------------
  129.   def setup_choices(params)
  130.     add_choices(params, @index)
  131.     $game_message.choice_proc = Proc.new {|n| @branch[@indent] = n }
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 選択肢の追加
  135.   #--------------------------------------------------------------------------
  136.   def add_choices(params, i, d = 0)
  137.     params[0].each_with_index {|s, n| $game_message.choices[n + d] = s }
  138.     $game_message.choice_cancel_type = params[1] + d if params[1] > 0
  139.     indent = @list[i].indent
  140.     loop do
  141.       i += 1
  142.       if @list[i].indent == indent
  143.         case @list[i].code
  144.         when 402 # [**] の場合
  145.           get_help_texts(@list[i].parameters[0] + d, i + 1)
  146.         when 404 # 分岐終了
  147.           break
  148.         end
  149.       end
  150.     end
  151.     i += 1
  152.     add_choices(@list[i].parameters, i, d + 5) if @list[i].code == 102
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● ヘルプ用テキストの取得
  156.   #--------------------------------------------------------------------------
  157.   def get_help_texts(b, i)
  158.     if @list[i].code == 108 && @list[i].parameters[0] == WdTk::ChoiceEX::Help
  159.       $game_message.choice_help[b] = []
  160.       while @list[i + 1].code == 408
  161.         i += 1
  162.         $game_message.choice_help[b] << @list[i].parameters[0]
  163.       end
  164.     end
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ◯ 注釈
  168.   #--------------------------------------------------------------------------
  169.   alias _wdtk_choice_command_108 command_108
  170.   def command_108
  171.     _wdtk_choice_command_108
  172.     @comments.each do |comment|
  173.       case comment
  174.       when /選択肢位置\((\d+),\s*(\d+),?\s*(\d*)\)/
  175.         $game_message.choice_x = $1.to_i
  176.         $game_message.choice_y = $2.to_i
  177.         $game_message.choice_row_max = ($3.empty? ? 99 : $3.to_i)
  178.       when /カーソル記憶\((\d+)\)/
  179.         $game_message.choice_var_id = $1.to_i
  180.       when /背景(ON|OFF)/
  181.         $game_message.choice_background = ($1 == "ON" ? 0 : 1)
  182.       end
  183.     end
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ☆ 分岐終了の場合
  187.   #--------------------------------------------------------------------------
  188.   def command_404
  189.     if next_event_code == 102
  190.       @branch[@indent] -= 5 if @branch.include?(@indent)
  191.       @index += 1
  192.       command_skip
  193.     end
  194.   end
  195. end

  196. #==============================================================================
  197. # ■ Window_ChoiceList
  198. #==============================================================================
  199. class Window_ChoiceList
  200.   #--------------------------------------------------------------------------
  201.   # ☆ 入力処理の開始
  202.   #--------------------------------------------------------------------------
  203.   def start
  204.     return unless close?
  205.     clear_command_list
  206.     make_command_list
  207.     if @list.empty?
  208.       $game_message.choice_proc.call(-1)
  209.       return
  210.     end
  211.     update_placement
  212.     refresh
  213.     select(0)
  214.     if $game_message.choice_var_id > 0
  215.       select_ext($game_variables[$game_message.choice_var_id])
  216.     end
  217.     open
  218.     activate
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ☆ ウィンドウ位置の更新
  222.   #--------------------------------------------------------------------------
  223.   def update_placement
  224.     self.width = [max_choice_width + 12, 96].max + padding * 2
  225.     self.width = [width, Graphics.width].min
  226.     n = [@list.size, $game_message.choice_row_max].min
  227.     self.height = fitting_height(n)
  228.     self.x = Graphics.width - width
  229.     if @message_window.y >= Graphics.height / 2
  230.       self.y = @message_window.y - height
  231.     else
  232.       self.y = @message_window.y + @message_window.height
  233.     end
  234.     self.x = $game_message.choice_x if $game_message.choice_x
  235.     self.y = $game_message.choice_y if $game_message.choice_y
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ☆ 選択肢の最大幅を取得
  239.   #--------------------------------------------------------------------------
  240.   def max_choice_width
  241.     @list.collect {|com| text_size(com[:name]).width }.max || 0
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ☆ コマンドリストの作成
  245.   #--------------------------------------------------------------------------
  246.   def make_command_list
  247.     $game_message.choices.each_with_index do |choice, i|
  248.       next unless choice
  249.       str = choice.dup
  250.       next if str.slice!(/\s*if\(([^\)]+)\)/i) && !choice_eval($1)
  251.       enable = !str.slice!(/\s*en\(([^\)]+)\)/i) || choice_eval($1)
  252.       add_command(str, :choice, enable, i)
  253.     end
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ○ 項目の描画
  257.   #--------------------------------------------------------------------------
  258.   alias _wdtk_choice_draw_item draw_item
  259.   def draw_item(index)
  260.     @choice_enabled = command_enabled?(index)
  261.     _wdtk_choice_draw_item(index)
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● テキスト描画色の変更
  265.   #--------------------------------------------------------------------------
  266.   def change_color(color, enabled = true)
  267.     super(color, enabled && @choice_enabled)
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ☆ 決定ハンドラの呼び出し
  271.   #--------------------------------------------------------------------------
  272.   def call_ok_handler
  273.     $game_message.choice_proc.call(current_ext)
  274.     close
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● キャンセルボタンが押されたときの処理
  278.   #--------------------------------------------------------------------------
  279.   def process_cancel
  280.     return super if $game_message.choice_cancel_type % 5 == 0
  281.     index = @list.index {|c| c[:ext] == $game_message.choice_cancel_type - 1 }
  282.     return unless index
  283.     return super if command_enabled?(index)
  284.     Sound.play_buzzer
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● ウィンドウを閉じる
  288.   #--------------------------------------------------------------------------
  289.   def close
  290.     @message_window.on_show_fast unless $game_message.choice_help.empty?
  291.     super
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  295.   #--------------------------------------------------------------------------
  296.   def call_update_help
  297.     update_help if active && !$game_message.choice_help.empty?
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● ヘルプウィンドウの更新
  301.   #--------------------------------------------------------------------------
  302.   def update_help
  303.     @message_window.force_clear
  304.     if $game_message.choice_help.include?(current_ext)
  305.       $game_message.texts.replace($game_message.choice_help[current_ext])
  306.     else
  307.       $game_message.texts.clear
  308.     end
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 分岐用
  312.   #--------------------------------------------------------------------------
  313.   def choice_eval(formula)
  314.     s, v = $game_switches, $game_variables
  315.     begin
  316.       Kernel.eval(formula)
  317.     rescue
  318.       msgbox "以下の条件判定でエラーが出ました。\n\n", formula
  319.       true
  320.     end
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ● フレーム更新
  324.   #--------------------------------------------------------------------------
  325.   def update
  326.     last_index = @index
  327.     super
  328.     if last_index != @index && $game_message.choice_var_id > 0
  329.       $game_variables[$game_message.choice_var_id] = current_ext
  330.     end
  331.   end
  332. end

  333. #==============================================================================
  334. # ■ Window_Message
  335. #==============================================================================
  336. class Window_Message
  337.   #--------------------------------------------------------------------------
  338.   # ○ ウィンドウ背景の更新
  339.   #--------------------------------------------------------------------------
  340.   alias _wdtk_choice_update_background update_background
  341.   def update_background
  342.     _wdtk_choice_update_background
  343.     @choice_window.opacity = $game_message.choice_background == 0 ? 255 : 0
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 文章の標示を強制クリア
  347.   #--------------------------------------------------------------------------
  348.   def force_clear
  349.     @gold_window.close
  350.     @fiber = nil
  351.     close
  352.     if WdTk.include?(:MesEff)
  353.       @character_sprites.each do |sprite, params|
  354.         next if params.empty?
  355.         sprite.bitmap.clear
  356.         sprite.visible = false
  357.         params.clear
  358.       end
  359.     end
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ● 文章を最後まで表示する
  363.   #--------------------------------------------------------------------------
  364.   def on_show_fast
  365.     @show_fast = true
  366.   end
  367. end
复制代码

不過你的題材有点恐佈主義
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部