diff --git a/game/engines/default/engine/init.lua b/game/engines/default/engine/init.lua index 616b60d2edb7af0fabf0509e760f42d917d78cd9..dc59f42f1918ec81e5226ffa12e5d34b3ed1c89f 100644 --- a/game/engines/default/engine/init.lua +++ b/game/engines/default/engine/init.lua @@ -82,6 +82,7 @@ chat.ignores = {} addons = {} allow_online_events = true disable_all_connectivity = false +upload_charsheet = true upgrades { v1_0_5=true } ]] for i, file in ipairs(fs.list("/settings/")) do diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 914d1d13c331bf2be70c6a3eeef4ac30a8040e6d..de9e8761cfcc9256ce7a563b74c0ecd77e3aacb9 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -2659,7 +2659,7 @@ function _M:saveGame() -- savefile_pipe is created as a global by the engine local clone = savefile_pipe:push(self.save_name, "game", self) world:saveWorld() - if not self.creating_player then + if not self.creating_player and config.settings.tome.upload_charsheet then local oldplayer = self.player self.party:setPlayer(self:getPlayer(true), true) diff --git a/game/modules/tome/dialogs/CharacterSheet.lua b/game/modules/tome/dialogs/CharacterSheet.lua index 94e7e79975aff4603d8190ca2f7111df3fc6e8a4..800c1be3f330369013f54b8d16742854c623d119 100644 --- a/game/modules/tome/dialogs/CharacterSheet.lua +++ b/game/modules/tome/dialogs/CharacterSheet.lua @@ -477,7 +477,7 @@ function _M:drawDialog(kind, actor_to_compare) local text = "" local dur_text = "" - if player.__te4_uuid and profile.auth and profile.auth.drupid and not config.settings.disable_all_connectivity then + if player.__te4_uuid and profile.auth and profile.auth.drupid and not config.settings.disable_all_connectivity and config.settings.tome.upload_charsheet then local path = "https://te4.org/characters/"..profile.auth.drupid.."/tome/"..player.__te4_uuid local LinkTxt = "Online URL: #LIGHT_BLUE##{underline}#"..path.."#{normal}#" local Link_w, Link_h = self.font:size(LinkTxt) diff --git a/game/modules/tome/dialogs/GameOptions.lua b/game/modules/tome/dialogs/GameOptions.lua index 3b1e30cf80b5422a8d5a1001c2965def50149c9d..e16e637bf5d8c795c8e105c4ebfe7041b31d1daa 100644 --- a/game/modules/tome/dialogs/GameOptions.lua +++ b/game/modules/tome/dialogs/GameOptions.lua @@ -586,6 +586,16 @@ function _M:generateListOnline() self.c_list:drawItem(item) end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Keep a copy of your character sheets (not the whole savefile) on the online vault at te4.org.\nFor each characters you will be given a link to this online character sheet so that you drag about your heroic deeds or sad deaths to your friends or the whole community.#WHITE#"} + list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Upload characters sheets to the online vault#WHITE##{normal}#", status=function(item) + return tostring(config.settings.upload_charsheet and "enabled" or "disabled") + end, fct=function(item) + config.settings.upload_charsheet = not config.settings.upload_charsheet + game:saveSettings("tome.upload_charsheet", ("tome.upload_charsheet = %s\n"):format(tostring(config.settings.upload_charsheet))) + self.c_list:drawItem(item) + + end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Allow various events that are pushed by the server when playing online\n#{bold}#All#{normal}#: Allow all server events (bonus zones, random events, ...)\n#{bold}#Technical help only#{normal}#: Allow administrator to help in case of bugs or weirdness and allows website services (data reset, steam achievements push, ...) to work.\n#{bold}#Disabled#{normal}#: Disallow all.\n#WHITE#"} list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Allow online events#WHITE##{normal}#", status=function(item) return tostring(config.settings.allow_online_events == true and "all" or (config.settings.allow_online_events == "limited" and "technical help only" or "disabled"))