| 1 |
{ |
| 2 |
Copyright 2021-2021 Andrzej Kilijański, Michalis Kamburelis. |
| 3 |
|
| 4 |
This file is part of "Castle Game Engine". |
| 5 |
|
| 6 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 7 |
included in this distribution, for details about the copyright. |
| 8 |
|
| 9 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 |
|
| 13 |
---------------------------------------------------------------------------- |
| 14 |
} |
| 15 |
|
| 16 |
{ View when you win. } |
| 17 |
unit GameViewLevelComplete; |
| 18 |
|
| 19 |
interface |
| 20 |
|
| 21 |
uses Classes, |
| 22 |
CastleUIControls, CastleControls; |
| 23 |
|
| 24 |
type |
| 25 |
TViewLevelComplete = class(TCastleView) |
| 26 |
published |
| 27 |
{ Components designed using CGE editor. |
| 28 |
These fields will be automatically initialized at Start. } |
| 29 |
ButtonCredits: TCastleButton; |
| 30 |
private |
| 31 |
procedure ClickCredits(Sender: TObject); |
| 32 |
public |
| 33 |
constructor Create(AOwner: TComponent); override; |
| 34 |
procedure Start; override; |
| 35 |
|
| 36 |
end; |
| 37 |
|
| 38 |
var |
| 39 |
ViewLevelComplete: TViewLevelComplete; |
| 40 |
|
| 41 |
implementation |
| 42 |
|
| 43 |
uses CastleSoundEngine, |
| 44 |
GameSound, GameViewCredits; |
| 45 |
|
| 46 |
constructor TViewLevelComplete.Create(AOwner: TComponent); |
| 47 |
begin |
| 48 |
inherited; |
| 49 |
DesignUrl := 'castle-data:/gameviewlevelcomplete.castle-user-interface'; |
| 50 |
end; |
| 51 |
|
| 52 |
procedure TViewLevelComplete.ClickCredits(Sender: TObject); |
| 53 |
begin |
| 54 |
Container.View := ViewCredits; |
| 55 |
end; |
| 56 |
|
| 57 |
procedure TViewLevelComplete.Start; |
| 58 |
begin |
| 59 |
inherited; |
| 60 |
ButtonCredits.OnClick := {$ifdef FPC}@{$endif}ClickCredits; |
| 61 |
|
| 62 |
{ Play menu music } |
| 63 |
SoundEngine.LoopingChannel[0].Sound := NamedSound('MenuMusic'); |
| 64 |
end; |
| 65 |
|
| 66 |
end. |