Optimize game.showExtensionChangeLog.

(cherry picked from commit c5eeb67e390a232b1a577d2c04a72f4119592754)
This commit is contained in:
Tipx-L 2023-08-24 08:19:48 -07:00
parent 4043bf1271
commit 3d4f04860b
1 changed files with 7 additions and 9 deletions

View File

@ -38376,16 +38376,14 @@
lib.init.onfree();
}
},
showExtensionChangeLog:function(str,extname){
showExtensionChangeLog:(str,extname)=>{
extname=extname||_status.extension;
var cfg='extension_'+extname+'_changelog';
if(lib.extensionPack[extname]&&lib.extensionPack[extname].version!=lib.config[cfg]){
game.saveConfig(cfg,lib.extensionPack[extname].version);
if(!_status.extensionChangeLog){
_status.extensionChangeLog={};
_status.extensionChangeLog[extname]=str;
}
}
const cfg=`extension_${extname}_changelog`;
if(!lib.extensionPack[extname]||lib.extensionPack[extname].version==lib.config[cfg]) return;
game.saveConfig(cfg,lib.extensionPack[extname].version);
if(_status.extensionChangeLog) return;
_status.extensionChangeLog={};
_status.extensionChangeLog[extname]=str;
},
saveConfig:(key,value,local,callback)=>{
if(_status.reloading) return;