summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20114d6)
raw | patch | inline | side by side (parent: 20114d6)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Wed, 13 Sep 2017 01:40:33 +0000 (04:40 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Wed, 13 Sep 2017 01:45:30 +0000 (04:45 +0300) |
src/game/g_game.pas | patch | blob | history | |
src/game/g_holmes.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index daec002afce309a4120acfbfcb4c574e38689d30..b0f64563e8cfd2ecb1a3ad1ef39aaebde48a7469 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
function g_Game_GetNextMap(): String;
procedure g_Game_NextLevel();
procedure g_Game_Pause(Enable: Boolean);
+procedure g_Game_HolmesPause(Enable: Boolean);
procedure g_Game_InGameMenu(Show: Boolean);
function g_Game_IsWatchedPlayer(UID: Word): Boolean;
function g_Game_IsWatchedTeam(Team: Byte): Boolean;
gServInterTime: Byte = 0;
gGameStartTime: LongWord = 0;
gTotalMonsters: Integer = 0;
- gPause: Boolean;
+ gPauseMain: Boolean = false;
+ gPauseHolmes: Boolean = false;
gShowTime: Boolean = True;
gShowFPS: Boolean = False;
gShowGoals: Boolean = True;
procedure g_AddDynLight (x, y, radius: Integer; r, g, b, a: Single);
procedure g_DynLightExplosion (x, y, radius: Integer; r, g, b: Single);
-function conIsCheatsEnabled (): Boolean;
+function conIsCheatsEnabled (): Boolean; inline;
+function gPause (): Boolean; inline;
implementation
// ////////////////////////////////////////////////////////////////////////// //
-function conIsCheatsEnabled (): Boolean;
+function gPause (): Boolean; inline; begin result := gPauseMain or gPauseHolmes; end;
+
+
+// ////////////////////////////////////////////////////////////////////////// //
+function conIsCheatsEnabled (): Boolean; inline;
begin
result := false;
- if (not gGameOn) or (not gCheats) or ((gGameSettings.GameType <> GT_SINGLE) and
- (gGameSettings.GameMode <> GM_COOP) and (not gDebugMode)) or g_Game_IsNet then exit;
+ if g_Game_IsNet then exit;
+ if not gDebugMode then
+ begin
+ if not gCheats then exit;
+ if not (gGameSettings.GameType in [GT_SINGLE, GT_CUSTOM]) then exit;
+ if (gGameSettings.GameMode <> GM_COOP) then exit;
+ end;
result := true;
end;
MH_SEND_GameEvent(NET_EV_MAPEND, Byte(gMissionFailed));
// Ñòîï èãðà:
- gPause := False;
- gGameOn := False;
+ gPauseMain := false;
+ gPauseHolmes := false;
+ gGameOn := false;
g_Game_StopAllSounds(False);
until FindNext(SR) <> 0;
FindClose(SR);
- gGameOn := False;
- gPause := False;
+ gGameOn := false;
+ gPauseMain := false;
+ gPauseHolmes := false;
gTime := 0;
LastScreenShot := 0;
end;
end;
- if gPause and gGameOn and (g_ActiveWindow = nil) then
+ if gPauseMain and gGameOn and (g_ActiveWindow = nil) then
begin
//e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
end;
gExit := 0;
- gPause := False;
+ gPauseMain := false;
+ gPauseHolmes := false;
gTime := 0;
NetTimeToUpdate := 1;
NetTimeToReliable := 0;
else if cmd = 'pause' then
begin
if (g_ActiveWindow = nil) then
- g_Game_Pause(not gPause);
+ g_Game_Pause(not gPauseMain);
end
else if cmd = 'endgame' then
gExit := EXIT_SIMPLE
end;
end;
-procedure g_Game_Pause(Enable: Boolean);
+procedure g_Game_Pause (Enable: Boolean);
+var
+ oldPause: Boolean;
begin
- if not gGameOn then
- Exit;
+ if not gGameOn then exit;
- if gPause = Enable then
- Exit;
+ if not (gGameSettings.GameType in [GT_SINGLE, GT_CUSTOM]) then exit;
- if not (gGameSettings.GameType in [GT_SINGLE, GT_CUSTOM]) then
- Exit;
+ oldPause := gPause;
+ gPauseMain := Enable;
+
+ if (gPause <> oldPause) then g_Game_PauseAllSounds(gPause);
+end;
+
+procedure g_Game_HolmesPause (Enable: Boolean);
+var
+ oldPause: Boolean;
+begin
+ if not gGameOn then exit;
+ if not (gGameSettings.GameType in [GT_SINGLE, GT_CUSTOM]) then exit;
+
+ oldPause := gPause;
+ gPauseHolmes := Enable;
- gPause := Enable;
- g_Game_PauseAllSounds(Enable);
+ if (gPause <> oldPause) then g_Game_PauseAllSounds(gPause);
end;
procedure g_Game_PauseAllSounds(Enable: Boolean);
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index e23d6c74722e265135164ee32d165f186f963d37..88edf86ca907be0d32fa0193a27b02e77fa02d65 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
var
he: THMouseEvent;
begin
+ if g_Game_IsNet then begin result := false; exit; end;
holmesInitCommands();
holmesInitBinds();
result := true;
end;
begin
+ if g_Game_IsNet then begin result := false; exit; end;
holmesInitCommands();
holmesInitBinds();
result := false;
// ////////////////////////////////////////////////////////////////////////// //
procedure g_Holmes_Draw ();
begin
+ if g_Game_IsNet then exit;
{$IF not DEFINED(HEADLESS)}
holmesInitCommands();
holmesInitBinds();
glDisable(GL_SCISSOR_TEST);
glDisable(GL_TEXTURE_2D);
- if gGameOn then
- begin
- plrDebugDraw();
- end;
+ if gGameOn then plrDebugDraw();
{$ENDIF}
laserSet := false;
procedure g_Holmes_DrawUI ();
begin
+ if g_Game_IsNet then exit;
{$IF not DEFINED(HEADLESS)}
glPushMatrix();
glScalef(g_holmes_ui_scale, g_holmes_ui_scale, 1.0);
procedure dbgToggleTraceBox (arg: Integer=-1); begin if (arg < 0) then showTraceBox := not showTraceBox else showTraceBox := (arg > 0); end;
+procedure dbgToggleHolmesPause (arg: Integer=-1); begin if (arg < 0) then g_Game_HolmesPause(not gPauseHolmes) else g_Game_HolmesPause(arg > 0); end;
+
procedure cbAtcurSelectMonster ();
function monsAtDump (mon: TMonster; tag: Integer): Boolean;
begin
cmdAdd('atcur_disable_walls', cbAtcurToggleWalls, 'disable walls', 'wall control');
cmdAdd('dbg_tracebox', dbgToggleTraceBox, 'test traceBox()', 'player control');
+
+ cmdAdd('hlm_pause', dbgToggleHolmesPause, '"Holmes" pause mode', 'game control');
end;
keybindAdd('C-1', 'mon_spawn zombie');
+ keybindAdd('C-S-P', 'hlm_pause');
+
// mouse
msbindAdd('LMB', 'atcur_select_monster');
msbindAdd('M-LMB', 'atcur_dump_monsters');