@@ -60,43 +60,20 @@ implementation
6060 UserNameKey = ' UserName' ;
6161 UserGuidKey = ' UserGuid' ;
6262
63- {
6463procedure SetValue <T>(const AKey: string; AValue: T);
6564begin
6665 UserConfig.SetValue(AKey, AValue);
6766 if UserConfig.Modified then
6867 UserConfig.Save();
6968end ;
70- }
71-
72- procedure SetValue (const AKey: string; const AValue: string); overload;
73- begin
74- UserConfig.SetValue(AKey, AValue);
75- if UserConfig.Modified then
76- UserConfig.Save();
77- end ;
78-
79- procedure SetValue (const AKey: string; AValue: Boolean); overload;
80- begin
81- UserConfig.SetValue(AKey, AValue);
82- if UserConfig.Modified then
83- UserConfig.Save();
84- end ;
85-
86- procedure SetValue (const AKey: string; AValue: Integer); overload;
87- begin
88- UserConfig.SetValue(AKey, AValue);
89- if UserConfig.Modified then
90- UserConfig.Save();
91- end ;
9269
9370function Difficulty (): NDifficulty;
9471begin
9572 Result := NDifficulty(EnumValue(ETPDifficulty, UserConfig.GetValue(DifficultyKey, ' ' )));
9673 if Ord(Result) in [0 ..254 ] then
9774 Exit;
9875 Result := DifficultyDefault;
99- SetValue(DifficultyKey, EnumName(ETPDifficulty, Ord(Result)));
76+ SetValue<string> (DifficultyKey, EnumName(ETPDifficulty, Ord(Result)));
10077end ;
10178
10279function MusicLevel (): Byte;
@@ -106,12 +83,12 @@ function MusicLevel(): Byte;
10683
10784procedure SetMusicLevel (AValue: Byte);
10885begin
109- SetValue(MusicKey, AValue);
86+ SetValue<byte> (MusicKey, AValue);
11087end ;
11188
11289procedure SetDifficulty (AValue: NDifficulty);
11390begin
114- SetValue(DifficultyKey, DifficultyName(AValue));
91+ SetValue<string> (DifficultyKey, DifficultyName(AValue));
11592end ;
11693
11794function DifficultyName (AValue: NDifficulty): string;
@@ -126,7 +103,7 @@ function Fullscreen(): Boolean;
126103
127104procedure SetFullscreen (AValue: Boolean);
128105begin
129- SetValue(FullscreenKey, AValue);
106+ SetValue<Boolean> (FullscreenKey, AValue);
130107 Application.MainWindow.FullScreen := AValue;
131108end ;
132109
@@ -137,7 +114,7 @@ function UseTimer(): Boolean;
137114
138115procedure SetUseTimer (AValue: Boolean);
139116begin
140- SetValue(UseTimerKey, AValue);
117+ SetValue<Boolean> (UseTimerKey, AValue);
141118end ;
142119
143120function UserName (): string;
@@ -147,7 +124,7 @@ function UserName(): string;
147124
148125procedure SetUserName (const AValue: string);
149126begin
150- SetValue(UserNameKey, AValue);
127+ SetValue<string> (UserNameKey, AValue);
151128end ;
152129
153130function UserGuid (): string;
@@ -157,7 +134,7 @@ function UserGuid(): string;
157134
158135procedure SetUserGuid (const AValue: string);
159136begin
160- SetValue(UserGuidKey, AValue);
137+ SetValue<string> (UserGuidKey, AValue);
161138end ;
162139
163140initialization
0 commit comments