Commit dac6edc4a24e6ae95e6939c274f799e4b7d12f4b

Authored by DarkGod
1 parent c4cc5340

FRELL ME

  1 +-- TE4 - T-Engine 4
  2 +-- Copyright (C) 2009 - 2018 Nicolas Casalini
  3 +--
  4 +-- This program is free software: you can redistribute it and/or modify
  5 +-- it under the terms of the GNU General Public License as published by
  6 +-- the Free Software Foundation, either version 3 of the License, or
  7 +-- (at your option) any later version.
  8 +--
  9 +-- This program is distributed in the hope that it will be useful,
  10 +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +-- GNU General Public License for more details.
  13 +--
  14 +-- You should have received a copy of the GNU General Public License
  15 +-- along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +--
  17 +-- Nicolas Casalini "DarkGod"
  18 +-- darkgod@te4.org
  19 +
  20 +require "engine.class"
  21 +local Module = require "engine.Module"
  22 +local Dialog = require "engine.ui.Dialog"
  23 +local List = require "engine.ui.List"
  24 +local Textzone = require "engine.ui.Textzone"
  25 +local Separator = require "engine.ui.Separator"
  26 +local Button = require "engine.ui.Button"
  27 +
  28 +module(..., package.seeall, class.inherit(Dialog))
  29 +
  30 +function _M:init(text)
  31 + Dialog.init(self, "Welcome to Tales of Maj'Eyal", math.min(800, game.w * 0.9), 200)
  32 +
  33 + local c_desc = Textzone.new{width=self.iw, auto_height=true, text=text}
  34 +
  35 + local c_register = Button.new{text="Register now!", fct=function() self:doRegister() end}
  36 + local c_login = Button.new{text="Login existing account", fct=function() self:doLogin() end}
  37 + local c_later = Button.new{text="Maybe later", fct=function() self:doLater() end}
  38 + local c_disable = Button.new{text="#RED#Disable all online features", fct=function() self:doDisable() end}
  39 +
  40 + self:loadUI{
  41 + {left=0, top=0, ui=c_desc},
  42 + {left=0, bottom=0, ui=c_register},
  43 + {left=c_register, bottom=0, ui=c_login},
  44 + {right=0, bottom=0, ui=c_later},
  45 + {right=c_later, bottom=0, ui=c_disable},
  46 + }
  47 + self:setupUI(false, true)
  48 +end
  49 +
  50 +function _M:doDisable()
  51 + Dialog:yesnoLongPopup("Disable all connectivity", [[You are about to disable all connectivity to the network.
  52 +This includes, but is not limited to:
  53 +- Player profiles: You will not be able to login, register
  54 +- Characters vault: You will not be able to upload any character to the online vault to show your glory
  55 +- Item's Vault: You will not be able to access the online item's vault, this includes both storing and retrieving items.
  56 +- Ingame chat: The ingame chat requires to connect to the server to talk to other players, this will not be possible.
  57 +- Purchaser / Donator benefits: The base game being free, the only way to give donators their bonuses fairly is to check their online profile. This will thus be disabled.
  58 +- Easy addons downloading & installation: You will not be able to see ingame the list of available addons, nor to one-click install them. You may still do so manually.
  59 +- Version checks: Addons will not be checked for new versions.
  60 +- Discord: If you are a Discord user, Rich Presence integration will also be disabled by this setting.
  61 +- Ingame game news: The main menu will stop showing you info about new updates to the game.
  62 +
  63 +#{bold}##CRIMSON#This is an extremely restrictive setting. It is recommended you only activate it if you have no other choice as it will remove many fun and acclaimed features.#{normal}#
  64 +
  65 +If you disable this option you can always re-activate it in the Online category of the Game Options menu later on.]], self.iw, function(ret) if not ret then
  66 + profile:checkFirstRun()
  67 + game:saveSettings("disable_all_connectivity", ("disable_all_connectivity = true\n"))
  68 + game:saveSettings("firstrun_gdpr", ("firstrun_gdpr = true\n"))
  69 + util.showMainMenu()
  70 + end end, "Cancel", "#RED#Disable all!", true)
  71 +end
  72 +
  73 +function _M:doLater()
  74 + profile:checkFirstRun()
  75 + game:saveSettings("disable_all_connectivity", ("disable_all_connectivity = false\n"))
  76 + game:saveSettings("firstrun_gdpr", ("firstrun_gdpr = false\n"))
  77 + util.showMainMenu()
  78 +end
  79 +
  80 +function _M:doLogin()
  81 + profile:checkFirstRun()
  82 + game:saveSettings("disable_all_connectivity", ("disable_all_connectivity = false\n"))
  83 + game:saveSettings("firstrun_gdpr", ("firstrun_gdpr = false\n"))
  84 + util.showMainMenu()
  85 + -- util.showMainMenu(false, nil, nil, nil, nil, nil, "boot_and_login=true", nil)
  86 +end
  87 +
  88 +function _M:doRegister()
  89 + profile:checkFirstRun()
  90 + game:saveSettings("disable_all_connectivity", ("disable_all_connectivity = false\n"))
  91 + game:saveSettings("firstrun_gdpr", ("firstrun_gdpr = false\n"))
  92 + util.showMainMenu(false, nil, nil, nil, nil, nil, "boot_and_register=true", nil)
  93 +end
... ...