frontend checks

This commit is contained in:
mjkzy 2022-07-03 11:43:10 -05:00
parent d2c391cb91
commit c0e5f3d5fe

View File

@ -1,3 +1,7 @@
if (game:issingleplayer() or not Engine.InFrontend()) then
return
end
custom_depot = { custom_depot = {
collection_details_menu = nil, collection_details_menu = nil,
data = { data = {
@ -11,7 +15,7 @@ custom_depot = {
items = {}, items = {},
reward_splashes = {}, reward_splashes = {},
has_accepted_mod_eula = false, has_accepted_mod_eula = false,
has_seen_mod_eula = false, has_seen_mod_eula = false
}, },
directory_path = "h1-mod", directory_path = "h1-mod",
file_name = "depot_save.json", file_name = "depot_save.json",
@ -48,11 +52,13 @@ custom_depot.functions["load_depot_data"] = function()
end end
custom_depot.functions["add_currency"] = function(currency_type, amount) custom_depot.functions["add_currency"] = function(currency_type, amount)
custom_depot.data.currencies[tostring(currency_type)] = custom_depot.data.currencies[tostring(currency_type)] + amount custom_depot.data.currencies[tostring(currency_type)] = custom_depot.data.currencies[tostring(currency_type)] +
amount
end end
custom_depot.functions["remove_currency"] = function(currency_type, amount) custom_depot.functions["remove_currency"] = function(currency_type, amount)
custom_depot.data.currencies[tostring(currency_type)] = custom_depot.data.currencies[tostring(currency_type)] - amount custom_depot.data.currencies[tostring(currency_type)] = custom_depot.data.currencies[tostring(currency_type)] -
amount
end end
custom_depot.functions["get_currency"] = function(currency_type) custom_depot.functions["get_currency"] = function(currency_type)
@ -98,6 +104,12 @@ custom_depot.functions["set_has_seen_mod_eula"] = function(value)
end end
custom_depot.get_function("load_depot_data")() custom_depot.get_function("load_depot_data")()
require("mod_eula")
require("depot_override") if (Engine.InFrontend()) then
require("scoreboard_override") require("mod_eula")
require("depot_override")
end
if (Engine.InFrontend() == false) then
require("scoreboard_override")
end