From 2b9eadbe9fbe7ab724d31f9744a72ffc06b79f68 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 22 Apr 2019 17:51:10 -0400 Subject: [PATCH] rename editor_file --- ...editor_file.js => editor_file_unsorted.js} | 0 _server/editor_game.js | 20 +++++++++++++++++++ editor-mobile.html | 2 +- editor.html | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) rename _server/{editor_file.js => editor_file_unsorted.js} (100%) diff --git a/_server/editor_file.js b/_server/editor_file_unsorted.js similarity index 100% rename from _server/editor_file.js rename to _server/editor_file_unsorted.js diff --git a/_server/editor_game.js b/_server/editor_game.js index 46639469..13b4d402 100644 --- a/_server/editor_game.js +++ b/_server/editor_game.js @@ -29,6 +29,26 @@ editor_game_wrapper = function (editor, main, core) { return value } + editor_game.prototype.getValue = function(field){ + var rmap = editor.game.replacerRecord; + var value = eval(field) + if (rmap.hasOwnProperty(oldval)) { + return rmap[value] + } else { + return value + } + } + + editor_game.prototype.setValue = function(field,value){ + var rmap = editor.game.replacerRecord; + var oldval = eval(field) + if (rmap.hasOwnProperty(oldval)) { + rmap[value]=eval(value) + } else { + eval(field+'='+value) + } + } + editor_game.prototype.replacerWithoutRecord = function (_key, value) { if (value instanceof Function) { return value.toString() diff --git a/editor-mobile.html b/editor-mobile.html index cb43de52..874a3867 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -524,7 +524,7 @@ - + diff --git a/editor.html b/editor.html index c7c02094..7cbf3d14 100644 --- a/editor.html +++ b/editor.html @@ -507,7 +507,7 @@ - +