-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgaple_msg.pas
More file actions
112 lines (97 loc) · 4.04 KB
/
gaple_msg.pas
File metadata and controls
112 lines (97 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
(* GAME MESSAGES *)
function TFormGaple.PlayerNameError: integer;
begin
result := Application.MessageBox
('Player name must be unique.'#13'Please correct the players name. '#13,
'Name Conflict',MB_OK or MB_ICONERROR);
end;
function TFormGaple.NoNetPlayerError: integer;
begin
result := Application.MessageBox
('No network player involved.'#13'Cannot start game server.'#13,
'No Player',MB_OK or MB_ICONERROR);
end;
function TFormGaple.NoServerError: integer;
var
s: string;
begin
s := 'You haven''t enter the server IP address.'#13+
'Please enter IP address of game server.';
result := Application.MessageBox
(PChar(s),'Error',MB_OK or MB_ICONERROR);
end;
function TFormGaple.WrongCardWarning: integer;
var
s: string;
begin
s := 'Your card does not match with any deck cards.'#13+
'Please select another card that mathes.'#13#13+
'The deck is expecting value '+IntToStr(DeckGaple.TopValue)+' or '+IntToStr(DeckGaple.BottomValue)+'.'#13;
result := Application.MessageBox
(PChar(s),'Wrong card', MB_OK or MB_ICONWARNING);
end;
function TFormGaple.WrongTurnWarning: integer;
begin
result := Application.MessageBox
('This card belongs to player who is not on the turn.'#13+
'Please select card of player currently playing.'#13,
'Wrong turn', MB_OK or MB_ICONWARNING);
end;
function TFormGaple.PassCardQuestion: integer;
begin
result := Application.MessageBox
('There is no card on your hand that matches with any deck cards.'#13+
'Are you sure make this card as passing card?'#13,
'Pass card', MB_YESNO or MB_ICONQUESTION);
end;
function TFormGaple.SelectCardQuestion: integer;
begin
result := Application.MessageBox
('Your card matches with both sides of the deck cards.'#13+
'Will you place your card on the top side of the deck?'#13#13+
'Click Yes, if you want to place your card on the top side. '#13+
'Click No, if you want to place your card on the bottom side. '#13+
'Click Cancel, if you want to change or select another card. '#13,
'Select card', MB_YESNOCANCEL or MB_ICONQUESTION);
end;
function TFormGaple.ApplyChangesInformation: integer;
begin
result := Application.MessageBox
('The changes will apply after you restart the game or '#13+
'maximum game scores has reached by the players.',
'Information',MB_OK or MB_ICONINFORMATION);
end;
function TFormGaple.NoCardInformation: integer;
begin
result := Application.MessageBox
('There is no card available on your hand.'#13+
'The game is by passing your turn.'#13,
'No card', MB_OK or MB_ICONINFORMATION);
end;
function TFormGaple.GameOverInformation: integer;
var
i: integer;
begin
for i := 1 to 7 do
with TDominoCard(FindComponent('DominoCard'+IntToStr(i))) do
if Visible then Scores[GamePlayed].Player1 := Scores[GamePlayed].Player1 + TopValue + BottomValue;
for i := 8 to 14 do
with TDominoCard(FindComponent('DominoCard'+IntToStr(i))) do
if Visible then Scores[GamePlayed].Player2 := Scores[GamePlayed].Player2 + TopValue + BottomValue;
for i := 15 to 21 do
with TDominoCard(FindComponent('DominoCard'+IntToStr(i))) do
if Visible then Scores[GamePlayed].Player3 := Scores[GamePlayed].Player3 + TopValue + BottomValue;
for i := 22 to 28 do
with TDominoCard(FindComponent('DominoCard'+IntToStr(i))) do
if Visible then Scores[GamePlayed].Player4 := Scores[GamePlayed].Player4 + TopValue + BottomValue;
FormScore := TFormScore.Create(self);
result := FormScore.ShowModal;
FormScore.Free;
end;
function TFormGaple.QuitGameQuestion: integer;
begin
result := Application.MessageBox
('Current game is still running.'#13+
'Are you sure want to quit the game?'#13,
'Confirm',MB_YESNO or MB_ICONQUESTION);
end;