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

Project1

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

[有事请教] 截图存档卡顿问题(已解决)

[复制链接]

Lv5.捕梦者

梦石
18
星屑
13553
在线时间
1710 小时
注册时间
2017-1-12
帖子
1775

开拓者

跳转到指定楼层
1
发表于 2019-5-30 07:39:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 火锅深处 于 2019-5-30 09:53 编辑

用的是下面这个截图存档,存五个档的话差不多有个一两秒才能载入存档或者读档的画面,大佬们知道怎么解决吗?
===================================================
已自行解决~顺着另外一个截图存档摸到了saveload高速化插件。
http://ytomy.sakura.ne.jp/tkool/ ... ate_file_scene.html

JAVASCRIPT 代码复制
  1. //-----------------------------------------------------------------------------------
  2. //sai_Scenefile.js
  3. //-----------------------------------------------------------------------------------
  4. /*:ja
  5.  * @plugindesc 補助ウインドウを使ったSS付セーブ画面
  6.  *
  7.  * @param bgBitmapFile
  8.  * @desc セーブ/ロード画面背景にするビットマップファイルです。
  9.  * img/pictures に置いてください。
  10.  * @default
  11.  *
  12.  *
  13.  * @param List X
  14.  * @desc セーブファイルリストの位置Xです。
  15.  * @default 100
  16.  *
  17.  * @param List Y
  18.  * @desc セーブファイルリストの位置Yです。
  19.  * @default 120
  20.  *
  21.  * @param List Width
  22.  * @desc セーブファイルリストのウインドウ幅です。
  23.  * @default 280
  24.  *
  25.  * @param List Height
  26.  * @desc セーブファイルリストのウインドウ高さです。
  27.  * @default 380
  28.  *
  29.  * @param List MaxItems
  30.  * @desc セーブファイルリストの数です。
  31.  * @default 20
  32.  *
  33.  * @param List MaxCols
  34.  * @desc セーブファイルリストの列数です。
  35.  * @default 2
  36.  *
  37.  * @param List Opacity
  38.  * @desc セーブファイルリストのウインドウ透過度です。
  39.  * @default 0
  40.  *
  41.  * @param List Font Size
  42.  * @desc セーブファイルリストのフォントサイズです。
  43.  * @default 20
  44.  *
  45.  * @param Help X
  46.  * @desc ヘルプのウインドウ位置Xです。
  47.  * @default 100
  48.  *
  49.  * @param Help Y
  50.  * @desc ヘルプのウインドウ位置Yです。
  51.  * @default 50
  52.  *
  53.  * @param Help Width
  54.  * @desc ヘルプのウインドウ幅です。
  55.  * @default 580
  56.  *
  57.  * @param Help Opacity
  58.  * @desc ヘルプのウインドウ透過度です。
  59.  * @default 0
  60.  *
  61.  * @param Help Font Size
  62.  * @desc ヘルプのフォントサイズです。
  63.  * @default 18
  64.  *
  65.  * @param State X
  66.  * @desc セーブ内容の位置Xです。
  67.  * @default 380
  68.  *
  69.  * @param State Y
  70.  * @desc セーブ内容の位置Yです。
  71.  * @default 120
  72.  *
  73.  * @param State Width
  74.  * @desc セーブ内容のウインドウ幅です。
  75.  * @default 300
  76.  *
  77.  * @param State Height
  78.  * @desc セーブ内容のウインドウ高さです。
  79.  * @default 370
  80.  
  81.  * @param State Opacity
  82.  * @desc セーブ内容のウインドウ透過度です。
  83.  * @default 0
  84.  *
  85.  * @param State Font Size
  86.  * @desc セーブ内容のフォントサイズです。
  87.  * @default 18
  88.  *
  89.  * @param SS X
  90.  * @desc スクリーンショットの表示位置Xです。
  91.  * @default 0
  92.  *
  93.  * @param SS Y
  94.  * @desc スクリーンショットの表示位置Yです。
  95.  * @default 0
  96.  *
  97.  * @param SS Percent
  98.  * @desc スクリーンショットの圧縮率です。
  99.  *この数字が大きいほどデータが重くなります。
  100.  * @default 0.30
  101.  *
  102.  * @param Savetime X
  103.  * @desc セーブ日時の表示位置Xです。
  104.  * @default 0
  105.  *
  106.  * @param Savetime Y
  107.  * @desc セーブ日時の表示位置Yです。
  108.  * @default 190
  109.  *
  110.  * @param Location TEXT
  111.  * @desc マップ名の名称です、制御文字が使えます。
  112.  * @default 地点:
  113.  *
  114.  * @param Location TEXT X
  115.  * @desc マップ名の名称表示位置Xです。
  116.  * @default 0
  117.  *
  118.  * @param Location TEXT Y
  119.  * @desc マップ名の名称表示位置Yです。
  120.  * @default 220
  121.  *
  122.  * @param Location X
  123.  * @desc マップ名の表示位置Xです。
  124.  * @default 0
  125.  *
  126.  * @param Location Y
  127.  * @desc マップ名の表示位置Yです。
  128.  * @default 215
  129.  *
  130.  * @param Gold TEXT
  131.  * @desc 所持金の名称です、制御文字が使えます。
  132.  * @default 持有金额:
  133.   *
  134.  * @param Gold TEXT X
  135.  * @desc 所持金の名称表示位置Xです。
  136.  * @default 0
  137.  *
  138.  * @param Gold TEXT Y
  139.  * @desc 所持金の名称表示位置Yです。
  140.  * @default 245
  141.  *
  142.  * @param Gold X
  143.  * @desc 所持金の表示位置Xです。
  144.  * @default 0
  145.  *
  146.  * @param Gold Y
  147.  * @desc 所持金の表示位置Yです。
  148.  * @default 240
  149.  *
  150.  * @param Member X
  151.  * @desc パーティメンバーの表示位置Xです。
  152.  * @default 800
  153.  *
  154.  * @param Member Y
  155.  * @desc パーティメンバーの表示位置Yです。
  156.  * @default 500
  157.  *       
  158.  * @help このプラグインには、プラグインコマンドはありません。
  159.  *
  160.  * 制作者:sairi [Twitter@sairi55]
  161.  * SPECIALTHANKS
  162.  * 翠様、尾角つの様
  163.  * ツクマテお呼びTwitterで何時も構ってくれるツクラーの皆様
  164.  *  
  165.  * 無責任に行きたいので他のプラグインとの競合等により
  166.  * バグ、エラーが発生した場合の対応、責任は取れません。
  167.  * 改変がし易いように説明も入れたつもりですが
  168.  * 全てご使用は自己責任でお願い致します。
  169.  *  
  170.  * 使用規約:
  171.  * ジャンル無制限、改変可
  172.  * 素材自体の販売禁止
  173.  * ゲームに含めての再配布は可
  174.  *  
  175.  * クレジットの記載は強制しませんが入れてくれると嬉しいです。
  176.  * あと教えてくれるともっと嬉しいです。
  177.  * 以上宜しくお願いします。
  178.  *  
  179.  *  
  180. */
  181.  
  182.  
  183.  
  184. (function() {
  185.         var Imported = Imported || {};
  186.   Imported.sai_Scenefile = true;
  187.   var sai = sai || {};
  188.  
  189.         var parameters = PluginManager.parameters('sai_Scenefile');
  190.     var bgBitmapFile = parameters['bgBitmapFile'] || '';
  191.         sai.list_x = Number(parameters['List X'] || 100);       
  192.         sai.list_y = Number(parameters['List Y'] || 170);       
  193.         sai.list_width = Number(parameters['List Width'] || 280);
  194.         sai.list_height = Number(parameters['List Height'] || 380);
  195.         sai.list_maxItems = Number(parameters['List MaxItems'] || 20);       
  196.         sai.list_maxcols = Number(parameters['List MaxCols'] || 2);       
  197.     sai.list_opacity = Number(parameters['List Opacity'] || 0);       
  198.     sai.list_fontsize = Number(parameters['List Font Size'] || 20);       
  199.         sai.help_x = Number(parameters['Help X'] || 100);       
  200.         sai.help_y = Number(parameters['Help Y'] || 100);       
  201.         sai.help_width = Number(parameters['Help Width'] || 580);
  202.         sai.help_opacity = Number(parameters['Help Opacity'] || 0);       
  203.   sai.help_fontsize = Number(parameters['Help Font Size'] || 18);       
  204.         sai.state_x = Number(parameters['State X'] || 380);       
  205.         sai.state_y = Number(parameters['State Y'] || 170);       
  206.         sai.state_width = Number(parameters['State Width'] || 300);
  207.         sai.state_height = Number(parameters['State Height'] || 380);       
  208.         sai.state_opacity = Number(parameters['State Opacity'] || 0);       
  209.         sai.state_fontsize = Number(parameters['State Font Size'] || 18);       
  210.         sai.ss_x = Number(parameters['SS X'] || 0);       
  211.         sai.ss_y = Number(parameters['SS Y'] || 0);       
  212.         sai.ss_percent = Number(parameters['SS Percent'] || 0.30);       
  213.         sai.savetime_x = Number(parameters['Savetime X'] || 0);       
  214.         sai.savetime_y = Number(parameters['Savetime Y'] || 190);
  215.         sai.location_text = (parameters['Location TEXT'] || '地点:');               
  216.         sai.locationtext_x = Number(parameters['Location TEXT X'] || 0);       
  217.         sai.locationtext_y = Number(parameters['Location TEXT Y'] || 220);       
  218.         sai.location_x = Number(parameters['Location X'] || 0);       
  219.         sai.location_y = Number(parameters['Location Y'] || 215);       
  220.         sai.gold_text = (parameters['Gold TEXT'] || '金钱:');
  221.         sai.goldtext_x = Number(parameters['Gold TEXT X'] || 0);       
  222.         sai.goldtext_y = Number(parameters['Gold TEXT Y'] || 245);       
  223.         sai.gold_x = Number(parameters['Gold X'] || 0);       
  224.         sai.gold_y = Number(parameters['Gold Y'] || 240);
  225.         sai.members_x = Number(parameters['Members X'] || 80);       
  226.         sai.members_y = Number(parameters['Members Y'] || 340);       
  227.  
  228.  
  229. //Bitmap-----------------------------------------------------------------------------
  230. if (!Bitmap.prototype.save){
  231.     Bitmap.prototype.toDataURL = function(){
  232. // jpegとPNGサイズが小さくなる方を返す
  233.            var png = this._canvas.toDataURL('image/png');
  234.             var jpeg = this._canvas.toDataURL('image/jpeg');
  235.             return (png.length < jpeg.length) ? png : jpeg;
  236.  
  237.     };
  238. }
  239.  
  240. //DataManager-----------------------------------------------------------------------------
  241. var DM_LSImage = DataManager.loadSavefileImages;
  242. DataManager.loadSavefileImages = function(info){
  243.     DM_LSImage.call(this, info);
  244.     if (info.snapUrl){
  245.                 var DH = Decrypter.hasEncryptedImages;//暗号化してるかどうかのフラグを一旦適当な変数に保存
  246.                 Decrypter.hasEncryptedImages = false;//その場合一時的にfalse
  247.          ImageManager.loadNormalBitmap(info.snapUrl);
  248.                 Decrypter.hasEncryptedImages = DH;    //フラグを戻す
  249.     }
  250.             if (info.characters) {
  251.         for (var i = 0; i < info.characters.length; i++) {
  252.             ImageManager.loadCharacter(info.characters[i][0]);
  253.         }
  254.     }
  255. };
  256.  
  257. var DM_MSInfo = DataManager.makeSavefileInfo;//セーブファイルの内容
  258. DataManager.makeSavefileInfo = function(){
  259. var info = DM_MSInfo.call(this);       
  260.         info.location = $dataMap.displayName != "" ? $dataMap.displayName : $dataMapInfos[$gameMap.mapId()].name;
  261.    info.level = $gameParty.exists() ? $gameParty.members()[0].level : null;
  262.         info.gold = $gameParty.gold();        
  263.     info.map_id = $gameMap.mapId();
  264.  
  265.  
  266.         var today = new Date();
  267.     var dateOptions = {
  268.          year: "numeric",
  269.          month: "2-digit",
  270.          day: "2-digit",
  271.          hour: "2-digit",
  272.          minute: "2-digit"
  273. };
  274.     info.savetime = today.toLocaleDateString("ja-JP",dateOptions)
  275.  
  276.   var bitmap = this.makeSavefileBitmap();
  277.     if (bitmap){
  278.         info.snapUrl = bitmap.toDataURL();
  279.     }
  280.     return info;
  281. };
  282.  
  283.  
  284. DataManager.makeSavefileBitmap = function(){//セーブファイル用のビットマップを作成
  285.     var bitmap = $gameTemp.getSavefileBitmap();
  286.     if (!bitmap){
  287.         return null;
  288.     }
  289.     var scale = Number(sai.ss_percent);
  290.     var newBitmap = new Bitmap(bitmap.width * scale, bitmap.height * scale);
  291.     newBitmap.blt(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, newBitmap.width, newBitmap.height);
  292.     return newBitmap;
  293. };
  294.  
  295. //Game_Temp-----------------------------------------------------------------------------
  296. var Game_Temp_initialize = Game_Temp.prototype.initialize;
  297. Game_Temp.prototype.initialize = function(){
  298.     Game_Temp_initialize.call(this);
  299.     this._savefileBitmap = null;
  300. };
  301.  
  302. Game_Temp.prototype.setSavefileBitmap = function(bitmap){
  303.     this._savefileBitmap = bitmap;
  304. };
  305.  
  306. Game_Temp.prototype.getSavefileBitmap = function(){
  307.     if (this._savefileBitmap){
  308.         return this._savefileBitmap;
  309.     }
  310.     else{
  311.         return SceneManager._backgroundBitmap;
  312.     }
  313. };
  314.  
  315. //---------------------------------------------------------------------------------
  316. Window_SavefileList.prototype.maxItems = function() {
  317.     return Number(sai.list_maxItems);
  318. };
  319. Window_SavefileList.prototype.maxCols = function() {
  320.     return Number(sai.list_maxcols); 
  321. };
  322. Window_SavefileList.prototype.standardFontSize = function() {
  323.     return Number(sai.list_fontsize);
  324. };
  325. Window_Help.prototype.standardFontSize = function() {
  326.     return Number(sai.help_fontsize);
  327. };
  328. SceneManager.snapForBackground = function() {
  329.     this._backgroundBitmap = this.snap(); //モーションブラーを取り外す
  330.  
  331. };
  332. //----------------------------------------------------------------------------------
  333.     var _Scene_File_create = Scene_File.prototype.create;
  334.     Scene_File.prototype.create = function() {
  335.         _Scene_File_create.call(this);
  336.                 //ステータスウインドウの配置
  337.         this._statusWindow = new Window_SavefileStatus(Number(sai.state_x),Number(sai.state_y),Number(sai.state_width), Number(sai.state_height));
  338.         this._statusWindow.setMode(this.mode());
  339.         this._listWindow.statusWindow = this._statusWindow;
  340.                 // セーブ画面全てのウインドウを透明にする
  341.                 this._statusWindow.opacity = Number(sai.state_opacity);
  342.                 this._helpWindow.opacity = Number(sai.help_opacity);
  343.         this._listWindow.opacity = Number(sai.list_opacity);
  344.                 //---------------------------------------
  345.         this._listWindow.callUpdateHelp();
  346.                 //ヘルプウインドウの配置
  347.                 this._helpWindow.x = Number(sai.help_x);
  348.                 this._helpWindow.y = Number(sai.help_y);
  349.                 this._helpWindow.width = Number(sai.help_width);
  350.         this.addWindow(this._statusWindow);
  351.                 this.addChildAt(this._helpWindow,2); //helpWindowの表示順位を入れ替える               
  352.     };
  353.  
  354.     var _Scene_File_start = Scene_File.prototype.start;
  355.     Scene_File.prototype.start = function() {
  356.         _Scene_File_start.call(this);
  357.         this._listWindow.ensureCursorVisible();
  358.         this._listWindow.callUpdateHelp();
  359.     };
  360.  
  361. Window_SavefileList.prototype.initialize = function(x, y, width, height) {
  362.     Window_Selectable.prototype.initialize.call(this, Number(sai.list_x), Number(sai.list_y), Number(sai.list_width), Number(sai.list_height));
  363.     this.activate();
  364.     this._mode = null;
  365. };
  366. Window_SavefileList.prototype.itemHeight = function() {
  367.     return this.padding * 1.8;
  368. };
  369.  
  370.     var _Window_SavefileList_callUpdateHelp =
  371.             Window_SavefileList.prototype.callUpdateHelp;
  372.     Window_SavefileList.prototype.callUpdateHelp = function() {
  373.         _Window_SavefileList_callUpdateHelp.call(this);
  374.         if (this.active && this.statusWindow) {
  375.             this.statusWindow.setId(this.index() + 1);
  376.         }
  377.     };
  378.  
  379.     function Window_SavefileStatus() {
  380.         this.initialize.apply(this, arguments);
  381.     }
  382.  
  383.     Window_SavefileStatus.prototype = Object.create(Window_Base.prototype);
  384.     Window_SavefileStatus.prototype.constructor = Window_SavefileStatus;
  385.  
  386.     Window_SavefileStatus.prototype.initialize = function(x, y, width, height) {
  387.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  388.         this._id = 1;
  389.     };
  390.  
  391.     Window_SavefileStatus.prototype.setMode = function(mode) {
  392.         this._mode = mode;
  393.     };
  394.  
  395.     Window_SavefileStatus.prototype.setId = function(id) {
  396.         this._id = id;
  397.                                                 this.contents.fontSize = Number(sai.state_fontsize);
  398.         this.refresh();
  399.     };
  400.         Window_SavefileStatus.prototype.standardFontSize = function(id) {
  401.         return  Number(sai.state_fontsize);
  402.     };
  403.  
  404.     Window_SavefileStatus.prototype.refresh = function() {
  405.         this.contents.clear();
  406.     var id = this._id;
  407.     var info = DataManager.loadSavefileInfo(id);
  408.         var valid = DataManager.isThisGameFile(id);
  409.     if (info){
  410.         var rect = this.contents.rect;
  411.         this.drawSnappedImage(info, rect, valid);
  412.                 this.drawFileId(id, rect.x, rect.y);
  413.                 this.drawContents(info, rect.x, valid);
  414.     }
  415.     };
  416.  
  417. //セーブステータス画面に表示させる名称と位置------------------------------------
  418. //現状[ファイル名+ID、プレイ時間、地名、持ち金]、名称変更は''の中の文字で
  419.     Window_SavefileStatus.prototype.drawFileId = function(id, x, y) {
  420.                 this.drawTextEx((sai.location_text) + ' ', Number(sai.locationtext_x), Number(sai.locationtext_y), 120);
  421.                 this.drawTextEx((sai.gold_text) + ' ', Number(sai.goldtext_x), Number(sai.goldtext_y), 120);
  422.     };
  423.  
  424.       Window_SavefileStatus.prototype.drawContents = function(info, x, valid) {
  425.         this.drawText(info.savetime, Number(sai.savetime_x), Number(sai.savetime_y), 200);
  426.                 if (info.location) {
  427.                 this.drawText(info.location, 100, Number(sai.location_y), 150);
  428.                 }
  429.                 if (info.level) {
  430.                         this.drawText(TextManager.levelA + " " + info.level, Number(sai.level_x), Number(sai.level_y), 60);
  431.                 }
  432.                 if (typeof info.gold === 'number') { //値が数字の時に通る
  433.                         this.drawText(info.gold + " " + TextManager.currencyUnit, 100, Number(sai.gold_y), 200);
  434.                 }
  435.  
  436.  
  437.                 if (valid) {
  438.             this.drawPartyCharacters(info,Number(sai.members_x),Number(sai.members_y));
  439.         }
  440.  
  441.     };
  442.  
  443. //ステータスウインドウに表示させるPTの詳細--------------------------------------
  444. Window_SavefileStatus.prototype.drawPartyCharacters = function(info, x, y) {
  445.     if (info.characters) {
  446.         for (var i = 0; i < info.characters.length; i++) {
  447.             var data = info.characters[i];
  448.             this.drawCharacter(data[0], data[1], x + i * 48, y);
  449.         }
  450.     }
  451. };
  452. //セーブファイルリストの中身-------------------------------------------------
  453. Window_SavefileList.prototype.drawItem = function(index) {
  454.     var id = index + 1;
  455.     var valid = DataManager.isThisGameFile(id);
  456.     var info = DataManager.loadSavefileInfo(id);
  457.     var rect = this.itemRectForText(index);
  458.     this.resetTextColor();
  459.     this.drawFileId(id, rect.x, rect.y);
  460.  
  461. };
  462. //セーブファイルの画像を表示
  463. Window_SavefileStatus.prototype.drawSnappedImage = function(info, rect, valid){
  464.     if (!(valid && info.snapUrl)){
  465.         return;
  466.     }
  467.   var DH = Decrypter.hasEncryptedImages;//暗号化してるかどうかのフラグを一旦適当な変数に保存
  468.         Decrypter.hasEncryptedImages = false;//その場合一時的にfalse
  469.     var bitmap = ImageManager.loadNormalBitmap(info.snapUrl);
  470.         Decrypter.hasEncryptedImages = DH;    //フラグを戻す
  471.     var dh = 0;
  472.     var dw = 0;
  473.     var dx = rect.x + Number(sai.ss_x); //表示位置X
  474.     var dy = rect.y + Number(sai.ss_y);  //表示位置Y
  475.  
  476.     this.changePaintOpacity(true);
  477.     this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy, dw, dh);
  478. };
  479.  
  480.     //セーブ画面の背景読み込み
  481.     var _Scene_File_createBackground = Scene_File.prototype.createBackground;
  482.     Scene_File.prototype.createBackground = function(){
  483.         if(bgBitmapFile){
  484.                         Scene_MenuBase.prototype.createBackground.call(this);//追加行
  485.             this._backgroundSprite = new Sprite();
  486.             this._backgroundSprite.bitmap =
  487.              ImageManager.loadPicture(bgBitmapFile);
  488.             this.addChild(this._backgroundSprite);
  489.             return;
  490.         }
  491.         _Scene_File_createBackground.call(this);    // 背景ファイルが無い場合
  492.     };
  493.  
  494.  
  495. })();

Lv4.逐梦者

梦石
0
星屑
7422
在线时间
948 小时
注册时间
2017-9-27
帖子
583
2
发表于 2019-5-30 07:59:33 | 只看该作者
存档卡顿主要跟读写的数据量有关,检查一下你的数据库,把冗余的内容去掉再试试。

点评

emm但是用默认存档完全不卡。是不是多了截图的缘故?用了截图存档后只要存一个档save文件夹里global开头文件有24kb而用默认存档只有1kb  发表于 2019-5-30 08:13
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 18:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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