Merge branch 'main' into party

This commit is contained in:
WantedDV
2023-04-21 11:04:15 -02:30
33 changed files with 2928 additions and 2287 deletions

View File

@ -3,11 +3,9 @@
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#insert scripts\shared\shared.gsh;
#namespace serversettings;
REGISTER_SYSTEM( "serversettings", &__init__, undefined )
function autoexec __init__sytem__() { system::register("serversettings",&__init__,undefined,undefined); }
function __init__()
{
@ -21,26 +19,29 @@ function init()
level.hostname = "CoDHost";
SetDvar("sv_hostname", level.hostname);
SetDvar("ui_hostname", level.hostname);
//makeDvarServerInfo("ui_hostname", "CoDHost");
level.motd = GetDvarString( "scr_motd" );
if(level.motd == "")
level.motd = "";
SetDvar("scr_motd", level.motd);
SetDvar("ui_motd", level.motd);
//makeDvarServerInfo("ui_motd", "");
level.allowvote = GetDvarString( "g_allowvote");
level.allowvote = GetDvarString( "g_allowvote" );
if(level.allowvote == "")
level.allowvote = "1";
SetDvar("g_allowvote", level.allowvote);
SetDvar("ui_allowvote", level.allowvote);
//makeDvarServerInfo("ui_allowvote", "1");
level.allow_teamchange = "1";
SetDvar("ui_allow_teamchange", level.allow_teamchange);
level.friendlyfire = GetGametypeSetting( "friendlyfiretype" );
SetDvar("ui_friendlyfire", level.friendlyfire);
//makeDvarServerInfo("ui_friendlyfire", "0");
if(GetDvarString( "scr_mapsize") == "")
SetDvar("scr_mapsize", "64");
@ -56,6 +57,8 @@ function init()
constrain_gametype(GetDvarString( "g_gametype"));
constrain_map_size(level.mapsize);
thread setup_callbacks();
for(;;)
{
@ -80,7 +83,7 @@ function update()
SetDvar("ui_motd", level.motd);
}
g_allowvote = GetDvarString( "g_allowvote");
g_allowvote = GetDvarString( "g_allowvote" );
if(level.allowvote != g_allowvote)
{
level.allowvote = g_allowvote;
@ -193,4 +196,14 @@ function constrain_map_size(mapsize)
}
}
}
}
function setup_callbacks()
{
level.onForfeit = &default_onForfeit;
}
function default_onForfeit()
{
level.gameForfeited = false;
}

View File

@ -70,5 +70,6 @@ DataSources.StartMenuGameOptions = ListHelper_SetupDataSource("StartMenuGameOpti
table.insert(options, {models = {displayText = "MENU_QUIT_GAME_CAPS", action = QuitGame_MP}})
end
end
table.insert(options, {models = {displayText = "QUIT TO DESKTOP", action = OpenPCQuit}})
return options
end, true)

View File

@ -20,7 +20,7 @@ DataSources.MPStatsSettings = DataSourceHelpers.ListSetup("MPStatsSettings", fun
table.insert(optionsTable,
CoD.OptionsUtility.CreateDvarSettings(controller, "Unlock All Loot",
"Whether loot should be locked based on the player's stats or always unlocked.", "MPStatsSettings_unlock_loot",
"Unlocks all Black Market loot.", "MPStatsSettings_unlock_loot",
"cg_unlockall_loot", {
{
option = "MENU_DISABLED",
@ -47,6 +47,20 @@ DataSources.MPStatsSettings = DataSourceHelpers.ListSetup("MPStatsSettings", fun
value = 1
},
}, nil, updateDvar))
table.insert(optionsTable,
CoD.OptionsUtility.CreateDvarSettings(controller, "Unlock All Class Slots",
"Unlocks all create-a-class slots and sets.", "MPStatsSettings_unlockall_cac_slots",
"cg_unlockall_cac_slots", {
{
option = "MENU_DISABLED",
value = 0,
default = true
},
{
option = "MENU_ENABLED",
value = 1
},
}, nil, updateDvar))
end
table.insert(optionsTable,
CoD.OptionsUtility.CreateDvarSettings(controller, "Unlock All Attachments",