hedgewars/CCHandlers.inc
author unc0rr
Sun, 21 Nov 2010 19:14:45 +0300
changeset 4402 54a78ec6aac4
parent 4401 9cb6990af584
permissions -rw-r--r--
Remove uChat dependency from uCommands
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
     1
(*
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     2
* Hedgewars, a free turn based strategy game
3236
4ab3917d7d44 Update (c) lines to 2010 as unc0rr requested - they all had varying values so I just took the first year mentioned, then tacked on -2010
nemo
parents: 3006
diff changeset
     3
* Copyright (c) 2004-2010 Andrey Korotaev <unC0Rr@gmail.com>
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     4
*
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     5
* This program is free software; you can redistribute it and/or modify
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     6
* it under the terms of the GNU General Public License as published by
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     7
* the Free Software Foundation; version 2 of the License
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     8
*
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
     9
* This program is distributed in the hope that it will be useful,
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    12
* GNU General Public License for more details.
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    13
*
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    14
* You should have received a copy of the GNU General Public License
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    15
* along with this program; if not, write to the Free Software
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    17
*)
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    18
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    19
////////////////////////////////////////////////////////////////////////////////
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    20
procedure chQuit(var s: shortstring);
1022
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    21
const prevGState: TGameState = gsConfirm;
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    22
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
    23
s:= s; // avoid compiler hint
1022
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    24
if GameState <> gsConfirm then
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    25
        begin
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    26
        prevGState:= GameState;
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    27
        GameState:= gsConfirm
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    28
        end else
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    29
        GameState:= prevGState
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    30
end;
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    31
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    32
procedure chConfirm(var s: shortstring);
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    33
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
    34
s:= s; // avoid compiler hint
1022
f6a3fcb329ca Start exit confirmation implementation
unc0rr
parents: 991
diff changeset
    35
if GameState = gsConfirm then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    36
    begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    37
    SendIPC('Q');
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    38
    GameState:= gsExit
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    39
    end
2130
708758635955 Please don't take away my checkin privileges - Tiy asked me to keep working on this
nemo
parents: 2125
diff changeset
    40
else
4402
54a78ec6aac4 Remove uChat dependency from uCommands
unc0rr
parents: 4401
diff changeset
    41
    ParseCommand('chat team', true);
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    42
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    43
205
8d9aff55e6ab - Set version to 0.8
unc0rr
parents: 192
diff changeset
    44
procedure chCheckProto(var s: shortstring);
371
731ad6d27bd1 integer -> LongInt
unc0rr
parents: 358
diff changeset
    45
var i, c: LongInt;
205
8d9aff55e6ab - Set version to 0.8
unc0rr
parents: 192
diff changeset
    46
begin
8d9aff55e6ab - Set version to 0.8
unc0rr
parents: 192
diff changeset
    47
if isDeveloperMode then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    48
begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    49
val(s, i, c);
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    50
if (c <> 0) or (i = 0) then exit;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    51
TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old', true);
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    52
TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new', true)
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
    53
end
205
8d9aff55e6ab - Set version to 0.8
unc0rr
parents: 192
diff changeset
    54
end;
8d9aff55e6ab - Set version to 0.8
unc0rr
parents: 192
diff changeset
    55
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    56
procedure chTeamLocal(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    57
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
    58
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    59
if not isDeveloperMode then exit;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    60
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/rdriven"', true);
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
    61
CurrentTeam^.ExtDriven:= true
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    62
end;
3969
5f4ef3db0a65 Ok. Let's disable the right one this time. In fact, let's just remove newgrave entirely - no point in half-measures.
nemo
parents: 3968
diff changeset
    63
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    64
procedure chGrave(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    65
begin
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    66
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/grave"', true);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    67
if s[1]='"' then Delete(s, 1, 1);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    68
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
    69
CurrentTeam^.GraveName:= s
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    70
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    71
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    72
procedure chFort(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    73
begin
764
7513452b1d51 Now game looks almost like it did before switching to OpenGL
unc0rr
parents: 753
diff changeset
    74
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/fort"', true);
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    75
if s[1]='"' then Delete(s, 1, 1);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    76
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
    77
CurrentTeam^.FortName:= s
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    78
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
    79
2747
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    80
procedure chFlag(var s: shortstring);
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    81
begin
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    82
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/flag"', true);
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    83
if s[1]='"' then Delete(s, 1, 1);
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    84
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    85
CurrentTeam^.flag:= s
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    86
end;
7889a3a9724f Server:
smxx
parents: 2738
diff changeset
    87
2786
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    88
procedure chScript(var s: shortstring);
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    89
begin
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    90
if s[1]='"' then Delete(s, 1, 1);
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    91
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    92
ScriptLoad(s)
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    93
end;
85f6425a4d74 Engine:
smxx
parents: 2747
diff changeset
    94
1242
4aca5f7b2504 Hats now fully implemented for local game
unc0rr
parents: 1127
diff changeset
    95
procedure chSetHat(var s: shortstring);
4aca5f7b2504 Hats now fully implemented for local game
unc0rr
parents: 1127
diff changeset
    96
begin
4aca5f7b2504 Hats now fully implemented for local game
unc0rr
parents: 1127
diff changeset
    97
if (not isDeveloperMode) or (CurrentTeam = nil) then exit;
4aca5f7b2504 Hats now fully implemented for local game
unc0rr
parents: 1127
diff changeset
    98
with CurrentTeam^ do
2726
a84fc5113d01 Update translation files, add "King Mode"
nemo
parents: 2724
diff changeset
    99
    begin
a84fc5113d01 Update translation files, add "King Mode"
nemo
parents: 2724
diff changeset
   100
    if not CurrentHedgehog^.King then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   101
    if (s = '') or 
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   102
        (((GameFlags and gfKing) <> 0) and (s = 'crown')) or
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   103
        ((Length(s) > 39) and (Copy(s,1,8) = 'Reserved') and (Copy(s,9,32) <> PlayerHash)) then
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   104
        CurrentHedgehog^.Hat:= 'NoHat'
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   105
    else
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   106
        CurrentHedgehog^.Hat:= s
2726
a84fc5113d01 Update translation files, add "King Mode"
nemo
parents: 2724
diff changeset
   107
    end;
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   108
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   109
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   110
procedure chCurU_p(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   111
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   112
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   113
CursorMovementY:= -1;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   114
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   115
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   116
procedure chCurU_m(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   117
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   118
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   119
CursorMovementY:= 0;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   120
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   121
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   122
procedure chCurD_p(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   123
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   124
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   125
CursorMovementY:= 1;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   126
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   127
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   128
procedure chCurD_m(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   129
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   130
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   131
CursorMovementY:= 0;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   132
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   133
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   134
procedure chCurL_p(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   135
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   136
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   137
CursorMovementX:= -1;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   138
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   139
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   140
procedure chCurL_m(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   141
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   142
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   143
CursorMovementX:= 0;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   144
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   145
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   146
procedure chCurR_p(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   147
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   148
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   149
CursorMovementX:= 1;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   150
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   151
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   152
procedure chCurR_m(var s: shortstring);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   153
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   154
s:= s; // avoid compiler hint
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   155
CursorMovementX:= 0;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   156
end;
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2407
diff changeset
   157
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   158
procedure chLeft_p(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   159
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   160
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   161
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   162
if not CurrentTeam^.ExtDriven then SendIPC('L');
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   163
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   164
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   165
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   166
    Message:= Message or gmLeft
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   167
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   168
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   169
procedure chLeft_m(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   170
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   171
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   172
if CheckNoTeamOrHH then exit;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   173
if not CurrentTeam^.ExtDriven then SendIPC('l');
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   174
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   175
    Message:= Message and not gmLeft
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   176
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   177
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   178
procedure chRight_p(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   179
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   180
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   181
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   182
if not CurrentTeam^.ExtDriven then SendIPC('R');
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   183
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   184
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   185
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   186
    Message:= Message or gmRight
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   187
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   188
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   189
procedure chRight_m(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   190
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   191
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   192
if CheckNoTeamOrHH then exit;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   193
if not CurrentTeam^.ExtDriven then SendIPC('r');
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   194
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   195
    Message:= Message and not gmRight
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   196
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   197
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   198
procedure chUp_p(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   199
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   200
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   201
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   202
if not CurrentTeam^.ExtDriven then SendIPC('U');
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   203
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   204
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   205
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   206
    Message:= Message or gmUp
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   207
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   208
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   209
procedure chUp_m(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   210
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   211
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   212
if CheckNoTeamOrHH then exit;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   213
if not CurrentTeam^.ExtDriven then SendIPC('u');
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   214
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   215
    Message:= Message and not gmUp
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   216
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   217
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   218
procedure chDown_p(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   219
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   220
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   221
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   222
if not CurrentTeam^.ExtDriven then SendIPC('D');
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   223
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   224
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   225
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   226
    Message:= Message or gmDown
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   227
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   228
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   229
procedure chDown_m(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   230
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   231
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   232
if CheckNoTeamOrHH then exit;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   233
if not CurrentTeam^.ExtDriven then SendIPC('d');
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   234
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   235
    Message:= Message and not gmDown
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   236
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   237
1639
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   238
procedure chPrecise_p(var s: shortstring);
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   239
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   240
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   241
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   242
if not CurrentTeam^.ExtDriven then SendIPC('Z');
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   243
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
1639
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   244
bShowFinger:= false;
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   245
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   246
    Message:= Message or gmPrecise
1639
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   247
end;
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   248
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   249
procedure chPrecise_m(var s: shortstring);
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   250
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   251
s:= s; // avoid compiler hint
1639
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   252
if CheckNoTeamOrHH then exit;
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   253
if not CurrentTeam^.ExtDriven then SendIPC('z');
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   254
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   255
    Message:= Message and not gmPrecise
1639
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   256
end;
89b536a3cf3c Implement precise aiming when pressing left shift
unc0rr
parents: 1525
diff changeset
   257
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   258
procedure chLJump(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   259
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   260
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   261
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   262
if not CurrentTeam^.ExtDriven then SendIPC('j');
3797
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   263
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   264
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   265
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   266
    Message:= Message or gmLJump
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   267
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   268
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   269
procedure chHJump(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   270
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   271
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   272
if CheckNoTeamOrHH or isPaused then exit;
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   273
if not CurrentTeam^.ExtDriven then SendIPC('J');
3797
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   274
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   275
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   276
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   277
    Message:= Message or gmHJump
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   278
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   279
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   280
procedure chAttack_p(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   281
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   282
s:= s; // avoid compiler hint
3336
d7c1ffed1e15 Engine:
smxx
parents: 3236
diff changeset
   283
if CheckNoTeamOrHH or isPaused then exit;
3797
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   284
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   285
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   286
with CurrentHedgehog^.Gear^ do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   287
    begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   288
    {$IFDEF DEBUGFILE}AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));{$ENDIF}
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   289
    if ((State and gstHHDriven) <> 0) then
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   290
        begin
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   291
        FollowGear:= CurrentHedgehog^.Gear;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   292
        if not CurrentTeam^.ExtDriven then SendIPC('A');
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   293
        Message:= Message or gmAttack
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   294
        end
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   295
    end
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   296
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   297
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   298
procedure chAttack_m(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   299
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   300
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   301
if CheckNoTeamOrHH then exit;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   302
with CurrentHedgehog^.Gear^ do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   303
    begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   304
    if not CurrentTeam^.ExtDriven and
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   305
        ((Message and gmAttack) <> 0) then SendIPC('a');
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   306
    Message:= Message and not gmAttack
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   307
    end
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   308
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   309
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   310
procedure chSwitch(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   311
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   312
s:= s; // avoid compiler hint
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   313
if CheckNoTeamOrHH or isPaused then exit;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   314
if not CurrentTeam^.ExtDriven then SendIPC('S');
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   315
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   316
bShowFinger:= false;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   317
with CurrentHedgehog^.Gear^ do
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   318
    Message:= Message or gmSwitch
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   319
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   320
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   321
procedure chNextTurn(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   322
begin
3639
b5cdbcc89b61 use a button instead of label and simplify a lot touch interaction
koda
parents: 3638
diff changeset
   323
    s:= s; // avoid compiler hint
b5cdbcc89b61 use a button instead of label and simplify a lot touch interaction
koda
parents: 3638
diff changeset
   324
    TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
2046
57fb5673ff17 Oops, some debug stuff left
unc0rr
parents: 2045
diff changeset
   325
3639
b5cdbcc89b61 use a button instead of label and simplify a lot touch interaction
koda
parents: 3638
diff changeset
   326
    if not CurrentTeam^.ExtDriven then SendIPC('N');
b5cdbcc89b61 use a button instead of label and simplify a lot touch interaction
koda
parents: 3638
diff changeset
   327
{$IFDEF DEBUGFILE}
b5cdbcc89b61 use a button instead of label and simplify a lot touch interaction
koda
parents: 3638
diff changeset
   328
    AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));
b5cdbcc89b61 use a button instead of label and simplify a lot touch interaction
koda
parents: 3638
diff changeset
   329
{$ENDIF}
3935
5ca27a0e9a63 made the new menu toggable
koda
parents: 3928
diff changeset
   330
    perfExt_NewTurnBeginning();
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   331
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   332
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   333
procedure chTimer(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   334
begin
2314
953771a06c64 Better fix
unc0rr
parents: 2313
diff changeset
   335
if (s[0] <> #1) or (s[1] < '1') or (s[1] > '5') or CheckNoTeamOrHH then exit;
953771a06c64 Better fix
unc0rr
parents: 2313
diff changeset
   336
926
d231e007452a Timer as hedgehog message (avoid possible desync in very rare cases)
unc0rr
parents: 917
diff changeset
   337
if not CurrentTeam^.ExtDriven then SendIPC(s);
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   338
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   339
bShowFinger:= false;
926
d231e007452a Timer as hedgehog message (avoid possible desync in very rare cases)
unc0rr
parents: 917
diff changeset
   340
with CurrentHedgehog^.Gear^ do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   341
    begin
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   342
    Message:= Message or gmTimer;
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   343
    MsgParam:= byte(s[1]) - ord('0')
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   344
    end
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   345
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   346
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   347
procedure chSlot(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   348
var slot: LongWord;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   349
begin
95
1ef5e2c41115 - Fixed compilation
unc0rr
parents: 83
diff changeset
   350
if (s[0] <> #1) or CheckNoTeamOrHH then exit;
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   351
slot:= byte(s[1]) - 49;
10
edf56dca1587 - Mine weapon
unc0rr
parents: 4
diff changeset
   352
if slot > cMaxSlotIndex then exit;
351
29bc9c36ad5f Fixed-point arithmetics in engine.
unc0rr
parents: 324
diff changeset
   353
if not CurrentTeam^.ExtDriven then SendIPC(char(byte(s[1]) + 79));
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   354
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   355
bShowFinger:= false;
783
4f59db6f147d - New command 'set weapon'
unc0rr
parents: 764
diff changeset
   356
with CurrentHedgehog^.Gear^ do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   357
    begin
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   358
    Message:= Message or gmSlot;
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   359
    MsgParam:= slot
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   360
    end
783
4f59db6f147d - New command 'set weapon'
unc0rr
parents: 764
diff changeset
   361
end;
4f59db6f147d - New command 'set weapon'
unc0rr
parents: 764
diff changeset
   362
4f59db6f147d - New command 'set weapon'
unc0rr
parents: 764
diff changeset
   363
procedure chSetWeapon(var s: shortstring);
4f59db6f147d - New command 'set weapon'
unc0rr
parents: 764
diff changeset
   364
begin
3637
0db298524c3d implement the check on the type of ammo requiring a second tap to confirm
koda
parents: 3611
diff changeset
   365
    if (s[0] <> #1) or CheckNoTeamOrHH then exit;
784
b203147d91b5 - Handle new command in game record and net
unc0rr
parents: 783
diff changeset
   366
3637
0db298524c3d implement the check on the type of ammo requiring a second tap to confirm
koda
parents: 3611
diff changeset
   367
    if TAmmoType(s[1]) > High(TAmmoType) then exit;
784
b203147d91b5 - Handle new command in game record and net
unc0rr
parents: 783
diff changeset
   368
3637
0db298524c3d implement the check on the type of ammo requiring a second tap to confirm
koda
parents: 3611
diff changeset
   369
    if not CurrentTeam^.ExtDriven then SendIPC('w' + s);
784
b203147d91b5 - Handle new command in game record and net
unc0rr
parents: 783
diff changeset
   370
3637
0db298524c3d implement the check on the type of ammo requiring a second tap to confirm
koda
parents: 3611
diff changeset
   371
    with CurrentHedgehog^.Gear^ do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   372
    begin
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   373
        Message:= Message or gmWeapon;
3637
0db298524c3d implement the check on the type of ammo requiring a second tap to confirm
koda
parents: 3611
diff changeset
   374
        MsgParam:= byte(s[1]);
0db298524c3d implement the check on the type of ammo requiring a second tap to confirm
koda
parents: 3611
diff changeset
   375
    end;
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   376
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   377
1035
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   378
procedure chTaunt(var s: shortstring);
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   379
begin
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   380
if (s[0] <> #1) or CheckNoTeamOrHH then exit;
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   381
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   382
if TWave(s[1]) > High(TWave) then exit;
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   383
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   384
if not CurrentTeam^.ExtDriven then SendIPC('t' + s);
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   385
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   386
with CurrentHedgehog^.Gear^ do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   387
    begin
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   388
    Message:= Message or gmAnimate;
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   389
    MsgParam:= byte(s[1])
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   390
    end
1035
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   391
end;
6f5842bc481b Hopefully done taunts implementation
unc0rr
parents: 1022
diff changeset
   392
543
465e2ec8f05f - Better randomness of placing hedgehogs on the land
unc0rr
parents: 542
diff changeset
   393
procedure doPut(putX, putY: LongInt; fromAI: boolean);
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   394
begin
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   395
if CheckNoTeamOrHH or isPaused then exit;
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   396
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
3776
28849f5a03c9 Engine:
smaxx
parents: 3774
diff changeset
   397
bShowFinger:= false;
2963
0f0789204802 This might be all it takes to prevent the desync. needs local/remote testing. Also toggle 2nd barrel state on 0 movement
nemo
parents: 2962
diff changeset
   398
if not CurrentTeam^.ExtDriven and bShowAmmoMenu then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   399
    begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   400
    bSelected:= true;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   401
    exit
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   402
    end;
543
465e2ec8f05f - Better randomness of placing hedgehogs on the land
unc0rr
parents: 542
diff changeset
   403
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   404
with CurrentHedgehog^.Gear^,
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   405
    CurrentHedgehog^ do
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   406
    if (State and gstHHChooseTarget) <> 0 then
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   407
        begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   408
        isCursorVisible:= false;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   409
        if not CurrentTeam^.ExtDriven then
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   410
            begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   411
            if fromAI then
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   412
                begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   413
                TargetPoint.X:= putX;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   414
                TargetPoint.Y:= putY
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   415
                end else
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   416
                begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   417
                TargetPoint.X:= CursorPoint.X - WorldDx;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   418
                TargetPoint.Y:= cScreenHeight - CursorPoint.Y - WorldDy;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   419
                end;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   420
            SendIPCXY('p', TargetPoint.X, TargetPoint.Y);
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   421
            end
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   422
        else
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   423
            begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   424
            TargetPoint.X:= putX;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   425
            TargetPoint.Y:= putY
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   426
            end;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   427
        {$IFDEF DEBUGFILE}AddFilelog('put: ' + inttostr(TargetPoint.X) + ', ' + inttostr(TargetPoint.Y));{$ENDIF}
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   428
        State:= State and not gstHHChooseTarget;
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3797
diff changeset
   429
        if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackingPut) <> 0 then
3894
9abce5468583 Engine:
smaxx
parents: 3836
diff changeset
   430
            Message:= Message or gmAttack;
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   431
        end
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   432
    else
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   433
        if CurrentTeam^.ExtDriven then
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   434
            OutError('got /put while not being in choose target mode', false)
543
465e2ec8f05f - Better randomness of placing hedgehogs on the land
unc0rr
parents: 542
diff changeset
   435
end;
465e2ec8f05f - Better randomness of placing hedgehogs on the land
unc0rr
parents: 542
diff changeset
   436
465e2ec8f05f - Better randomness of placing hedgehogs on the land
unc0rr
parents: 542
diff changeset
   437
procedure chPut(var s: shortstring);
465e2ec8f05f - Better randomness of placing hedgehogs on the land
unc0rr
parents: 542
diff changeset
   438
begin
3638
33ee433749ba touch overlay reworked, improvements to zoom and confirmation
koda
parents: 3637
diff changeset
   439
    s:= s; // avoid compiler hint
33ee433749ba touch overlay reworked, improvements to zoom and confirmation
koda
parents: 3637
diff changeset
   440
    doPut(0, 0, false);
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   441
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   442
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   443
procedure chCapture(var s: shortstring);
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   444
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   445
s:= s; // avoid compiler hint
4
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   446
flagMakeCapture:= true
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   447
end;
bcbd7adb4e4b - set svn:eol-style to native
unc0rr
parents: 1
diff changeset
   448
55
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   449
procedure chSetMap(var s: shortstring);
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   450
begin
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   451
if isDeveloperMode then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   452
begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   453
Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   454
InitStepsFlags:= InitStepsFlags or cifMap
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   455
end
55
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   456
end;
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   457
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   458
procedure chSetTheme(var s: shortstring);
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   459
begin
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   460
if isDeveloperMode then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   461
begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   462
Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   463
InitStepsFlags:= InitStepsFlags or cifTheme
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   464
end
55
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   465
end;
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   466
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   467
procedure chSetSeed(var s: shortstring);
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   468
begin
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   469
if isDeveloperMode then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   470
begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   471
SetRandomSeed(s);
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   472
cSeed:= s;
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   473
InitStepsFlags:= InitStepsFlags or cifRandomize
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   474
end
55
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   475
end;
e09f7c952a40 Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents: 48
diff changeset
   476
161
d8870bbf960e - AmmoMenu
unc0rr
parents: 154
diff changeset
   477
procedure chAmmoMenu(var s: shortstring);
d8870bbf960e - AmmoMenu
unc0rr
parents: 154
diff changeset
   478
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   479
s:= s; // avoid compiler hint
3797
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   480
if CheckNoTeamOrHH then
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   481
    bShowAmmoMenu:= true
2855
7e6adeb57427 Show the ammo menu of the last local non-bot team when not local turn. needs testing
nemo
parents: 2853
diff changeset
   482
else
3797
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   483
    begin
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   484
    with CurrentTeam^ do
2855
7e6adeb57427 Show the ammo menu of the last local non-bot team when not local turn. needs testing
nemo
parents: 2853
diff changeset
   485
        with Hedgehogs[CurrHedgehog] do
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   486
            begin
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   487
            bSelected:= false;
682
a37b6966de84 Some misc fixes
unc0rr
parents: 626
diff changeset
   488
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   489
            if bShowAmmoMenu then bShowAmmoMenu:= false
3396
e5b3e5f2818e More portal changes. Allows for a multishoot utility. Hopefully not breaking anything.
nemo
parents: 3395
diff changeset
   490
            else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or 
4241
835fd7a0e1bf Move resurrection to utilities, reduce its probablit a bit to match other utilities, rename the "hint" prop since it really isn't being used as a hint anymore. That can be put back if it changes.
nemo
parents: 4210
diff changeset
   491
                    ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or
3396
e5b3e5f2818e More portal changes. Allows for a multishoot utility. Hopefully not breaking anything.
nemo
parents: 3395
diff changeset
   492
                    ((Gear^.State and gstHHDriven) = 0) then else bShowAmmoMenu:= true
3797
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   493
            end;
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   494
    if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1
e097914ac0e2 Engine:
smaxx
parents: 3796
diff changeset
   495
    end
161
d8870bbf960e - AmmoMenu
unc0rr
parents: 154
diff changeset
   496
end;
d8870bbf960e - AmmoMenu
unc0rr
parents: 154
diff changeset
   497
175
d226d976d836 - Some improvements to volume control
unc0rr
parents: 174
diff changeset
   498
procedure chVol_p(var s: shortstring);
174
0b2c5b22f644 Changeable volume
unc0rr
parents: 167
diff changeset
   499
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   500
s:= s; // avoid compiler hint
175
d226d976d836 - Some improvements to volume control
unc0rr
parents: 174
diff changeset
   501
inc(cVolumeDelta, 3)
174
0b2c5b22f644 Changeable volume
unc0rr
parents: 167
diff changeset
   502
end;
0b2c5b22f644 Changeable volume
unc0rr
parents: 167
diff changeset
   503
175
d226d976d836 - Some improvements to volume control
unc0rr
parents: 174
diff changeset
   504
procedure chVol_m(var s: shortstring);
174
0b2c5b22f644 Changeable volume
unc0rr
parents: 167
diff changeset
   505
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   506
s:= s; // avoid compiler hint
175
d226d976d836 - Some improvements to volume control
unc0rr
parents: 174
diff changeset
   507
dec(cVolumeDelta, 3)
174
0b2c5b22f644 Changeable volume
unc0rr
parents: 167
diff changeset
   508
end;
0b2c5b22f644 Changeable volume
unc0rr
parents: 167
diff changeset
   509
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   510
procedure chFindhh(var s: shortstring);
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   511
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   512
s:= s; // avoid compiler hint
3336
d7c1ffed1e15 Engine:
smxx
parents: 3236
diff changeset
   513
if CheckNoTeamOrHH or isPaused then exit;
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   514
bShowFinger:= true;
602
f7628ebfccde Add CurrentHedgehog variable which simplifies code
unc0rr
parents: 595
diff changeset
   515
FollowGear:= CurrentHedgehog^.Gear
176
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   516
end;
533d03041dcd 'h' marks out current hedgehog
unc0rr
parents: 175
diff changeset
   517
281
5b483aa9f2ab Pause support (mouse cursor is released when the game is paused)
unc0rr
parents: 263
diff changeset
   518
procedure chPause(var s: shortstring);
5b483aa9f2ab Pause support (mouse cursor is released when the game is paused)
unc0rr
parents: 263
diff changeset
   519
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   520
s:= s; // avoid compiler hint
3796
4ab6d6f78312 Engine:
smaxx
parents: 3776
diff changeset
   521
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
1743
ebc54f5fe4e7 Don't allow pause when playing online
unc0rr
parents: 1656
diff changeset
   522
if gameType <> gmtNet then
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   523
    isPaused:= not isPaused;
281
5b483aa9f2ab Pause support (mouse cursor is released when the game is paused)
unc0rr
parents: 263
diff changeset
   524
SDL_ShowCursor(ord(isPaused))
5b483aa9f2ab Pause support (mouse cursor is released when the game is paused)
unc0rr
parents: 263
diff changeset
   525
end;
539
6a9bf1852bbc Ability to choose which info is shown above hedgehogs
unc0rr
parents: 534
diff changeset
   526
6a9bf1852bbc Ability to choose which info is shown above hedgehogs
unc0rr
parents: 534
diff changeset
   527
procedure chRotateMask(var s: shortstring);
6a9bf1852bbc Ability to choose which info is shown above hedgehogs
unc0rr
parents: 534
diff changeset
   528
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   529
s:= s; // avoid compiler hint
2947
803b277e4894 hate Smaxx (tested)
unc0rr
parents: 2905
diff changeset
   530
if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask];
539
6a9bf1852bbc Ability to choose which info is shown above hedgehogs
unc0rr
parents: 534
diff changeset
   531
end;
6a9bf1852bbc Ability to choose which info is shown above hedgehogs
unc0rr
parents: 534
diff changeset
   532
626
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   533
procedure chSpeedup_p(var s: shortstring);
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   534
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   535
s:= s; // avoid compiler hint
626
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   536
isSpeed:= true
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   537
end;
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   538
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   539
procedure chSpeedup_m(var s: shortstring);
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   540
begin
3407
dcc129c4352e Engine:
smxx
parents: 3405
diff changeset
   541
s:= s; // avoid compiler hint
626
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   542
isSpeed:= false
a30171dbcd19 's' key to speed up demo playing
unc0rr
parents: 615
diff changeset
   543
end;
946
42c5cc87cbd1 Preparing to have gsChat gamestate
unc0rr
parents: 929
diff changeset
   544
2162
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   545
procedure chZoomIn(var s: shortstring);
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   546
begin
3523
6592fbb969da fix zoom smoothness
koda
parents: 3522
diff changeset
   547
    s:= s; // avoid compiler hint
3638
33ee433749ba touch overlay reworked, improvements to zoom and confirmation
koda
parents: 3637
diff changeset
   548
    if ZoomValue < cMinZoomLevel then
33ee433749ba touch overlay reworked, improvements to zoom and confirmation
koda
parents: 3637
diff changeset
   549
        ZoomValue:= ZoomValue + cZoomDelta;
2162
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   550
end;
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   551
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   552
procedure chZoomOut(var s: shortstring);
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   553
begin
3523
6592fbb969da fix zoom smoothness
koda
parents: 3522
diff changeset
   554
    s:= s; // avoid compiler hint
3638
33ee433749ba touch overlay reworked, improvements to zoom and confirmation
koda
parents: 3637
diff changeset
   555
    if ZoomValue > cMaxZoomLevel then
33ee433749ba touch overlay reworked, improvements to zoom and confirmation
koda
parents: 3637
diff changeset
   556
        ZoomValue:= ZoomValue - cZoomDelta;
2162
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   557
end;
2bce91404d49 - Implement zoom-in and zoom-out
unc0rr
parents: 2130
diff changeset
   558
2379
d62b1f224982 - Implement zoom reset
unc0rr
parents: 2373
diff changeset
   559
procedure chZoomReset(var s: shortstring);
d62b1f224982 - Implement zoom reset
unc0rr
parents: 2373
diff changeset
   560
begin
3523
6592fbb969da fix zoom smoothness
koda
parents: 3522
diff changeset
   561
    s:= s; // avoid compiler hint
6592fbb969da fix zoom smoothness
koda
parents: 3522
diff changeset
   562
    ZoomValue:= cDefaultZoomLevel;
2379
d62b1f224982 - Implement zoom reset
unc0rr
parents: 2373
diff changeset
   563
end;
d62b1f224982 - Implement zoom reset
unc0rr
parents: 2373
diff changeset
   564
991
d17c71ee074e Enable history (bound on ` key)
unc0rr
parents: 990
diff changeset
   565