制作.rpgsave存档修改器
生活随笔
收集整理的這篇文章主要介紹了
制作.rpgsave存档修改器
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1. 桌面右鍵,新建文本文檔,文件名任意,后綴改為.html
2. 文檔右鍵,編輯,復(fù)制代碼到文檔里
3. 雙擊打開html頁面
直接下載(藍奏云)
存檔本身是一個json對象,
默認(rèn)的加密就是使用 LZString.compressToBase64 方法,編碼json字符串:
json對象 -> json字符串 -> base64字符串
使用時再用 LZString.decompressFromBase64 方法,解碼成json字符串:
base64字符串 -> json字符串 -> json對象
?
修改rpgsave存檔.html
<!DOCTYPE html> <html lang="zh-CN"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="author" content="hlmio 2020-12-13"><title>修改rpgsave存檔</title><script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.14.1/lib/theme-chalk/index.css"><script src="https://cdn.jsdelivr.net/npm/element-ui@2.14.1/lib/index.min.js"></script><script async src="https://cdn.jsdelivr.net/npm/lz-string@1.4.4/libs/lz-string.min.js"></script><script async src="https://cdn.jsdelivr.net/npm/file-saver@2.0.5/dist/FileSaver.min.js"></script> </head> <body><div id="app"><el-row :gutter="10"><el-col :xs="24" :sm="10" style="margin-top: 50px;"><div style="display: flex; flex-direction: column; align-items: center;"><!-- (1) 選取文件 --><div><el-uploadclass="upload-demo"drag:auto-upload="1==2":on-change="upload":on-preview="clickFile"action="#"><i class="el-icon-upload"></i><div class="el-upload__text">將文件拖到此處,或<em>點擊上傳</em></div></el-upload></div><!-- (2) 加密內(nèi)容 --><div style="margin-top: 50px;"><el-input v-model="加密內(nèi)容" placeholder="未讀取文件"><template slot="prepend">原文:</template><el-button slot="append" v-on:click="ctrl_c(加密內(nèi)容)" icon="el-icon-document-copy"></el-button></el-input></div><!-- (3) 加密按鈕 --><div style="margin-top: 15px;"><el-button v-on:click="decodeText_to_encodeText" icon="el-icon-upload2"></el-button></div><!-- (4) 解密內(nèi)容 --><div style="margin-top: 15px;"><el-input v-model="解密內(nèi)容" placeholder="請輸入內(nèi)容"><template slot="prepend">解碼:</template><el-button slot="append" v-on:click="ctrl_c(解密內(nèi)容)" icon="el-icon-document-copy"></el-button></el-input></div></div></el-col><el-col :xs="24" :sm="13" style="margin-top: 40px;"><div style="display: flex; flex-direction: column; align-items: center;"><!-- (5) json內(nèi)容 --><div style="margin-top: 15px; width: 90%;"><el-input type="textarea" v-model="json內(nèi)容" placeholder="請輸入內(nèi)容" :rows="18"></el-input></div><!-- (6) 轉(zhuǎn)換按鈕 --><div style="margin-top: 15px;"><el-button v-on:click="change_and_encode_and_save(json內(nèi)容)" icon="el-icon-download"></el-button><el-button v-on:click="change_and_encode_and_ctrlC(json內(nèi)容)" type="primary" icon="el-icon-check"></el-button><el-button v-on:click="ctrl_c(json內(nèi)容)" icon="el-icon-document-copy"></el-button></div></div></el-col></el-row><el-row style="margin-top: 50px;"><!--左占位--><el-col :xs="3" :sm="8"> </el-col><el-col :xs="18" :sm="8" style="margin-top: 10px;"><el-input v-model.number="金錢" type="number" placeholder="未讀取"><template slot="prepend">金錢</template></el-input></el-col><!--右占位--><el-col :xs="3" :sm="8"> </el-col></el-row><el-row style="margin-top: 15px;"><template v-for="(角色,index) in 角色列表" v-if="index >= 1"><!--左占位--><el-col :xs="3" :sm="1"> </el-col><el-col :xs="18" :sm="6" style="margin-top: 15px;"><div><el-input v-model="角色['_name']" placeholder="未讀取"><template slot="prepend">姓名</template></el-input><el-input v-model.number="角色['_level']" type="number" placeholder="未讀取" style="margin-top: 10px;"><template slot="prepend">等級</template></el-input><el-input v-model.number="角色['_paramPlus']['@a'][0]" type="number" placeholder="未讀取"><template slot="prepend">生命</template></el-input><el-input v-model.number="角色['_paramPlus']['@a'][1]" type="number" placeholder="未讀取"><template slot="prepend">魔力</template></el-input><el-input v-model.number="角色['_paramPlus']['@a'][2]" type="number" placeholder="未讀取" style="margin-top: 5px;"><template slot="prepend">攻擊</template></el-input><el-input v-model.number="角色['_paramPlus']['@a'][4]" type="number" placeholder="未讀取"><template slot="prepend">魔攻</template></el-input><el-input v-model.number="角色['_paramPlus']['@a'][6]" type="number" placeholder="未讀取"><template slot="prepend">敏捷</template></el-input></div></el-col><!--右占位--><el-col :xs="3" :sm="1" style="margin-top: 10px; visibility: hidden"><el-input placeholder="未讀取"><template slot="prepend">占位</template></el-input></el-col></template></el-row><el-row style="margin-top: 15px;"><el-col :xs="24" :sm="24" style="margin-top: 15px;"><div style="display: flex; justify-content: center;"><el-button v-on:click="change_and_encode_and_save(json對象)" icon="el-icon-download"></el-button><el-button v-on:click="change_and_encode_and_ctrlC(json對象)" type="primary" icon="el-icon-check"></el-button></div></el-col></el-row><el-row><el-col :xs="20" :sm="6" style="margin-top: 50px;"></el-col></el-row><el-backtop></el-backtop></div><script>var app = new Vue({el: '#app',data: {文件路徑: null,加密內(nèi)容: null,解密內(nèi)容: null,json內(nèi)容: null,json對象: {},角色列表: []},computed: {金錢: {get: function () { try {var _ = this.json對象["party"]["_gold"]} catch (error) {console.log(error)_ = "未取到值"}return _},set: function (value){try {this.json對象["party"]["_gold"] = value} catch (error) {console.log(error)}}}},watch: {加密內(nèi)容(新值, 舊值) {this.解密內(nèi)容 = this.讀取解密內(nèi)容(新值)},解密內(nèi)容(新值, 舊值) {this.json內(nèi)容 = this.讀取json內(nèi)容(新值)},json內(nèi)容(新值, 舊值) {this.json對象 = this.to_json_obj(新值)try {this.角色列表 = this.json對象["actors"]["_data"]["@a"]} catch (error) {console.log(error)this.角色列表 = []}}},methods: {// (1)upload: function (file, fileList) {this.文件路徑 = file.namefile.文件路徑 = this.文件路徑this.讀取加密內(nèi)容(file.raw)},clickFile: function (file) {this.讀取加密內(nèi)容(file.raw)this.文件路徑 = file.文件路徑 },// (2)讀取加密內(nèi)容: function (file) {var _this = thisvar reader = new FileReader()reader.readAsText(file)reader.onload = function(){_this.加密內(nèi)容 = this.result}},// (3)decodeText_to_encodeText: function () {this.加密內(nèi)容 = this.encode(this.解密內(nèi)容)this.ctrl_c(this.加密內(nèi)容)},// (4)讀取解密內(nèi)容: function (加密內(nèi)容) {return this.decode(加密內(nèi)容)},// (5)讀取json內(nèi)容: function (解密內(nèi)容) {return JSON.stringify(JSON.parse(解密內(nèi)容),null,2)},// (6)change_and_encode_and_save: function (obj) {this.change_and_encode(obj)this.save(this.加密內(nèi)容, this.文件路徑)},change_and_encode_and_ctrlC: function (obj) {this.change_and_encode(obj)this.ctrl_c(this.加密內(nèi)容)},// ------------ 輔助方法 ------------change_and_encode: function (obj) {let _ = this.to_json_str(obj)this.加密內(nèi)容 = this.encode(_)},ctrl_c: function (text) {this.copyText(text)this.$message('已復(fù)制');},// ------------ 工具方法 ------------to_json_obj: function (obj) {return JSON.parse(obj)},to_json_str: function (obj) {if(typeof(obj) == "string"){return JSON.stringify(JSON.parse(obj))}return JSON.stringify(obj)},encode: function (text) {return LZString.compressToBase64(text)},decode: function (text) {return LZString.decompressFromBase64(text)},save: function (text, 文件名 = "a1.txt") {let pos = 文件名.lastIndexOf("/")文件名 = 文件名.substring(pos+1)var file = new File([text], 文件名, { type: "text/plain;charset=utf-8" })saveAs(file)},// 復(fù)制的方法copyText: function(text, callback){ // text: 要復(fù)制的內(nèi)容, callback: 回調(diào)var tag = document.createElement('input');tag.setAttribute('id', 'cp_hgz_input');tag.value = text;document.getElementsByTagName('body')[0].appendChild(tag);document.getElementById('cp_hgz_input').select();document.execCommand('copy');document.getElementById('cp_hgz_input').remove();if(callback) {callback(text)}}}})</script> </body> </html>代碼里沒寫多少修改項,這個網(wǎng)站比較全
https://www.saveeditonline.com/
總結(jié)
以上是生活随笔為你收集整理的制作.rpgsave存档修改器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Amoeba for MySQL
- 下一篇: 面试必备:synchronized的底层