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

Project1

 找回密码
 注册会员
搜索
楼主: Sion
打印 上一主题 下一主题

[RMVA发布] VA鼠标脚本 6/9 更新 v2.32 by Sion

  [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
1
发表于 2013-3-23 11:58:03 | 显示全部楼层
本帖最后由 tyq4590 于 2013-3-24 13:26 编辑

这个脚本很不错,手感各方面都很出色。就是遇到一个问题:在其他脚本用到cursor_fix的时候会报错:undefined method 'cursor_fix=' for true:TrueClass 不知道有没有解决办法?(我测试了一下,只要把全鼠标脚本移除就不报错了,所以确定是跟全鼠标脚本的兼容性问题)

附上脚本(画廊),报错的部分是605行‘@list_window.activate.cursor_fix = true’这一句:

RUBY 代码复制
  1. #==============================================================================
  2. # ■ VXAce-RGSS3-18 ギャラリー        by Claimh
  3. #------------------------------------------------------------------------------
  4. # 写真を表示するギャラリーを作ります
  5. # なお、ギャラリーの管理情報は全セーブデータで共通となります。
  6. #------------------------------------------------------------------------------
  7. # ●ギャラリー全体の表示許可
  8. #   DataManager.garally.enable = true
  9. # ●写真の表示許可
  10. #   DataManager.garally[id] = true
  11. # ●写真の追加(LIST以外のスナップショットなどを追加)
  12. #   DataManager.garally.push(id, GFile.new(filename, text))
  13. # ●イベント等から呼び出す
  14. #   SceneManager.call(Scene_ExGarally)
  15. #==============================================================================
  16.  
  17. class GFile
  18.   attr_reader :name
  19.   attr_reader :text
  20.   def initialize(filename, text="")
  21.     @name = filename; @text = text
  22.   end
  23. end
  24.  
  25. module ExGarally
  26.   # 写真の設定
  27.   LIST = {
  28. #  ID => GFile.new("ファイル名(Graphics/Pictures)", 表示文字)
  29.    1  => GFile.new("BlueSky", "青い空\n改行"),
  30.    2  => GFile.new("CloudySky1", "曇った空"),
  31.    3  => GFile.new("CloudySky2"),
  32.    4  => GFile.new("DarkSpace1"),
  33.    5  => GFile.new("DarkSpace2"),
  34.    6  => GFile.new("Mountains1"),
  35.    7  => GFile.new("Mountains2"),
  36.    8  => GFile.new("Mountains3"),
  37.    9  => GFile.new("Mountains4"),
  38.    10 => GFile.new("Mountains5"),
  39.    12 => GFile.new("Ocean2"),
  40.    11 => GFile.new("Ocean1"),
  41.    13 => GFile.new("SeaofClouds"),
  42.    14 => GFile.new("StarlitSky"),
  43. #   15 => GFile.new("Sunset"),
  44.   }
  45.  
  46.   # ヘルプウィンドウの行数(1~3)
  47.   HELP_LINES = 2
  48. end
  49.  
  50.  
  51. #==============================================================================
  52. # ■ ExGarally
  53. #==============================================================================
  54. module ExGarally
  55.   #--------------------------------------------------------------------------
  56.   # ● ギャラリーの表示有効?
  57.   #--------------------------------------------------------------------------
  58.   def self.enable?
  59.     DataManager.garally.enable
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● ファイル名
  63.   #--------------------------------------------------------------------------
  64.   def self.filename
  65.     "exgallary.rvdata2"
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● セーブの実行
  69.   #--------------------------------------------------------------------------
  70.   def self.save_exdata(obj)
  71.     save_data(obj, filename)
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● ロードの実行
  75.   #--------------------------------------------------------------------------
  76.   def self.load_exdata
  77.     exist? ? load_data(filename) : Game_ExGarallyList.new
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● ファイル削除
  81.   #--------------------------------------------------------------------------
  82.   def self.delete_exdata
  83.     return unless exist?
  84.     File.delete(filename) rescue nil
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● ファイルの有無チェック
  88.   #--------------------------------------------------------------------------
  89.   def self.exist?
  90.     FileTest.exist?(filename)
  91.   end
  92. end
  93.  
  94.  
  95. #==============================================================================
  96. # ■ DataManager
  97. #==============================================================================
  98. class << DataManager
  99.   #--------------------------------------------------------------------------
  100.   # ● 各種ゲームオブジェクトの作成
  101.   #--------------------------------------------------------------------------
  102.   alias create_game_objects_exgrly create_game_objects
  103.   def create_game_objects
  104.     create_game_objects_exgrly
  105.     load_garally
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● セーブの実行
  109.   #--------------------------------------------------------------------------
  110.   alias save_game_exgarally save_game
  111.   def save_game(index)
  112.     r = save_game_exgarally(index)
  113.     save_garally if r
  114.     r
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● ロードの実行
  118.   #--------------------------------------------------------------------------
  119.   alias load_game_exgrly load_game
  120.   def load_game(index)
  121.     r = load_game_exgrly(index)
  122.     load_garally if r
  123.     r
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● ギャラリー情報load
  127.   #--------------------------------------------------------------------------
  128.   def load_garally
  129.     @exgarally = ExGarally.load_exdata
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● ギャラリー情報load
  133.   #--------------------------------------------------------------------------
  134.   def save_garally
  135.     ExGarally.save_exdata(@exgarally)
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● ギャラリー情報削除
  139.   #--------------------------------------------------------------------------
  140.   def delete_garally
  141.     ExGarally.delete_exdata
  142.     load_garally
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● ギャラリー情報参照
  146.   #--------------------------------------------------------------------------
  147.   def garally
  148.     @exgarally
  149.   end
  150. end
  151.  
  152.  
  153. #==============================================================================
  154. # ■ Game_ExGarally
  155. #==============================================================================
  156. class Game_ExGarally
  157.   attr_accessor :name   # ファイル名
  158.   attr_accessor :text   # 表示文字
  159.   attr_accessor :enable # 表示可否
  160.   #--------------------------------------------------------------------------
  161.   # ● オブジェクト初期化
  162.   #--------------------------------------------------------------------------
  163.   def initialize(file, enable=false)
  164.     @name   = file.name
  165.     @text   = file.text
  166.     @enable = enable
  167.   end
  168. end
  169.  
  170. #==============================================================================
  171. # ■ Game_ExGarallyList  : DataManager.garallyで参照可能
  172. #==============================================================================
  173. class Game_ExGarallyList
  174.   LIST = ExGarally::LIST
  175.   attr_accessor :enable
  176.   attr_reader   :size
  177.   #--------------------------------------------------------------------------
  178.   # ● オブジェクト初期化
  179.   #--------------------------------------------------------------------------
  180.   def initialize
  181.     clear
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● クリア
  185.   #--------------------------------------------------------------------------
  186.   def clear
  187.     @size = LIST.size
  188.     @data = {}
  189.     @enable = false
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● 参照
  193.   #--------------------------------------------------------------------------
  194.   def [](id)
  195.     return nil if LIST[id].nil? and @data[id].nil?
  196.     return Game_ExGarally.new(LIST[id]) if @data[id].nil?
  197.     @data[id]
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● 表示許可/禁止
  201.   #--------------------------------------------------------------------------
  202.   def []=(id, val)
  203.     return nil if LIST[id].nil? and @data[id].nil?
  204.     if val
  205.       @data[id] = Game_ExGarally.new(LIST[id]) if @data[id].nil?
  206.       @data[id].enable = true
  207.     elsif !@data[id].nil?
  208.       @data.delete(id)
  209.     end
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● リスト
  213.   #--------------------------------------------------------------------------
  214.   def list
  215.     (@data.keys+LIST.keys).uniq.sort.collect {|id| self.[](id) }
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ● 追加ギャラリー
  219.   #--------------------------------------------------------------------------
  220.   def push(id, name, enable=true)
  221.     @data[id] = Game_ExGarally.new(name, enable)
  222.     @size += 1 if LIST[id].nil?
  223.   end
  224. end
  225.  
  226.  
  227. #==============================================================================
  228. # ■ Sprite_ExGrlyPicture
  229. #==============================================================================
  230. class Sprite_ExGrlyPicture < Sprite
  231.   #--------------------------------------------------------------------------
  232.   # ● オブジェクト初期化
  233.   #--------------------------------------------------------------------------
  234.   def initialize(rect=Rect.new(0,0,Graphics.width,Graphics.height))
  235.     super(Viewport.new(rect))
  236.     viewport.z = 100
  237.     create_bitmap
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● オブジェクト解放
  241.   #--------------------------------------------------------------------------
  242.   def dispose
  243.     dispose_bitmap
  244.     super
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● ビットマップ生成
  248.   #--------------------------------------------------------------------------
  249.   def create_bitmap
  250.     self.bitmap = Bitmap.new(vw, vh)
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● ビットマップ下方
  254.   #--------------------------------------------------------------------------
  255.   def dispose_bitmap
  256.     self.bitmap.dispose
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● ピクチャ設定
  260.   #--------------------------------------------------------------------------
  261.   def picture(filename, enabled=true)
  262.     dispose_bitmap
  263.     if enabled
  264.       self.bitmap = Cache.picture(filename)
  265.     else
  266.       create_bitmap
  267.       self.bitmap.fill_rect(0,0,vw,vh,Color.new(0,0,0,160))
  268. #      self.bitmap.draw_text(0,0, vw, vh, filename, 1)
  269.     end
  270.     fit_screen
  271.     resize
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● ズーム倍率再設定
  275.   #--------------------------------------------------------------------------
  276.   def resize(r=Rect.new(0,0,vw,vh))
  277.     self.ox = bitmap.width  / 2
  278.     self.oy = bitmap.height / 2
  279.     self.x = r.width  / 2 + r.x
  280.     self.y = r.height / 2 + r.y
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 画面にフィットさせる
  284.   #--------------------------------------------------------------------------
  285.   def bwz;  (bitmap.width * zoom_x).truncate; end # ズーム後のbitmap幅
  286.   def bhz;  (bitmap.height* zoom_y).truncate; end # ズーム後のbitmap高さ
  287.   def vw;   viewport.rect.width;   end
  288.   def vh;   viewport.rect.height;  end
  289.   def fit_screen(w=vw, h=vh)
  290.     x_zoom = w * 1.0 / bitmap.width
  291.     y_zoom = h * 1.0 / bitmap.height
  292.     zoom = x_zoom < y_zoom ? x_zoom : y_zoom
  293.     self.zoom_x = self.zoom_y = zoom
  294.   end
  295. end
  296.  
  297.  
  298. #==============================================================================
  299. # ■ Sprite_ExGrlyPicture
  300. #==============================================================================
  301. class Sprite_ExGrlyPictFull < Sprite_ExGrlyPicture
  302.   #--------------------------------------------------------------------------
  303.   # ● オブジェクト初期化
  304.   #--------------------------------------------------------------------------
  305.   def initialize
  306.     super
  307.     hide.viewport.z = 200
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● ウィンドウの表示
  311.   #--------------------------------------------------------------------------
  312.   def show
  313.     self.visible = true
  314.     self
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # ● ウィンドウの非表示
  318.   #--------------------------------------------------------------------------
  319.   def hide
  320.     self.visible = false
  321.     self
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● ピクチャ設定
  325.   #--------------------------------------------------------------------------
  326.   def picture(filename, enabled=true)
  327.     dispose_bitmap
  328.     b = Cache.picture(filename)
  329.     r = Rect.new(0, 0, b.width, b.height)
  330.     self.bitmap = Bitmap.new(r.width, r.height)
  331.     self.bitmap.stretch_blt(r, b, r)
  332.     fit_screen
  333.     resize
  334.   end
  335. end
  336.  
  337. #==============================================================================
  338. # ■ Grly_Thumbnail
  339. #==============================================================================
  340. class Grly_Thumbnail
  341.   attr_reader :item
  342.   attr_reader :rect
  343.   #--------------------------------------------------------------------------
  344.   # ● オブジェクト初期化
  345.   #--------------------------------------------------------------------------
  346.   def initialize(item, rect)
  347.     @item = item; @rect = rect
  348.   end
  349. end
  350.  
  351. #==============================================================================
  352. # ■ SpritesetExGrlyPictures
  353. #==============================================================================
  354. class SpritesetExGrlyPictures
  355.   #--------------------------------------------------------------------------
  356.   # ● オブジェクト初期化
  357.   #--------------------------------------------------------------------------
  358.   def initialize
  359.     @sprites = []
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ● オブジェクト解放
  363.   #--------------------------------------------------------------------------
  364.   def dispose
  365.     dispose_sprites
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ● ピクチャスプライト生成
  369.   #--------------------------------------------------------------------------
  370.   def create_sprites(thumnails)
  371.     thumnails.each do |thm|
  372.       s = Sprite_ExGrlyPicture.new(thm.rect)
  373.       s.picture(thm.item.name, thm.item.enable)
  374.       @sprites.push(s)
  375.     end
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● ピクチャスプライト解放
  379.   #--------------------------------------------------------------------------
  380.   def dispose_sprites
  381.     @sprites.each { |s| s.dispose }
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● ピクチャスプライト更新
  385.   #--------------------------------------------------------------------------
  386.   def update_sprites(thumnails)
  387.     dispose_sprites
  388.     create_sprites(thumnails)
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● サムネイル矩形
  392.   #--------------------------------------------------------------------------
  393.   def thm_rect(i)
  394.     @sprites[i].nil? ? nil : @sprites[i].thm
  395.   end
  396. end
  397.  
  398.  
  399. #==============================================================================
  400. # ■ Window_GrlyPicture
  401. #==============================================================================
  402. class Window_GrlyPicture < Window_Selectable
  403.   attr_accessor :thum_sprites
  404.   #--------------------------------------------------------------------------
  405.   # ● オブジェクト初期化
  406.   #--------------------------------------------------------------------------
  407.   def initialize
  408.     @thum_sprites = nil
  409.     make_list
  410.     super(0, help_height, Graphics.width, Graphics.height-help_height)
  411.     activate
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● ヘルプウィンドウの高さ
  415.   #--------------------------------------------------------------------------
  416.   def help_height
  417.     fitting_height(ExGarally::HELP_LINES)
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● 桁数の取得
  421.   #--------------------------------------------------------------------------
  422.   def col_max
  423.     return 3
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● 横に項目が並ぶときの空白の幅を取得
  427.   #--------------------------------------------------------------------------
  428.   def spacing
  429.     return 16
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 項目数の取得
  433.   #--------------------------------------------------------------------------
  434.   def item_max
  435.     DataManager.garally.size
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● 項目の高さを取得
  439.   #--------------------------------------------------------------------------
  440.   def item_height
  441.     (Graphics.height - help_height - standard_padding * 2) / 2
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● 項目を描画する矩形の取得
  445.   #--------------------------------------------------------------------------
  446.   def item_rect(index)
  447.     rect = super(index)
  448.     thm  = calc_thm_rect
  449.     rect.x += (rect.width  - (thm.width  + 8)) / 2
  450.     rect.y += (rect.height - (thm.height + 8)) / 2
  451.     rect.width  = thm.width  + 8
  452.     rect.height = thm.height + 8
  453.     rect
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● サムネイル矩形計算
  457.   #--------------------------------------------------------------------------
  458.   def calc_thm_rect
  459.     r = Rect.new
  460.     r.width  = item_width  - 8
  461.     r.height = item_height - 8
  462.     if (Graphics.width  / r.width) > (Graphics.height / r.height)
  463.       r.height = r.width  * Graphics.height / Graphics.width
  464.     else
  465.       r.width  = r.height * Graphics.width  / Graphics.height
  466.     end
  467.     r
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● サムネイルの表示位置を取得
  471.   #--------------------------------------------------------------------------
  472.   def thum_rect(index)
  473.     r = item_rect_for_text(index)
  474.     r.x += self.x + standard_padding
  475.     r.y += self.y + standard_padding
  476.     r
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 先頭行のindex
  480.   #--------------------------------------------------------------------------
  481.   def top_i
  482.     (top_row * col_max)
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ● 先頭行からの@index
  486.   #--------------------------------------------------------------------------
  487.   def top_cur_i
  488.     (@index - (top_row * col_max))
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ● サムネイルの表示位置を取得
  492.   #--------------------------------------------------------------------------
  493.   def thumnails
  494.     n = [page_item_max, item_max - top_i].min
  495.     idxs = []
  496.     n.times { |i| idxs.push(i) }
  497.     idxs.collect { |i| Grly_Thumbnail.new(@list[i+top_i], thum_rect(i)) }
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● リスト生成
  501.   #--------------------------------------------------------------------------
  502.   def make_list
  503.     @list = DataManager.garally.list
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # ● 選択中アイテム
  507.   #--------------------------------------------------------------------------
  508.   def item
  509.     @list[@index]
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ● 選択項目の有効状態を取得
  513.   #--------------------------------------------------------------------------
  514.   def current_item_enabled?
  515.     !item.nil? and item.enable
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● ヘルプテキスト更新
  519.   #--------------------------------------------------------------------------
  520.   def update_help
  521.     text = ((!item.nil? and item.enable) ? item.text : "")
  522.     @help_window.set_text(text)
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # ● カーソルの更新
  526.   #--------------------------------------------------------------------------
  527.   def update_cursor
  528.     super
  529.     @thum_sprites.update_sprites(thumnails) unless @thum_sprites.nil?
  530.   end
  531. end
  532.  
  533.  
  534.  
  535. #==============================================================================
  536. # ■ Scene_ExGarally
  537. #==============================================================================
  538. class Scene_ExGarally < Scene_Base
  539.   #--------------------------------------------------------------------------
  540.   # ● 開始処理
  541.   #--------------------------------------------------------------------------
  542.   def start
  543.     super
  544.     create_background
  545.     @help_window = Window_Help.new(ExGarally::HELP_LINES)
  546.     @thumset = SpritesetExGrlyPictures.new
  547.     @full_pict = Sprite_ExGrlyPictFull.new
  548.     create_list_window
  549.   end
  550.   #--------------------------------------------------------------------------
  551.   # ● 終了処理
  552.   #--------------------------------------------------------------------------
  553.   def terminate
  554.     super
  555.     dispose_background
  556.     @thumset.dispose
  557.     @full_pict.dispose
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● 背景の作成
  561.   #--------------------------------------------------------------------------
  562.   def create_background
  563.     @background_sprite = Sprite.new
  564.     @background_sprite.bitmap = SceneManager.background_bitmap
  565.     @background_sprite.color.set(16, 16, 16, 128)
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● 背景の解放
  569.   #--------------------------------------------------------------------------
  570.   def dispose_background
  571.     @background_sprite.dispose
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ● ピクチャリストウィンドウ生成
  575.   #--------------------------------------------------------------------------
  576.   def create_list_window
  577.     @list_window = Window_GrlyPicture.new
  578.     @list_window.thum_sprites = @thumset
  579.     @list_window.help_window = @help_window
  580.     set_full_handler
  581.     @list_window.select(0)
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # ● フルスクリーン化用のハンドラ登録
  585.   #--------------------------------------------------------------------------
  586.   def set_full_handler
  587.     @list_window.set_handler(:ok,     method(:cmd_full))
  588.     @list_window.set_handler(:cancel, method(:return_scene))
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ● サムネイルリスト用のハンドラ登録
  592.   #--------------------------------------------------------------------------
  593.   def set_thum_handler
  594.     @list_window.set_handler(:ok,     method(:cmd_thum))
  595.     @list_window.set_handler(:cancel, method(:cmd_thum))
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # ● フルスクリーン化
  599.   #--------------------------------------------------------------------------
  600.   def cmd_full
  601.     Graphics.freeze
  602.     @full_pict.show.picture(@list_window.item.name)
  603.     perform_transition
  604.     set_thum_handler
  605.     @list_window.activate.cursor_fix = true
  606.   end
  607.   #--------------------------------------------------------------------------
  608.   # ● サムネイル化
  609.   #--------------------------------------------------------------------------
  610.   def cmd_thum
  611.     Graphics.freeze
  612.     @full_pict.hide
  613.     perform_transition
  614.     set_full_handler
  615.     @list_window.activate.cursor_fix = false
  616.   end
  617. end
  618.  
  619.  
  620.  
  621.  
  622.  
  623. #module Title
  624.   # 拡張コマンドへ追加
  625.   #EXCMD[3] = ["画廊", Scene_ExGarally, :garally]
  626.  
  627.   # コマンド画像ファイル(Graphics/System)
  628.   # CMD_GRPHIC[コマンド番号] [画像1, 画像2]
  629.   #CMD_GRPHIC[3] = ["garally",  "garally_s"]
  630. #end
  631.  
  632. #==============================================================================
  633. # ■ Scene_ExGarally
  634. #==============================================================================
  635. class Scene_ExGarally < Scene_Base
  636.   #--------------------------------------------------------------------------
  637.   # ● 呼び出し元のシーンへ戻る
  638.   #--------------------------------------------------------------------------
  639.   def return_scene
  640.     super
  641.     return unless SceneManager.scene_is?(Scene_Title)
  642.     SceneManager.scene.prepare(Title::Scene::S_TITLE, false,
  643.                                Title::CMD_BOX.index(4))
  644.   end
  645. end
  646.  
  647.  
  648. #==============================================================================
  649. # ■ Scene_Title
  650. #==============================================================================
  651. class Scene_Title < Scene_Base
  652.   #--------------------------------------------------------------------------
  653.   # ● メイン
  654.   #--------------------------------------------------------------------------
  655.   alias main_reload main
  656.   def main
  657.     DataManager.load_garally # ギャラリーのリロード
  658.     main_reload
  659.   end
  660. end

点评

这个是脚本冲突的问题..不看到脚本的话我也不确定能够解决.  发表于 2013-3-23 18:39
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
2
发表于 2013-3-25 10:49:22 | 显示全部楼层
Sion 发表于 2013-3-23 22:41
8方移动补丁,不需要原来那个了,自己写了个。

发生冲突的脚本我补在28L了,麻烦抽空帮我看看是什么问题吧。多谢了!

点评

这个“画廊”脚本要怎么使用呢?  发表于 2013-3-25 14:29
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
3
发表于 2013-3-25 18:37:10 | 显示全部楼层
tyq4590 发表于 2013-3-25 14:49
发生冲突的脚本我补在28L了,麻烦抽空帮我看看是什么问题吧。多谢了!

1.Graphics\Pictures\里放入和‘module ExGarally’下设定的文件名相同的图片(放一张就可以测试了),比如:
  1  => GFile.new("BlueSky", "123"), 然后在Graphics\Pictures\放一个叫"BlueSky"的图片

2.在事件里添加脚本:DataManager.garally[1] = true 来解锁画廊里的1号图片

3.在事件里添加脚本:SceneManager.call(Scene_ExGarally)来打开画廊(这个时候应该可以看到第一张图片"BlueSky"了,然后用鼠标点该图片会打开大图,就是这个时候会报错跳出)

点评

万分感谢!  发表于 2013-3-28 11:21
附件更新,可以了  发表于 2013-3-26 19:36
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
4
发表于 2013-3-27 11:06:15 | 显示全部楼层
tyq4590 发表于 2013-3-25 22:37
1.Graphics\Pictures\里放入和‘module ExGarally’下设定的文件名相同的图片(放一张就可以测试了),比 ...

多谢LZ花时间帮我研究画廊脚本冲突的问题!我刚刚下了1.3f并且在一个纯净的新建工程上测试了一下,结果还是会在画廊脚本报错跳出(提示的问题和之前一模一样,还是‘cursor_fix’)。我试了把全鼠标放在画廊上面,也试着放在画廊下面,不过运行起来没有任何区别。不知道是否是我还有哪里操作有问题?

点评

附件放错了,这次应该可以了  发表于 2013-3-27 11:53
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
5
发表于 2013-4-6 19:26:16 | 显示全部楼层
辛苦了!不知道鼠标操作的那个8方行走补丁是否可以考虑支持8方行走图?就是普遍使用的行走图+“_8D”来显示8方向的那个功能?

这个是铅笔写的键盘操作的8D行走图脚本,希望Sion可以参考一下:

RUBY 代码复制
  1. #===============================================================================
  2. #  八方向行走
  3. #    by:铅笔描绘的思念
  4. #    在Characters里添加八方向行走图(命名规范:在四方向上的基础上+_8D)
  5. #    行走动画就为8方向的。否则就会原4方向的代替8方向的。
  6. #
  7. #    八方向:数字键盘方向对应的数字
  8. #     7   8   9
  9. #      ↖ ↑ ↗
  10. #     4← 0 →6
  11. #      ↙ ↓ ↘
  12. #     1   2   3
  13. #===============================================================================
  14. #==============================================================================
  15. # ■ Game_Player
  16. #==============================================================================
  17. class Game_Player < Game_Character
  18.   #--------------------------------------------------------------------------
  19.   # ● 八方向移动
  20.   #    d    :1、3、7、9 对应小键盘的四个方向
  21.   #--------------------------------------------------------------------------
  22.   def move_eight_dir(d)
  23.     move_diagonal(d + 3,2) if d == 1 || d == 3
  24.     move_diagonal(d - 3,8) if d == 7 || d == 9
  25.   end
  26.   #--------------------------------------------------------------------------
  27.   # ● 八方向按键
  28.   #--------------------------------------------------------------------------
  29.   def move_by_input
  30.     return if !movable? || $game_map.interpreter.running?
  31.     case Input.dir8
  32.      when 1,3,7,9;  move_eight_dir(Input.dir8)
  33.      when 2,4,6,8;  move_straight(Input.dir4)
  34.     end
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 斜向移动
  38.   #     horz : 横向(4 or 6)
  39.   #     vert : 纵向(2 or 8)
  40.   #--------------------------------------------------------------------------
  41.   def move_diagonal(horz, vert)
  42.     @followers.move if diagonal_passable?(@x, @y, horz, vert)
  43.     @move_succeed = diagonal_passable?(x, y, horz, vert)
  44.     last_steps = $game_party.steps
  45.     if @move_succeed
  46.       @x = $game_map.round_x_with_direction(@x, horz)
  47.       @y = $game_map.round_y_with_direction(@y, vert)
  48.       @real_x = $game_map.x_with_direction(@x, reverse_dir(horz))
  49.       @real_y = $game_map.y_with_direction(@y, reverse_dir(vert))
  50.       increase_steps
  51.       # 八方向移动正确步数计算
  52.       if $game_party.steps - last_steps == 2
  53.         $game_party.decrease_steps
  54.       end
  55.     end
  56.     set_direction(2) if horz == 4 && vert == 2
  57.     set_direction(4) if horz == 4 && vert == 8
  58.     set_direction(6) if horz == 6 && vert == 2
  59.     set_direction(8) if horz == 6 && vert == 8
  60.   end
  61. end
  62. #==============================================================================
  63. # ■ Game_Party
  64. #==============================================================================
  65. class Game_Party < Game_Unit
  66.   def decrease_steps
  67.     @steps -= 1
  68.   end
  69. end
  70. #==============================================================================
  71. # ■ Sprite_Character
  72. #==============================================================================
  73. class Sprite_Character < Sprite_Base
  74.   #--------------------------------------------------------------------------
  75.   # ● 更新源位图(Source Bitmap)
  76.   #--------------------------------------------------------------------------
  77.   alias update_bitmap_8dir update_bitmap
  78.   def update_bitmap
  79.     update_bitmap_8dir
  80.     if @tile_id > 0            
  81.       @enable_slant = false
  82.       return
  83.     end
  84.     unless graphic_changed?
  85.      @enable_slant = true
  86.    end
  87.  
  88.     begin
  89.       @character_name_slant = "#{@character_name}_8D"
  90.       Cache.character(@character_name_slant)  
  91.     rescue
  92.       @enable_slant = false
  93.     end
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 更新源矩形
  97.   #--------------------------------------------------------------------------
  98.   alias update_src_rect_8dir update_src_rect  
  99.   def update_src_rect
  100.     return if @tile_id > 0      
  101.     if @enable_slant && @character != $game_map.events
  102.       update_src_rect_for_slant
  103.     else
  104.       update_src_rect_8dir
  105.     end
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● 更新斜方向传送矩形
  109.   #--------------------------------------------------------------------------
  110.   def update_src_rect_for_slant
  111.     index = @character.character_index
  112.     pattern = @character.pattern < 3 ? @character.pattern : 1
  113.     sx = (index % 4 * 3 + pattern) * @cw
  114.     case Input.dir8 % 2
  115.     when 0  # 上下左右
  116.       if @last_slant
  117.         self.bitmap = Cache.character(@character_name)
  118.         @last_slant = false
  119.       end
  120.     else   
  121.       unless @last_slant
  122.         self.bitmap = Cache.character(@character_name_slant)
  123.         @last_slant = true
  124.       end
  125.     end
  126.       sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
  127.     self.src_rect.set(sx, sy, @cw, @ch)
  128.   end
  129. end

点评

之前没看到这楼- -b  发表于 2013-4-12 14:18
这个脚本里面,把def move_by_input 到下一个 end 还有它们之间的内容都删掉就可以了。  发表于 2013-4-12 14:17
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-6 08:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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