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

Project1

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

[已经解决] 游戏加密后脚本无法保存壁纸的Bug。

[复制链接]

Lv4.逐梦者

梦石
0
星屑
8498
在线时间
775 小时
注册时间
2017-11-10
帖子
1231
跳转到指定楼层
1
发表于 2018-1-28 23:22:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这是老前辈们喜欢用的CG壁纸功能。
RUBY 代码复制
  1. #==============================================================================
  2. #作者 :Moghunter
  3. #脚本提供 :笵妮拉·亚修 (6R ID)
  4. #功能增强 :萧叶藏刀 (6R ID)
  5. #修改 : リデル  (百度 ID)(6R ID) 美丽晨露 (6R ID)
  6. #==============================================================================
  7. #使用方法:
  8. #$gallery[ID] = true
  9. #sav = Scene_Picture_Gallery.new
  10. #sav.save
  11. #储存文件在12,13,21行修改
  12. if FileTest.exist?("gallery.rxdata")
  13.   file = File.open("gallery.rxdata", "rb")
  14.   $gallery = Marshal.load(file)
  15.   file.close
  16. else
  17.   $gallery = []
  18. end
  19. class Scene_Picture_Gallery
  20.   def save
  21.     file = File.open("gallery.rxdata", "wb")
  22.     Marshal.dump($gallery, file)
  23.     file.close
  24.   end
  25. end
  26. #==============================================================================
  27. # +++ MOG XP - Picture Gallery (v1.0) +++
  28. #==============================================================================
  29. # By Moghunter
  30. # [url]http://www.atelier-rgss.com/[/url]
  31. #==============================================================================
  32. # Sistema de galeria de imagens.
  33. #==============================================================================
  34. # Para ativar o script use o comando abaixo através de um evento usando o
  35. # comando chamar script. (Call Script)
  36. #
  37. # $scene = Scene_Picture_Gallery.new
  38. #
  39. #==============================================================================
  40. # Para disponibilizar as imagens na galeria você deverá usar o seguinte
  41. # código através do comando chamar script.
  42. #
  43. # $game_system.gallery[ID] = true
  44. #
  45. # EX   $game_system.gallery[10] = true
  46. #
  47. #==============================================================================
  48. # Você deverá criar uma pasta com o nome "Gallery" onde as imagens deverão
  49. # ser gravadas.
  50. #
  51. # Graphics/Gallery/
  52. #
  53. # A nomeação das imagens devem ser numéricas. (ID da imagem)
  54. # 0.jpg    (Imagem não disponível.)
  55. # 1.jpg
  56. # 2.jpg
  57. # 3.jpg
  58. # ...
  59. #
  60. # Prefira usar imagens com resoluções igual ou maior a 640x480 pixels.
  61. #
  62. #==============================================================================
  63. module MOG_PICTURE_GALLERY
  64.        #Quantidade maxima de imagens na galeria.
  65.        MAX_PICTURES = 25
  66. end  
  67.  
  68. #==============================================================================
  69. # ■ Game_System
  70. #==============================================================================
  71. class Game_System
  72.  
  73. attr_accessor :gallery
  74.  
  75. #------------------------------------------------------------------------------
  76. # ● Initialize
  77. #------------------------------------------------------------------------------   
  78. alias art_picture_initialize initialize
  79. def initialize
  80.       art_picture_initialize
  81.       @gallery = []
  82. end  
  83. end
  84.  
  85. #==============================================================================
  86. # ■ RPG
  87. #==============================================================================
  88. module RPG
  89.   module Cache
  90.     def self.gallery(filename)
  91.         self.load_bitmap("Graphics/Gallery/", filename)
  92.     end
  93.   end
  94. end
  95. #==============================================================================
  96. # ■ Window_Base
  97. #==============================================================================
  98. class Window_Base < Window
  99.   #--------------------------------------------------------------------------
  100.   # Draw_Thumbnail
  101.   #--------------------------------------------------------------------------  
  102.   def draw_thumbnail(x,y,id)
  103.       image = RPG::Cache.gallery(id.to_s) rescue nil
  104.       return if image == nil
  105.       cw = image.width
  106.       ch = image.height
  107.       src_rect = Rect.new(0, 0, cw , ch)
  108.       src_rect2 = Rect.new(x, y, 150, 80)  
  109.       self.contents.stretch_blt(src_rect2, image, src_rect)
  110.   end
  111. end  
  112.  
  113. #==============================================================================
  114. # ■ Window_Picture
  115. #==============================================================================
  116. class Window_Picture < Window_Selectable
  117.  
  118. #------------------------------------------------------------------------------
  119. # ● Initialize
  120. #------------------------------------------------------------------------------   
  121.   def initialize(page)
  122.       super(0, 64, 640, 365)
  123.       self.opacity = 0
  124.       @column_max = 3
  125.       @page = page
  126.       @pic_max = MOG_PICTURE_GALLERY::MAX_PICTURES
  127.       @pic_max = 1 if @pic_max <= 0
  128.       @pag_max = @pic_max / 9
  129.       if @pag_max == page
  130.          o = @pag_max * 9
  131.          o2 =  @pic_max - o
  132.          @item_max = o2
  133.       else
  134.          @item_max = 9
  135.        end  
  136.       refresh(page)
  137.       self.index = 0
  138.  
  139.   end
  140.  
  141. #------------------------------------------------------------------------------
  142. # ● Refresh
  143. #------------------------------------------------------------------------------   
  144.   def refresh(page = 0)
  145.       if self.contents != nil
  146.          self.contents.dispose
  147.          self.contents = nil
  148.       end
  149.       if @item_max > 0
  150.          self.contents = Bitmap.new(width - 32, row_max * 110)
  151.          for i in 0...@item_max
  152.             draw_item(i,page)
  153.          end
  154.       end
  155.   end
  156.  
  157. #------------------------------------------------------------------------------
  158. # ● draw_item
  159. #------------------------------------------------------------------------------   
  160.   def draw_item(index,page)
  161.       np = 9 * page
  162.       picture_number = index + 1 + np
  163.       x = 15 + index % 3 * 215
  164.       y = 12 + index / 3 *110
  165.       s = picture_number
  166.       s = 0 if $gallery[picture_number] == nil
  167.       draw_thumbnail(x,y,s)
  168.       self.contents.draw_text(x + 45,y + 70, 64, 32, "图片 - " + picture_number.to_s,1)
  169.   end
  170.  
  171. #------------------------------------------------------------------------------
  172. # ● update_cursor_rect
  173. #------------------------------------------------------------------------------   
  174.   def update_cursor_rect
  175.       if @index < 0
  176.          self.cursor_rect.empty
  177.          return
  178.       end
  179.       row = @index / @column_max
  180.       if row < self.top_row
  181.          self.top_row = row
  182.       end
  183.       if row > self.top_row + (self.page_row_max - 1)
  184.          self.top_row = row - (self.page_row_max - 1)
  185.       end
  186.       cursor_width = self.width / @column_max - 32
  187.       x = index % 3 * 215
  188.       y = index / 3 *110
  189.       self.cursor_rect.set(x, y, cursor_width, 105)
  190.   end   
  191. end
  192. #-----------------------------------------------------------------------------
  193. #   DLL(修改)这个我不知道有没有更简单的
  194. #-----------------------------------------------------------------------------
  195. $copyfile = Win32API.new("kernel32","CopyFile","ppl","l")
  196. #-----------------------------------------------------------------------------
  197.  
  198. #==============================================================================
  199. # ■ Scene_ArtPictures
  200. #==============================================================================
  201. class Scene_Picture_Gallery
  202. include MOG_PICTURE_GALLERY
  203.  
  204. #------------------------------------------------------------------------------
  205. # ● Main
  206. #------------------------------------------------------------------------------     
  207. def main
  208.      setup
  209.      create_background
  210.      create_window
  211.      create_image
  212.      create_cursor
  213.      create_button
  214.      #修改#
  215.      @command_window = Window_Command.new(160, ["   保存壁纸","     取消"])
  216.      @command_window.back_opacity = 160
  217.      @command_window.x = 480
  218.      @command_window.y = 384
  219.      @command_window.active = false
  220.      @command_window.visible  = false
  221.      #####
  222.      execute_loop
  223.      execute_dispose
  224. end
  225.  
  226. #------------------------------------------------------------------------------
  227. # ● Setup
  228. #------------------------------------------------------------------------------      
  229. def setup
  230.      @max_pictures = MAX_PICTURES
  231.      @max_pictures = 1 if @max_pictures <= 0
  232.      v = (@max_pictures / 9)
  233.      v2 = (v - 1) * 9
  234.      v3 = (@max_pictures - v2) - 9
  235.      if v3 != 0
  236.         @max_pages = (@max_pictures / 9) + 1
  237.      else
  238.         @max_pages = (@max_pictures / 9)
  239.      end  
  240.      @max_pages = 1 if @max_pages == 0
  241.      @aw_center = 0
  242.      @aw_left = 0
  243.      @aw_right = 0
  244.      @slide_type = 0
  245.      @page_old = 0
  246.      @picture_id = 0
  247.      @image_active = false
  248.      @old_index = 0
  249.      @picures_enabled = 0
  250.      @comp = 0
  251.      @ex = 0
  252.      @ey = 0
  253.      @ex_max = 0
  254.      @ey_max = 0
  255.      @ex_max_zoom = 0
  256.      @ey_max_zoom = 0
  257.      for i in 0..MAX_PICTURES
  258.          @picures_enabled += 1 if $gallery[i]
  259.      end  
  260. end  
  261.  
  262. #------------------------------------------------------------------------------
  263. # ● create_background
  264. #------------------------------------------------------------------------------        
  265. def create_background
  266.      @background = Sprite.new
  267.      @background.bitmap = RPG::Cache.gallery("Background")  
  268.      @background.z = 0
  269.      @background2 = Plane.new
  270.      @background2.bitmap = RPG::Cache.gallery("Background2")      
  271.      @background2.z = -1
  272. end
  273.  
  274. #------------------------------------------------------------------------------
  275. # ● Create Window
  276. #------------------------------------------------------------------------------      
  277. def create_window
  278.      @info = Window_Help.new
  279.      @info.y = 416
  280.      @info.opacity = 0
  281.      @wp_page = 0
  282.      @wp_page_old = @wp_page
  283.      @wp_index = 0
  284.      @wp =[]
  285.      for i in 0...@max_pages
  286.          @wp[i] = Window_Picture.new(i)
  287.          @wp[i].x = 32 * i
  288.      end  
  289.      check_active_window(true)
  290.      refresh_info_window(true)
  291. end
  292.  
  293. #------------------------------------------------------------------------------
  294. # ● Create_image
  295. #------------------------------------------------------------------------------        
  296. def create_image
  297.      @picture = Sprite.new
  298.      @picture.bitmap = RPG::Cache.gallery("")
  299.      @picture.z = 100
  300.      @picture.opacity = 0
  301. end
  302.  
  303. #------------------------------------------------------------------------------
  304. # ● Check Active Window
  305. #------------------------------------------------------------------------------      
  306. def check_active_window(starting = false)
  307.      for i in 0...@max_pages
  308.         if i == @wp_page
  309.             @wp[@wp_page].active = true
  310.             @wp[@wp_page].visible = true
  311.             if @slide_type == 0   
  312.                @wp[@wp_page].x = 640
  313.             else
  314.                @wp[@wp_page].x = -640
  315.             end   
  316.          elsif i == @page_old  and starting == false
  317.             @wp[@page_old].active = false
  318.             @wp[@page_old].visible = true
  319.             @wp[@page_old].visible = false if starting
  320.             @wp[@page_old].x = 0     
  321.          else   
  322.             @wp[i].active = false
  323.             @wp[i].visible = false
  324.          end   
  325.      end  
  326. end
  327.  
  328. #------------------------------------------------------------------------------
  329. # ● Create Button
  330. #------------------------------------------------------------------------------      
  331. def create_button
  332.      @button_image = RPG::Cache.gallery("Button")
  333.      @button_bitmap =  Bitmap.new(@button_image.width, @button_image.height)
  334.      @cw = @button_image.width
  335.      @ch = @button_image.height / 2
  336.      src_rect = Rect.new(0, 0, @cw, @ch)
  337.      @button_bitmap .blt(0,0, @button_image, src_rect)           
  338.      @button = Sprite.new
  339.      @button.bitmap = @button_bitmap
  340.      @button.y = 443
  341.      @button.z = 250
  342.      @button.opacity = 0
  343.      @button_fade_time = 0
  344. end
  345.  
  346. #------------------------------------------------------------------------------
  347. # ● Create Cursor
  348. #------------------------------------------------------------------------------      
  349. def create_cursor
  350.      @cx1 = 0
  351.      @cx2 = 0
  352.      @cursor_speed = 0
  353.      image = RPG::Cache.gallery("Cursor")
  354.      @bitmap = Bitmap.new(image.width, image.height)
  355.      cw = image.width / 2
  356.      ch = image.height
  357.      src_rect = Rect.new(cw, 0, cw, ch)
  358.      @bitmap.blt(0,0, image, src_rect)     
  359.      @cursor1 = Sprite.new
  360.      @cursor1.bitmap = @bitmap
  361.      @cursor1.x = 0 + @cx1
  362.      @cursor1.y = 220
  363.      @cursor1.z = 200
  364.      @bitmap2 = Bitmap.new(image.width, image.height)
  365.      src_rect2 = Rect.new(0, 0, cw, ch)
  366.      @bitmap2.blt(0,0, image, src_rect2)         
  367.      @cursor2 = Sprite.new
  368.      @cursor2.bitmap = @bitmap2
  369.      @cursor2.x = 610 + @cx2
  370.      @cursor2.y = 220
  371.      @cursor2.z = 200
  372.      image.dispose
  373.      if @max_pages == 1
  374.         @cursor1.visible = false
  375.         @cursor2.visible = false
  376.      end   
  377. end
  378.  
  379. #------------------------------------------------------------------------------
  380. # ● Execute Loop
  381. #------------------------------------------------------------------------------     
  382. def execute_loop
  383.      Graphics.transition
  384.      loop do
  385.           Graphics.update
  386.           Input.update
  387.           update
  388.           if $scene != self
  389.               break
  390.           end
  391.      end
  392. end
  393.  
  394. #------------------------------------------------------------------------------
  395. # ● Execute Dispose
  396. #------------------------------------------------------------------------------      
  397. def execute_dispose
  398.      Graphics.freeze
  399.      for i in 0...@max_pages
  400.          @wp[i].dispose
  401.      end   
  402.      @info.dispose
  403.      if @picture.bitmap != nil
  404.         @picture.bitmap.dispose
  405.      end
  406.      @picture.dispose
  407.      @background.bitmap.dispose
  408.      @background.dispose
  409.      @background2.bitmap.dispose
  410.      @background2.dispose     
  411.      @bitmap.dispose
  412.      @bitmap2.dispose
  413.      @cursor1.bitmap.dispose
  414.      @cursor1.dispose     
  415.      @cursor2.bitmap.dispose
  416.      @cursor2.dispose
  417.      @button_bitmap.dispose
  418.      @button.bitmap.dispose
  419.      @button.dispose
  420.      @button_image.dispose
  421. end
  422.  
  423. #------------------------------------------------------------------------------
  424. # ● Update
  425. #------------------------------------------------------------------------------      
  426. def update
  427.      @wp[@wp_page].update
  428.      @info.update
  429.   #   if @image_active  
  430.   #      update_command_image
  431.   #   else   
  432.   #      update_command
  433.   #   end   
  434.   #修改#
  435.      if @command_window.visible
  436.       @command_window.update
  437.       if Input.trigger?(Input::C)
  438.         if @command_window.index == 0
  439.         $game_system.se_play($data_system.decision_se)
  440.         $copyfile.call("Graphics/Gallery/#{@picture_id}.png","Gallery/#{@picture_id}.png",1)
  441.         @command_window.active = false
  442.         @command_window.visible = false
  443.         end
  444.         if @command_window.index == 1
  445.         @command_window.active = false
  446.         @command_window.visible = false
  447.         $game_system.se_play($data_system.cancel_se)
  448.         end
  449.       end
  450.       if Input.trigger?(Input::B)
  451.         $game_system.se_play($data_system.cancel_se)
  452.         @command_window.active = false
  453.         @command_window.visible = false
  454.       end        
  455.     elsif @image_active  
  456.         update_command_image
  457.      else   
  458.         update_command
  459.       end
  460.       #####
  461.      update_slide
  462.      update_image_effect
  463.      update_cursor_animation
  464.      refresh_info_window
  465. end  
  466.  
  467. #------------------------------------------------------------------------------
  468. # ● update_cursor_animation
  469. #------------------------------------------------------------------------------        
  470. def update_cursor_animation
  471.      @cursor_speed += 1
  472.      case @cursor_speed
  473.         when 1..20
  474.            @cx1 += 1
  475.            @cx2 -= 1
  476.         when 21..40
  477.            @cx1 -= 1
  478.            @cx2 += 1         
  479.         else  
  480.         @cursor_speed = 0
  481.         @cx1 = 0
  482.         @cx2 = 0
  483.      end
  484.      @cursor1.x = 0 + @cx1
  485.      @cursor2.x = 610 + @cx2
  486. end
  487.  
  488. #------------------------------------------------------------------------------
  489. # ● Update Image Effect
  490. #------------------------------------------------------------------------------      
  491. def update_image_effect
  492.      return if @wp[@wp_page].x != 0
  493.      @button_fade_time -= 1 if @button_fade_time > 0
  494.      if @image_active
  495.         @picture.opacity += 25
  496.         if @button_fade_time != 0
  497.            @button.opacity += 10
  498.         else   
  499.            if @button.y < 640   
  500.               @button.opacity -= 15
  501.               @button.y += 1
  502.            end   
  503.         end  
  504.         @wp[@wp_page].contents_opacity -= 25
  505.         @info.contents_opacity -= 25
  506.         @background.opacity -= 25
  507.         @cursor1.opacity -= 25
  508.         @cursor2.opacity -= 25
  509.      else  
  510.         @picture.opacity -= 10
  511.         @button.opacity -= 25
  512.         @wp[@wp_page].contents_opacity += 25
  513.         @info.contents_opacity += 25
  514.         @background.opacity += 25
  515.         @cursor1.opacity += 25
  516.         @cursor2.opacity += 25        
  517.      end  
  518. end
  519.  
  520. #------------------------------------------------------------------------------
  521. # ● Refresh Info Window
  522. #------------------------------------------------------------------------------      
  523. def refresh_info_window(starting = false)
  524.      return if @image_active
  525.      return if @wp_page_old == @wp_page and starting == false   
  526.      @wp_page_old = @wp_page
  527.      page = @wp_page + 1
  528.      @picture_id = (9 * @wp_page) + @wp[@wp_page].index  + 1
  529.      p_pages = "页数:" + page.to_s + " / " + @max_pages.to_s
  530.      comp  = "    完成率:" + (@picures_enabled.to_f / @max_pictures.to_f * 100).truncate.to_s + " %"
  531.      p_number = "     图片数: " + @picures_enabled.to_s + "  /  " + @max_pictures.to_s
  532.      @info.set_text("            " + p_pages + comp + p_number)
  533. end   
  534.  
  535. #------------------------------------------------------------------------------
  536. # ● Update Slide
  537. #------------------------------------------------------------------------------      
  538. def update_slide
  539.      @background2.ox += 1
  540.      return if @wp[@wp_page].x == 0  
  541.      slide_speed = 35
  542.      @picture.opacity = 0
  543.      @background.opacity = 255
  544.      if @slide_type == 1     
  545.         if @wp[@wp_page].x < 0
  546.            @wp[@wp_page].x += slide_speed
  547.            if @wp[@wp_page].x >= 0
  548.               @wp[@wp_page].x = 0
  549.            end
  550.          end
  551.         if @wp[@page_old].x < 640
  552.            @wp[@page_old].x += slide_speed
  553.            if @wp[@page_old].x >= 640
  554.               @wp[@page_old].x = 640
  555.            end
  556.          end         
  557.        else     
  558.          if @wp[@wp_page].x > 0
  559.             @wp[@wp_page].x -= slide_speed
  560.             if @wp[@wp_page].x <= 0  
  561.                @wp[@wp_page].x = 0
  562.             end   
  563.          end
  564.          if @wp[@page_old].x > -640
  565.             @wp[@page_old].x -= slide_speed
  566.             if @wp[@page_old].x <= -640
  567.                @wp[@page_old].x = -640
  568.             end
  569.          end           
  570.        end
  571.        if @slide_type == 0   
  572.           @wp[@wp_page].x = 0 if @wp[@wp_page].x <= 0  
  573.        else
  574.            @wp[@wp_page].x = 0 if @wp[@wp_page].x >= 0
  575.        end  
  576. end
  577.  
  578. #------------------------------------------------------------------------------
  579. # ● Check_limite
  580. #------------------------------------------------------------------------------        
  581. def check_limit
  582.      if @wp_page < 0
  583.         @wp_page = @max_pages - 1
  584.      elsif @wp_page >= @max_pages   
  585.         @wp_page = 0   
  586.      end
  587.      check_active_window
  588. end  
  589.  
  590. #------------------------------------------------------------------------------
  591. # ● Update Command Image
  592. #------------------------------------------------------------------------------        
  593. def update_command_image
  594.     # if Input.trigger?(Input::B) or Input.trigger?(Input::C)
  595.     #    $game_system.se_play($data_system.cursor_se)
  596.     #    @image_active = false
  597.     #    @wp[@wp_page].active = true
  598.     #    return
  599.     # end
  600.      #修改#
  601.      if Input.trigger?(Input::B)
  602.         $game_system.se_play($data_system.cursor_se)
  603.         @image_active = false
  604.         @wp[@wp_page].active = true
  605.         return
  606.       end
  607.      if Input.trigger?(Input::C)
  608.        $game_system.se_play($data_system.decision_se)
  609.        @command_window.active = true
  610.        @command_window.visible  = true
  611.        return
  612.      end
  613.      #####
  614.      if Input.trigger?(Input::R) or Input.trigger?(Input::L)
  615.         $game_system.se_play($data_system.cursor_se)
  616.         execute_zoom      
  617.      end  
  618.      if Input.press?(Input::RIGHT)
  619.         @ex += 6
  620.      elsif Input.press?(Input::LEFT)
  621.         @ex -= 6
  622.      elsif Input.press?(Input::DOWN)
  623.         @ey += 6
  624.      elsif Input.press?(Input::UP)   
  625.         @ey -= 6
  626.      end  
  627.      @ex = @ex_max + @ex_max_zoom if @ex > @ex_max + @ex_max_zoom
  628.      @ex = 0 if @ex < 0
  629.      @ey = @ey_max + @ey_max_zoom if @ey > @ey_max + @ey_max_zoom
  630.      @ey = 0 if @ey < 0        
  631.      @picture.x = -@ex
  632.      @picture.y = -@ey
  633. end  
  634.  
  635. #------------------------------------------------------------------------------
  636. # ● Execute Zoom
  637. #------------------------------------------------------------------------------         
  638. def execute_zoom
  639.      if @picture.zoom_x == 1.0
  640.         @picture.zoom_x = 1.5
  641.         @picture.zoom_y = 1.5
  642.         refresh_button(1)
  643.         @ex_max_zoom = (@picture.bitmap.width / 2)
  644.         if @ex != @ex_max
  645.            @ex += @ex_max_zoom / 2         
  646.         else   
  647.            if @ex_max != 0   
  648.               @ex += @ex_max_zoom
  649.            else   
  650.               @ex += @ex_max_zoom / 2
  651.            end  
  652.         end  
  653.         @ey_max_zoom = (@picture.bitmap.height / 2)
  654.         if @ey != @ey_max
  655.            @ey += @ey_max_zoom / 2         
  656.         else   
  657.            if @ey_max != 0   
  658.               @ey += @ey_max_zoom
  659.            else   
  660.               @ey += @ey_max_zoom / 2
  661.            end  
  662.          end  
  663.       else
  664.         if @picture.bitmap.width > 640 or
  665.            @picture.bitmap.height > 480
  666.            refresh_button(1)
  667.         else
  668.            refresh_button(0)
  669.         end           
  670.         @ex -= @ex_max_zoom / 2
  671.         @ey -= @ey_max_zoom / 2           
  672.         @picture.zoom_x = 1.0
  673.         @picture.zoom_y = 1.0   
  674.         @ex_max_zoom = 0
  675.         @ey_max_zoom = 0
  676.      end     
  677. end  
  678.  
  679. #------------------------------------------------------------------------------
  680. # ● check_avaliable_picture?
  681. #------------------------------------------------------------------------------        
  682. def check_avaliable_picture?
  683.      @picture_id = (9 * @wp_page) + @wp[@wp_page].index  + 1
  684.      return false if $gallery[@picture_id] == nil
  685.      return true
  686. end  
  687.  
  688. #------------------------------------------------------------------------------
  689. # ● create_bitmap
  690. #------------------------------------------------------------------------------        
  691. def create_bitmap
  692.      @picture.opacity = 0
  693.      @picture.bitmap.dispose
  694.      @picture.bitmap = RPG::Cache.gallery(@picture_id.to_s) rescue nil
  695.      @ex = 0
  696.      @ey = 0
  697.      @ex_max_zoom = 0
  698.      @ey_max_zoom = 0
  699.      @picture.zoom_x = 1.0
  700.      @picture.zoom_y = 1.0      
  701.      if @picture.bitmap == nil
  702.         @picture.bitmap = RPG::Cache.gallery("")
  703.         refresh_button(0)
  704.         return
  705.      end  
  706.      if @picture.bitmap.width > 640
  707.         @ex_max = @picture.bitmap.width - 640
  708.      else
  709.         @ex_max = 0
  710.      end
  711.      if @picture.bitmap.height > 480
  712.         @ey_max = @picture.bitmap.height - 480  
  713.      else
  714.         @ey_max = 0
  715.      end   
  716.      if @picture.bitmap.width > 640 or
  717.         @picture.bitmap.height > 480
  718.         refresh_button(1)
  719.      else
  720.         refresh_button(0)
  721.      end
  722. end  
  723.  
  724. #------------------------------------------------------------------------------
  725. # ● Refresh Button
  726. #------------------------------------------------------------------------------        
  727. def refresh_button(type = 0)
  728.      @button.bitmap.clear
  729.      if type == 0
  730.         src_rect = Rect.new(0, 0, @cw, @ch)
  731.      else
  732.         src_rect = Rect.new(0, @ch, @cw, @ch)
  733.      end  
  734.      @button_bitmap .blt(0,0, @button_image, src_rect)  
  735.      @button.y = 443
  736.      @button_fade_time = 120
  737.      @button.opacity = 0 unless @button.y == 443
  738. end   
  739.  
  740. #------------------------------------------------------------------------------
  741. # ● Update Command
  742. #------------------------------------------------------------------------------      
  743. def update_command
  744.      return if @wp[@wp_page].x != 0
  745.      if Input.trigger?(Input::B)
  746.         $game_system.se_play($data_system.cursor_se)
  747.         save
  748.         $scene = Scene_Title.new
  749.         #$game_system.bgm_play($data_system.title_bgm)
  750.         return
  751.      end
  752.      if Input.trigger?(Input::C)
  753.         if check_avaliable_picture?
  754.            $game_system.se_play($data_system.decision_se)
  755.            @image_active = true
  756.            @wp[@wp_page].active = false
  757.            create_bitmap
  758.         else
  759.           $game_system.se_play($data_system.buzzer_se)
  760.         end
  761.         return
  762.      end  
  763.      if Input.trigger?(Input::L) and @max_pages != 1
  764.         $game_system.se_play($data_system.cursor_se)
  765.         @page_old = @wp_page
  766.         @wp_page -= 1
  767.         @slide_type = 1
  768.         check_limit
  769.         return
  770.      elsif Input.trigger?(Input::R) and @max_pages != 1   
  771.         $game_system.se_play($data_system.cursor_se)
  772.         @page_old = @wp_page
  773.         @wp_page += 1
  774.         @slide_type = 0
  775.         check_limit
  776.         return
  777.      end  
  778. end  
  779. end  
  780.  
  781. $mog_xp_picture_gallery = true

里面有一项保存壁纸的功能。
但是用默认加密功能之后,该功能会失效。
请问这个问题该怎么样解决呢?

附上范例:
壁纸(强化更改).zip (1.15 MB, 下载次数: 50)
一个只会简单事件的Rm新人,脚本完全不懂。只求做个简单的游戏完成自己的游戏之梦而已。
第一个游戏已经完成,等待各素材的完成和测试。

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
41081
在线时间
7566 小时
注册时间
2009-7-6
帖子
13498

开拓者贵宾

2
发表于 2018-1-28 23:32:35 | 只看该作者
用copyfile肯定是不行的,加密之后得从内存里导出图片,下面脚本整合了@SixRC 的bitmap->png简版和楼主的脚本
替换原有的MOG - Picture Gallery脚本页即可

点我打开

评分

参与人数 2星屑 +200 +2 收起 理由
RyanBern + 200 + 1 感谢醋鸡
文雅夕露 + 1 感谢管理员前辈

查看全部评分

RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 14:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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