diff --git a/assets/graphics/fpsbg.pdn b/assets/graphics/fpsbg.pdn new file mode 100644 index 00000000..0002053e Binary files /dev/null and b/assets/graphics/fpsbg.pdn differ diff --git a/game/marble/client/scripts/default.bind.cs b/game/marble/client/scripts/default.bind.cs index 243856b1..d61b65f1 100644 --- a/game/marble/client/scripts/default.bind.cs +++ b/game/marble/client/scripts/default.bind.cs @@ -446,8 +446,10 @@ function toggleFPSDisplay(%val) setMvExtras(); if (%val) $showFPS = !$showFPS; - + + HUD_FPSBG.update(); FPSDisplay.update(); + PingDisplay.update(); } //------------------------------------------------------------------------------ diff --git a/game/marble/client/ui/RootGui.gui b/game/marble/client/ui/RootGui.gui index 96173ff4..a75d75db 100644 --- a/game/marble/client/ui/RootGui.gui +++ b/game/marble/client/ui/RootGui.gui @@ -69,16 +69,41 @@ new GuiControl(RootGui) { visible = "1"; }; - new GuiTextCtrl(FPSDisplay) { - Profile = "TextTitleProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "5 0"; - extent = "1120 80"; + new GuiBitmapCtrl(HUD_FPSBG) { + profile = "GuiDefaultProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "0 -10"; + extent = "200 128"; minExtent = "8 8"; - text = "FPS: "; - Visible = "0"; + visible = "0"; + bitmap = "./fpsbg.png"; + wrap = "0"; + helpTag = "0"; + + new GuiTextCtrl(FPSDisplay) { + Profile = "TextHeadingSmallNoShadeProfile"; + horizSizing = "relative"; + vertSizing = "relative"; + position = "40 -15"; + extent = "1120 80"; + minExtent = "8 8"; + text = "FPS: "; + Visible = "0"; + }; + new GuiTextCtrl(PingDisplay) { + Profile = "TextHeadingSmallNoShadeProfile"; + horizSizing = "relative"; + vertSizing = "relative"; + position = "40 25"; + extent = "1120 80"; + minExtent = "8 8"; + text = "Ping: "; + Visible = "0"; + }; }; + + }; new GuiControl(RootCenterCtrl) { @@ -481,7 +506,9 @@ function RootGui::show(%this) RootCenterCtrl.resize(%offsetX,%offsetY,%w,%h); } + HUD_FPSBG.update(); FPSDisplay.update(); + PingDisplay.update(); } function RootGui::removeContent(%this) @@ -768,6 +795,22 @@ function RootBackgroundBitmaps::setVisible(%this,%vis) RootBackgroundOverlay.setVisible(%vis); } +function HUD_FPSBG::update(%this) +{ + // make sure periodic event is scheduled + if (!isEventPending(%this.periodicUpdate)) + %this.periodicUpdate = %this.schedule(1000, update); + + if ($showFPS) + { + %this.setVisible(true); + } + else + { + %this.setVisible(false); + } +} + function FPSDisplay::update(%this) { // make sure periodic event is scheduled @@ -776,7 +819,7 @@ function FPSDisplay::update(%this) if ($showFPS) { - %text = "FPS: " @ $fps::virtual @ " Ping: " @ ServerConnection.getPing(); + %text = $fps::virtual; %this.setText(%text); %this.setVisible(true); } @@ -785,3 +828,21 @@ function FPSDisplay::update(%this) %this.setVisible(false); } } + +function PingDisplay::update(%this) +{ + // make sure periodic event is scheduled + if (!isEventPending(%this.periodicUpdate)) + %this.periodicUpdate = %this.schedule(1000, update); + + if ($showFPS) + { + %text = ServerConnection.getPing(); + %this.setText(%text); + %this.setVisible(true); + } + else + { + %this.setVisible(false); + } +} \ No newline at end of file diff --git a/game/marble/client/ui/difficultySelectGui.gui b/game/marble/client/ui/difficultySelectGui.gui index d84be6a3..b95bd8a2 100644 --- a/game/marble/client/ui/difficultySelectGui.gui +++ b/game/marble/client/ui/difficultySelectGui.gui @@ -47,6 +47,13 @@ function DifficultySelectGui::onA(%this) case 4: GameMissionInfo.setMode(GameMissionInfo.SPMode); $Game::SPGemHunt = true; + $Game::SPGemHuntSeeded = true; + $Game::SPGemHuntSeed = 100; + RootGui.setContent(LevelPreviewGui); + case 5: + GameMissionInfo.setMode(GameMissionInfo.SPMode); + $Game::SPGemHunt = true; + $Game::SPGemHuntSeeded = false; RootGui.setContent(LevelPreviewGui); } @@ -75,7 +82,8 @@ function DifficultySelectGui::show(%this, %fromGui) DifficultyMenu.addRow($Text::LevelsAdvanced, 2, 20, 2); if (%hasCustom) DifficultyMenu.addRow($Text::LevelsCustom, 3, 20, 2); - DifficultyMenu.addRow($Text::SPGemHunt, 4, 0, 2); + DifficultyMenu.addRow($Text::SPGemHunt SPC "(Seeded)", 4, 0, 2); + DifficultyMenu.addRow($Text::SPGemHunt SPC "(Random)", 5, 0, 2); RootGui.setTitle($Text::DifficultyMenu); if ($pref::UI::LegacyUI) diff --git a/game/marble/client/ui/fpsbg.png b/game/marble/client/ui/fpsbg.png new file mode 100644 index 00000000..9b2c3d6f Binary files /dev/null and b/game/marble/client/ui/fpsbg.png differ diff --git a/game/marble/server/scripts/game.cs b/game/marble/server/scripts/game.cs index f727ab3d..ca6df1a0 100644 --- a/game/marble/server/scripts/game.cs +++ b/game/marble/server/scripts/game.cs @@ -174,12 +174,13 @@ function onMissionReset() function initRandomSpawnPoints() { - $Game::UseDetermSpawn = $Game::SPGemHunt && MissionInfo.gameMode $= "Scrum"; + $Game::UseDetermSpawn = $Game::SPGemHunt && MissionInfo.gameMode $= "Scrum" && $Game::SPGemHuntSeeded; + $Game::DetermSpawnSeed = $Game::SPGemHuntSeed; if ($Game::UseDetermSpawn) { $Game::SpawnRandFunction = getDetermRandom; - setDetermRandomSeed(100); + setDetermRandomSeed($Game::DetermSpawnSeed); } else { @@ -189,7 +190,7 @@ function initRandomSpawnPoints() if ($Game::UseDetermSpawn) { $Game::PlayerSpawnRandFunction = getDetermRandom2; - setDetermRandom2Seed(100); + setDetermRandom2Seed($Game::DetermSpawnSeed); } else {