diff --git a/code/__defines/rust_g_yw.dm b/code/__defines/rust_g_yw.dm new file mode 100644 index 0000000000..7d5a88aa65 --- /dev/null +++ b/code/__defines/rust_g_yw.dm @@ -0,0 +1,3 @@ + +// savefile ser/de // +#define rustg_savefile_to_json(save_string) call(RUST_G, "savefile_to_json")(save_string) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index e8954ace3b..27f0a95c18 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -274,9 +274,9 @@ var/list/preferences_datums = list() dat += "Save slot - " dat += "Reload slot - " dat += "Reset slot - " - dat += "Copy slot" - dat += "Save & export slot" // YW Edit - "Add option to export character to JSON" - + dat += "Copy slot - " + dat += "Save & export all" // YW Edit - "Add option to export character to JSON" + //dat += "Import all" // YW Edit - "Add option to import character from JSON" else dat += "Please create an account to save your preferences." diff --git a/code/modules/client/preferences_yw.dm b/code/modules/client/preferences_yw.dm index 76dd06d261..2a23399d76 100644 --- a/code/modules/client/preferences_yw.dm +++ b/code/modules/client/preferences_yw.dm @@ -34,4 +34,39 @@ if(!fexists(path)) return 0 var/savefile/S = new /savefile(path) if(!S) return 0 + + if(tgui_alert(usr, "This will save and export all your character slots and user preferences to a file. Are you sure?","Export All",list("Yes","No"))=="No") + return + S.cd = "/" + var/save_json = rustg_savefile_to_json(S.ExportText()) + var/datum/browser/popup = new(usr, "saveexport", "Save Export", 350, 380, src) + popup.set_content({" +
[html_encode(save_json)]+ "}) + popup.open() diff --git a/librust_g.so b/librust_g.so index 239f12d713..39741283e3 100644 Binary files a/librust_g.so and b/librust_g.so differ diff --git a/rust_g.dll b/rust_g.dll index ebb6c9fd19..eef51dd2ef 100644 Binary files a/rust_g.dll and b/rust_g.dll differ diff --git a/vorestation.dme b/vorestation.dme index ac7e2ca1b3..df23ab35e6 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -84,6 +84,7 @@ #include "code\__defines\research.dm" #include "code\__defines\roguemining_vr.dm" #include "code\__defines\rust_g.dm" +#include "code\__defines\rust_g_yw.dm" #include "code\__defines\shadekin.dm" #include "code\__defines\shields.dm" #include "code\__defines\shuttle.dm"