Skip to content

Commit a06ac26

Browse files
committed
Various corrections, debug logs removed
1 parent c3269f7 commit a06ac26

7 files changed

Lines changed: 20 additions & 14 deletions

File tree

code/gameoptions.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function MusicLevel(): Byte;
8080

8181
procedure SetMusicLevel(AValue: Byte);
8282
begin
83-
SetValue<byte>(MusicKey, AValue);
83+
SetValue<Integer>(MusicKey, AValue);
8484
end;
8585

8686
procedure SetDifficulty(AValue: NDifficulty);

code/gameviewcredits.pas

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ implementation
2828
// System
2929
SysUtils,
3030
// Castle
31-
castlewindow, CastleOpenDocument;
31+
castlewindow, CastleOpenDocument,
32+
// Own
33+
gameviewmain;
3234

3335
constructor TViewCredits.Create(AOwner: TComponent);
3436
begin
@@ -51,14 +53,14 @@ function TViewCredits.Press(const Event: TInputPressRelease): Boolean;
5153

5254
if Event.IsKey(keyEscape) or Event.IsKey(keyBackSpace) then
5355
begin
54-
Container.PopView();
56+
Container.View := ViewMain;
5557
Exit(true); // key was handled
5658
end;
5759
end;
5860

5961
procedure TViewCredits.ButtonMenuClick(Sender: TObject);
6062
begin
61-
Container.PopView();
63+
Container.View := ViewMain;
6264
end;
6365

6466
procedure TViewCredits.ButtonCastleClick(Sender: TObject);

code/gameviewformula.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function TViewFormula.CalcFormula(AFormula: string): Integer;
196196
begin
197197
LOp := hwNo;
198198
LValue := 0;
199-
WriteLnLog('Original formula: ' + AFormula);
199+
//WriteLnLog('Original formula: ' + AFormula);
200200
I := 1;
201201
while I <= Length(AFormula) do
202202
begin
@@ -219,7 +219,7 @@ function TViewFormula.CalcFormula(AFormula: string): Integer;
219219
end;
220220
if LOp = hwMultiply then
221221
AFormula := Copy(AFormula, 1, Length(AFormula) - MultLen) + (Arg1 * LValue).ToString;
222-
WriteLnLog('Modified formula: ' + AFormula);
222+
//WriteLnLog('Modified formula: ' + AFormula);
223223

224224
Result := 0;
225225
LValue := 0;

code/gameviewleaders.pas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ procedure TViewLeaders.ButtonMenuClick(Sender: TObject);
115115
procedure TViewLeaders.ButtonSyncClick(Sender: TObject);
116116
begin
117117
// Sync with server, and update the list of leaders for the current difficulty.
118-
if not TCastleRest.IsRunning() then
119-
TCastleRest.ServerRequest(ServerApiUrl, GetLeadersFinished)
118+
if not TCastleRest.IsRunning() then
119+
begin
120+
PanelNotifications.Show('Retrieving Leaders from server...');
121+
TCastleRest.ServerRequest(ServerApiUrl, GetLeadersFinished);
122+
end
120123
else
121124
PanelNotifications.Show('Another request is running');
122125
end;

code/gameviewmain.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ procedure TViewMain.ButtonExitClick(Sender: TObject);
189189

190190
procedure TViewMain.ButtonStartClick(Sender: TObject);
191191
begin
192-
Container.View := (ViewGame);
192+
Container.View := ViewGame;
193193
end;
194194

195195
procedure TViewMain.ButtonLeadersClick(Sender: TObject);
196196
begin
197-
Container.PushView(ViewLeaders);
197+
Container.View := ViewLeaders;
198198
end;
199199

200200
procedure TViewMain.ButtonOptionsClick(Sender: TObject);
@@ -204,7 +204,7 @@ procedure TViewMain.ButtonOptionsClick(Sender: TObject);
204204

205205
procedure TViewMain.ButtonCreditsClick(Sender: TObject);
206206
begin
207-
Container.PushView(ViewCredits);
207+
Container.View := ViewCredits;
208208
end;
209209

210210
function TViewMain.Press(const Event: TInputPressRelease): Boolean;

code/gameviewwin.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ procedure TViewWin.SubmitScoresFinished(const AContent: string; ASuccess: Boolea
137137
end
138138
else
139139
PanelNotifications.Show('Submit failed: ' + AContent);
140+
EditName.Enabled := True;
140141
end;
141142

142143
end.

code/models.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ implementation
7474

7575
function TProblemDetails.ToString(): string;
7676
begin
77-
Result := Title;
77+
Result := Title + ': ' + Detail;
7878
end;
7979

8080
constructor TSubmitLeader.Create(const AName: string; AScore: Integer; ADifficulty: NDifficulty);
8181
begin
8282
inherited Create();
8383
Name := AName;
84-
Guid := IIF(UserName = Name, UserGuid, '');
84+
Guid := UserGuid;
8585
Score := AScore;
8686
Difficulty := Ord(ADifficulty);
8787
CalcHash();
@@ -96,7 +96,7 @@ procedure TSubmitLeader.CalcHash();
9696
LHashResult: IHashResult;
9797
begin
9898
FHash := Format(HashTemplate, [Difficulty, IIF(Guid = '', '', ':Guid='+ Guid), Name, Salt, Score]);
99-
WriteLnLog('ForHash ' + FHash);
99+
//WriteLnLog('ForHash ' + FHash);
100100

101101
LHash := THashFactory.TCrypto.CreateSHA2_256();
102102
LHashResult := LHash.ComputeString(FHash, TEncoding.UTF8);

0 commit comments

Comments
 (0)