Commit a508a3e024cb2b922e69cb22c2eed88241b5dc52

Authored by DarkGod
1 parent f3ee1edd

frell me

... ... @@ -85,12 +85,20 @@ disable_all_connectivity = true
85 85 upload_charsheet = true
86 86 upgrades { v1_0_5=true }
87 87 ]]
  88 +local loaded_config_files = {}
88 89 for i, file in ipairs(fs.list("/settings/")) do
89 90 if file:find(".cfg$") then
90 91 config.load("/settings/"..file)
  92 + loaded_config_files[file] = true
91 93 end
92 94 end
93 95
  96 +-- Keep the same setting when upgrading
  97 +-- What a FRELLING MESS
  98 +if not loaded_config_files["disable_all_connectivity.cfg"] and not config.settings.firstrun_gdpr then
  99 + config.settings.disable_all_connectivity = false
  100 +end
  101 +
94 102 if config.settings.disable_all_connectivity then
95 103 core.game.disableConnectivity()
96 104 local function void(t) for _, k in ipairs(table.keys(t)) do t[k] = nil end end
... ...
... ... @@ -559,7 +559,7 @@ You will also have a user page on #LIGHT_BLUE#https://te4.org/#LAST# to show off
559 559 This is all optional, you are not forced to use this feature at all, but the developer would thank you if you did as it will make balancing easier.]]
560 560
561 561 function _M:checkFirstTime()
562   - if not profile.generic.firstrun and not core.steam then
  562 + if not profile.generic.firstrun then
563 563 local d = require("mod.dialogs.FirstRun").new(profile_help_text)
564 564 local mm = self.dialogs[#self.dialogs]
565 565 self:unregisterDialog(mm)
... ... @@ -570,11 +570,18 @@ end
570 570
571 571 function _M:checkBootLoginRegister()
572 572 if __module_extra_info.boot_and_register then
573   - local dialogdef = {}
574   - dialogdef.fct = function(login) self:setPlayerLogin(login) end
575   - dialogdef.name = "creation"
576   - dialogdef.justlogin = false
577   - game:registerDialog(require('mod.dialogs.ProfileLogin').new(dialogdef, game.profile_help_text))
  573 + if core.steam then
  574 + local mm = self.dialogs[#self.dialogs]
  575 + if mm and mm:isClassName("mod.dialogs.MainMenu") then
  576 + mm:loginSteam()
  577 + end
  578 + else
  579 + local dialogdef = {}
  580 + dialogdef.fct = function(login) self:setPlayerLogin(login) end
  581 + dialogdef.name = "creation"
  582 + dialogdef.justlogin = false
  583 + game:registerDialog(require('mod.dialogs.ProfileLogin').new(dialogdef, game.profile_help_text))
  584 + end
578 585 end
579 586 end
580 587
... ...
... ... @@ -27,7 +27,7 @@ local Textzone = require "engine.ui.Textzone"
27 27 module(..., package.seeall, class.inherit(Dialog))
28 28
29 29 function _M:init()
30   - Dialog.init(self, "Steam User Account", 500, 400)
  30 + Dialog.init(self, "Steam User Account", math.min(800, game.w * 0.9), 400)
31 31 self.alpha = 230
32 32
33 33 self.c_desc = Textzone.new{width=math.floor(self.iw - 10), auto_height=true, text=[[Welcome to #GOLD#Tales of Maj'Eyal#LAST#.
... ... @@ -43,8 +43,8 @@ Luckily this is very easy to do: you only require a profile name and optionally
43 43
44 44 self.c_login = Textbox.new{title="Username: ", text="", chars=30, max_len=20, fct=function(text) self:okclick() end}
45 45 self.c_email = Textbox.new{title="Email: ", size_title=self.c_login.title, text="", chars=30, max_len=60, fct=function(text) self:okclick() end}
46   - self.c_news = Checkbox.new{title="Accept to receive #{bold}#very infrequent#{normal}# (a few per year) mails", default=false, fct=function() self:okclick() end}
47   - self.c_news2 = Textzone.new{text="about important game events from us.", width=self.iw - 20, auto_height=true}
  46 + self.c_news = Checkbox.new{title="Accept to receive #{bold}#very infrequent#{normal}# (a few per year) mails about important game events from us.", default=false, fct=function() self:okclick() end}
  47 + self.c_age = Checkbox.new{title="You at least 16 years old, or have parental authorization to play the game.", default=false, fct=function() self:okclick() end}
48 48 local ok = require("engine.ui.Button").new{text="Register", fct=function() self:okclick() end}
49 49 local cancel = require("engine.ui.Button").new{text="Cancel", fct=function() self:cancelclick() end}
50 50 local privacy = require("engine.ui.Button").new{text="Privacy Policy (opens in browser)", fct=function() self:privacypolicy() end}
... ... @@ -53,7 +53,7 @@ Luckily this is very easy to do: you only require a profile name and optionally
53 53 {left=0, top=self.c_desc.h, ui=self.c_login},
54 54 {left=0, top=self.c_desc.h+self.c_login.h+5, ui=self.c_email},
55 55 {left=0, top=self.c_desc.h+self.c_login.h+self.c_email.h+5, ui=self.c_news},
56   - {left=0, top=self.c_desc.h+self.c_login.h+self.c_email.h+self.c_news.h+5, ui=self.c_news2},
  56 + {left=0, top=self.c_desc.h+self.c_login.h+self.c_email.h+self.c_news.h+5, ui=self.c_age},
57 57 {left=0, bottom=0, ui=ok},
58 58 {right=0, bottom=0, ui=cancel},
59 59 {hcenter=0, bottom=0, ui=privacy},
... ... @@ -76,7 +76,11 @@ function _M:okclick()
76 76 self:simplePopup("Email", "Your email does not look right.")
77 77 return
78 78 end
79   -
  79 + if not self.c_age.checked then
  80 + self:simplePopup("Age Check", "You need to be 16 years old or more or to have parental authorization to play this game.")
  81 + return
  82 + end
  83 +
80 84 local d = self:simpleWaiter("Registering...", "Registering on https://te4.org/, please wait...") core.display.forceRedraw()
81 85 d:timeout(30, function() Dialog:simplePopup("Steam", "Steam client not found.") end)
82 86 core.steam.sessionTicket(function(ticket)
... ...