Skip to content

Commit

Permalink
New button to switch between normal start (main menu) and load last g…
Browse files Browse the repository at this point in the history
…ame (resume)
  • Loading branch information
shusaura85 committed Feb 15, 2020
1 parent 82813ff commit b505262
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 11 deletions.
7 changes: 7 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

Version 1.1.0
======================
- [new] Show button to easily switch between loading main menu and resuming last save game.
This button changes the mode for the current session only (will not change the option permanently)
- [change] moved the Cancel button a bit lower to make space for the new button


Version 1.0.0
-------------
- [new] Options button to set launch options
Expand Down
43 changes: 32 additions & 11 deletions launcher-src/uMain.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -16173,7 +16173,7 @@ object NotLauncherWindow: TNotLauncherWindow
Left = 8
Top = 184
Width = 784
Height = 120
Height = 104
Alignment = taCenter
Anchors = [akLeft, akTop, akRight]
AutoSize = False
Expand Down Expand Up @@ -16207,10 +16207,10 @@ object NotLauncherWindow: TNotLauncherWindow
CustomTextColors.Focused = 14120960
URL = 'https://github.com/shusaura85/notparadoxlauncher'
end
object btnCancelStart: TUButton
object btnPlay: TUButton
Left = 332
Top = 310
Height = 31
Top = 347
Height = 42
ThemeManager = UThemeManager1
CustomBorderColors.None = 15921906
CustomBorderColors.Hover = 15132390
Expand All @@ -16224,14 +16224,14 @@ object NotLauncherWindow: TNotLauncherWindow
CustomBackColors.Focused = 15921906
CustomTextColors.Disabled = clGray
Highlight = True
Caption = 'Cancel'
Caption = 'Play'
Visible = False
OnClick = btnCancelStartClick
OnClick = btnPlayClick
end
object btnPlay: TUButton
object btnCancelStart: TUButton
Left = 332
Top = 347
Height = 42
Top = 330
Height = 31
ThemeManager = UThemeManager1
CustomBorderColors.None = 15921906
CustomBorderColors.Hover = 15132390
Expand All @@ -16245,9 +16245,9 @@ object NotLauncherWindow: TNotLauncherWindow
CustomBackColors.Focused = 15921906
CustomTextColors.Disabled = clGray
Highlight = True
Caption = 'Play'
Caption = 'Cancel'
Visible = False
OnClick = btnPlayClick
OnClick = btnCancelStartClick
end
object btnOptions: TUButton
Left = 8
Expand All @@ -16268,6 +16268,27 @@ object NotLauncherWindow: TNotLauncherWindow
Caption = 'Options'
OnClick = btnOptionsClick
end
object btnSwitchResume: TUButton
Left = 304
Top = 294
Width = 193
ThemeManager = UThemeManager1
CustomBorderColors.None = 15921906
CustomBorderColors.Hover = 15132390
CustomBorderColors.Press = 13421772
CustomBorderColors.Disabled = 15921906
CustomBorderColors.Focused = 15921906
CustomBackColors.None = 15921906
CustomBackColors.Hover = 15132390
CustomBackColors.Press = 13421772
CustomBackColors.Disabled = 15921906
CustomBackColors.Focused = 15921906
CustomTextColors.Disabled = clGray
Highlight = True
Caption = 'Resume last game / Do not resume last game'
Visible = False
OnClick = btnSwitchResumeClick
end
object SetupTimer: TTimer
Enabled = False
Interval = 500
Expand Down
25 changes: 25 additions & 0 deletions launcher-src/uMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ TNotLauncherWindow = class(TForm)
UHyperLink1: TUHyperLink;
btnPlay: TUButton;
btnOptions: TUButton;
btnSwitchResume: TUButton;
procedure FormShow(Sender: TObject);
procedure SetupTimerTimer(Sender: TObject);
procedure ShutdownTimerTimer(Sender: TObject);
procedure StartGameTimerTimer(Sender: TObject);
procedure btnCancelStartClick(Sender: TObject);
procedure btnPlayClick(Sender: TObject);
procedure btnOptionsClick(Sender: TObject);
procedure btnSwitchResumeClick(Sender: TObject);
private
{ Private declarations }
public
Expand Down Expand Up @@ -67,6 +69,9 @@ implementation

uses uOptions;

const LANG_RESUME_LAST_GAME = 'Continue last save game';
LANG_DO_NOT_RESUME_LAST_GAME = 'Do not continue last save game';

procedure TNotLauncherWindow.SetupTimerTimer(Sender: TObject);
begin
SetupTimer.Enabled := false;
Expand Down Expand Up @@ -222,6 +227,7 @@ procedure TNotLauncherWindow.btnCancelStartClick(Sender: TObject);
lblCountdownShadow.Caption := lblCountdown.Caption;

btnCancelStart.Visible := false;
btnSwitchResume.Visible := false;
btnPlay.Visible := true;
end;

Expand Down Expand Up @@ -250,9 +256,28 @@ procedure TNotLauncherWindow.btnPlayClick(Sender: TObject);
lblCountdownShadow.Visible := true;

btnCancelStart.Visible := true;
btnSwitchResume.Visible := true;
if option_loadlastsave then btnSwitchResume.Caption := LANG_DO_NOT_RESUME_LAST_GAME
else btnSwitchResume.Caption := LANG_RESUME_LAST_GAME;

btnPlay.Visible := false;
end;

procedure TNotLauncherWindow.btnSwitchResumeClick(Sender: TObject);
begin
option_loadlastsave := not option_loadlastsave;

if option_loadlastsave then btnSwitchResume.Caption := LANG_DO_NOT_RESUME_LAST_GAME
else btnSwitchResume.Caption := LANG_RESUME_LAST_GAME;

btnSwitchResume.Repaint;

lblCountdown.Caption := 'Starting game in '+IntTostr(StartGameTimer.Tag+1)+'...';
if option_loadlastsave then lblCountdown.Caption := lblCountdown.Caption + #13#10 + 'Autoloading last save game!';
lblCountdownShadow.Caption := lblCountdown.Caption;

end;

procedure TNotLauncherWindow.FormShow(Sender: TObject);
var SL:TStringList;
launcherdir:string;
Expand Down

0 comments on commit b505262

Please sign in to comment.