generated from DeveloppeurPascal/Delphi-Projects-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuSceneCredits.pas
129 lines (113 loc) · 3.67 KB
/
uSceneCredits.pas
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/// <summary>
/// ***************************************************************************
///
/// Make games in Delphi (2024 edition) - Dev Days of Summer 2024
///
/// Copyright 2024 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS IN THE SOFTWARE.
///
/// ***************************************************************************
///
/// Samples projects for the "Make games in Delphi (2024 Edition)" talk at
/// <Dev Days of Summer> 2024 online conference.
///
/// The projects are based on the "Gamolf FMX Game Template" you can find at
/// https://gametemplate.developpeur-pascal.fr/
///
/// ***************************************************************************
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://serialstreameur.fr/make-games-in-delphi-2024-edition.html
///
/// Project site :
/// https://github.com/DeveloppeurPascal/DevDaysOfSummer2024-MakeGamesInDelphi
///
/// ***************************************************************************
/// File last update : 2024-08-10T13:23:52.000+02:00
/// Signature : 0cfff44d026c758f509c08ed4b7ea4ce6b4ae7b3
/// ***************************************************************************
/// </summary>
unit uSceneCredits;
interface
uses
System.SysUtils,
System.Types,
System.UITypes,
System.Classes,
System.Variants,
FMX.Types,
FMX.Graphics,
FMX.Controls,
FMX.Forms,
FMX.Dialogs,
FMX.StdCtrls,
_ScenesAncestor,
FMX.Controls.Presentation,
FMX.Layouts,
cDialogBoxBackground,
cShowMessage;
type
TSceneCredits = class(T__SceneAncestor)
cadShowMessage1: TcadShowMessage;
private
protected
procedure btnBackClick(Sender: TObject);
public
procedure ShowScene; override;
end;
implementation
{$R *.fmx}
uses
System.Messaging,
uScene,
uConsts,
uDMAboutBox,
uUIElements,
USVGInputPrompts,
uDMHelpBarManager;
{ TSceneCredits }
procedure TSceneCredits.btnBackClick(Sender: TObject);
begin
tscene.Current := TSceneType.Menu;
end;
procedure TSceneCredits.ShowScene;
begin
inherited;
cadShowMessage1.cadButtonClose1.OnClick := btnBackClick;
TUIItemsList.Current.AddControl(cadShowMessage1.cadButtonClose1, nil, nil,
nil, nil, true, true);
THelpBarManager.Current.OpenHelpBar;
THelpBarManager.Current.AddItem(ord(TSVGInputPromptsIndex.KeyboardEscape),
ord(TSVGInputPromptsIndex.SteamButtonColorXOutline), 'Close');
cadShowMessage1.Text1.Text := TAboutBox.Current.OlfAboutDialog1.Titre +
slinebreak + TAboutBox.Current.OlfAboutDialog1.GetVersionDate + slinebreak +
'(c) ' + TAboutBox.Current.OlfAboutDialog1.Copyright + slinebreak +
slinebreak + TAboutBox.Current.OlfAboutDialog1.Description.Text + slinebreak
+ slinebreak + TAboutBox.Current.OlfAboutDialog1.Licence.Text + slinebreak +
slinebreak;
end;
initialization
TMessageManager.DefaultManager.SubscribeToMessage(TSceneFactory,
procedure(const Sender: TObject; const Msg: TMessage)
var
NewScene: TSceneCredits;
begin
if (Msg is TSceneFactory) and
((Msg as TSceneFactory).SceneType = TSceneType.Credits) then
begin
NewScene := TSceneCredits.Create(application.mainform);
NewScene.Parent := application.mainform;
tscene.RegisterScene(TSceneType.Credits, NewScene);
end;
end);
end.