Skip to content

Commit

Permalink
feat: unify forge and UFO mode into a single feature (#35)
Browse files Browse the repository at this point in the history
* feat: add xyz to forge hud elements
* new controls for forge
* combine UFO and forge modes together
  • Loading branch information
michaeloliverx authored Oct 25, 2024
1 parent f7f5bdc commit 6a4443f
Show file tree
Hide file tree
Showing 2 changed files with 285 additions and 202 deletions.
39 changes: 8 additions & 31 deletions mod/maps/mp/gametypes/dom.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ onPlayerSpawned()
self waittill("spawned_player");

self.cj["settings"]["forge"] = false;
self.cj["settings"]["ufo_mode"] = false;

self thread ammoCheck();
self thread setupLoadout();
Expand Down Expand Up @@ -204,7 +203,6 @@ initMenuOpts()
self addOpt("main", "Game Objects Menu", ::subMenu, "menu_game_objects");

self addMenu("menu_game_objects", "Game Objects Menu", "main");
self addOpt("menu_game_objects", "Forge mode", ::forgestart);
self addOpt("menu_game_objects", "Spawn Object", ::subMenu, "menu_game_objects_spawn");
self addMenu("menu_game_objects_spawn", "Spawn Object", "menu_game_objects");

Expand Down Expand Up @@ -416,7 +414,7 @@ watchUseButtonPressed()

for(;;)
{
if(!self.cj["settings"]["forge"] && !self.inMenu && self UseButtonPressed())
if(!self.inMenu && self UseButtonPressed())
{
catch_next = false;

Expand Down Expand Up @@ -629,7 +627,7 @@ watchSecondaryOffhandButtonPressed()

for(;;)
{
if(!self.cj["settings"]["forge"] && !self.inMenu && !self.cj["settings"]["ufo_mode"] && self secondaryOffhandButtonPressed())
if(self.sessionstate == "playing" && !self.inMenu && self secondaryOffhandButtonPressed())
{
self loadPos();
wait .1;
Expand All @@ -645,9 +643,13 @@ watchFragButtonPressed()

for(;;)
{
if(!self.cj["settings"]["forge"] && self FragButtonPressed())
if(self FragButtonPressed())
{
self thread toggleUFO();
if(self.sessionstate == "playing")
self thread forgestart();
else if(self.sessionstate == "spectator" && self.spectator_mode == "ufo")
self ufoend();

wait 0.5;
}

Expand Down Expand Up @@ -851,31 +853,6 @@ toggleThirdPerson()
}
}

toggleUFO()
{
setting = "ufo_mode";
printName = "UFO Mode";

if (!isdefined(self.cj["settings"][setting]) || self.cj["settings"][setting] == false)
{
self.cj["settings"][setting] = true;
self allowSpectateTeam("freelook", true);
self.sessionstate = "spectator";
wait 0.1;
self resetFOV();
self iPrintln(printName + " [^2ON^7]");
}
else
{
self.cj["settings"][setting] = false;
self allowSpectateTeam("freelook", false);
self.sessionstate = "playing";
wait 0.1;
self resetFOV();
self iPrintln(printName + " [^1OFF^7]");
}
}

togglePlayerNames()
{
setting = "cg_overheadnamessize";
Expand Down
Loading

0 comments on commit 6a4443f

Please sign in to comment.