制作.rpgsave存档修改器
1. 桌⾯右键,新建⽂本⽂档,⽂件名任意,后缀改为.html
2. ⽂档右键,编辑,复制代码到⽂档⾥
3. 双击打开html页⾯
(蓝奏云)
存档本⾝是⼀个json对象,
默认的加密就是使⽤ LZStringpressToBase64 ⽅法,编码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="cdn.jsdelivr/npm/vue/dist/vue.js"></script>
<link rel="stylesheet" href="cdn.jsdelivr/npm/element-ui@2.14.1/lib/theme-chalk/index.css">
<script src="cdn.jsdelivr/npm/element-ui@2.14.1/lib/index.min.js"></script>
<script async src="cdn.jsdelivr/npm/lz-string@1.4.4/libs/lz-string.min.js"></script>
<script async src="cdn.jsdelivr/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" >
<div >
<!-- (1) 选取⽂件 -->
<div>
<el-upload
class="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) 加密内容 -->
<div >
<el-input v-model="加密内容" placeholder="未读取⽂件">
<template slot="prepend">原⽂:</template>
<el-button slot="append"  v-on:click="ctrl_c(加密内容)" icon="el-icon-document-copy"></el-button>
</el-input>
</div>
<!-- (3) 加密按钮 -->
<div >
<el-button v-on:click="decodeText_to_encodeText" icon="el-icon-upload2"></el-button>
</div>
<!-- (4) 解密内容 -->
<div >
<el-input v-model="解密内容" placeholder="请输⼊内容">
<template slot="prepend">解码:</template>
<el-button slot="append" v-on:click="ctrl_c(解密内容)" icon="el-icon-document-copy"></el-button>
</el-input>
</div>
</div>四六级多少分过线
</el-col>
<el-col :xs="24" :sm="13" >
<div >
<!-- (5) json内容 -->
<div >
<el-input type="textarea" v-model="json内容" placeholder="请输⼊内容" :rows="18">
</el-input>
</div>
<!-- (6) 转换按钮 -->
<div >
<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>
毕福剑说了什么话
<el-button v-on:click="ctrl_c(json内容)" icon="el-icon-document-copy"></el-button>
</div>
</div>
</el-col>
</el-row>
<el-row >
<!--左占位--><el-col :xs="3" :sm="8"> </el-col>
<el-col :xs="18" :sm="8" >
<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 >
<template v-for="(⾓⾊,index) in ⾓⾊列表" v-if="index >= 1">
<!--左占位--><el-col :xs="3" :sm="1"> </el-col>
<el-col :xs="18" :sm="6" >
<div>
<el-input v-model="⾓⾊['_name']" placeholder="未读取">
<template slot="prepend">姓名</template>
</el-input>
<el-input v-model.number="⾓⾊['_level']" type="number" placeholder="未读取" >
<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="未读取" >                            <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" >
<el-input placeholder="未读取">
<template slot="prepend">占位</template>
</el-input>
</el-col>
</template>
</el-row>
<el-row >
<el-col :xs="24" :sm="24" >
<div >
<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" >
</el-col>
<el-backtop></el-backtop>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
⽂件路径: null,
加密内容: null,
解密内容: null,
json内容: 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: {
加密内容(新值, 旧值) {
this.解密内容 = this.读取解密内容(新值)
},
黄文豪主演的电视剧
解密内容(新值, 旧值) {
this.json内容 = this.读取json内容(新值)
},
json内容(新值, 旧值) {
this.json对象 = _json_obj(新值)
try {
this.⾓⾊列表 = this.json对象["actors"]["_data"]["@a"]                    } catch (error) {
console.log(error)
this.⾓⾊列表 = []
}
}
},
methods: {
// (1)
upload: function (file, fileList) {
this.⽂件路径 = file.name
file.⽂件路径 =  this.⽂件路径
this.读取加密内容(file.raw)
},
clickFile: function (file) {
this.读取加密内容(file.raw)
this.⽂件路径 = file.⽂件路径
/
/ (2)
读取加密内容: function (file) {
var _this = this
var reader = new FileReader()
_this.加密内容 = sult
}
},
// (3)
decodeText_to_encodeText: function () {
this.加密内容 = de(this.解密内容)
},
// (4)
读取解密内容: function (加密内容) {
return this.decode(加密内容)
},
// (5)
读取json内容: function (解密内容) {
return JSON.stringify(JSON.parse(解密内容),null,2)                },
// (6)
change_and_encode_and_save: function (obj) {
this.change_and_encode(obj)
this.save(this.加密内容, this.⽂件路径)
喜爱夜蒲演员表
},
change_and_encode_and_ctrlC: function (obj) {
this.change_and_encode(obj)
},
// ------------ 辅助⽅法 ------------
change_and_encode: function (obj) {
let _ = _json_str(obj)
this.加密内容 = de(_)
},
ctrl_c: function (text) {
this.$message('已复制');
},
// ------------ ⼯具⽅法 ------------
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) {