82 Commits

Author SHA1 Message Date
aryanrawlani28
51d95f8978 GRAPHICS: move start + end to Graphics::TextAlign 2020-06-22 00:03:02 +02:00
BLooperZ
4fc9c11bbe GUI: use start + end for static widgets 2020-06-22 00:03:02 +02:00
aryanrawlani28
dde4200d35 GUI: RTL: Overload and simplify getWidgetData for getting rtl flag 2020-06-22 00:03:02 +02:00
aryanrawlani28
076623d419 GUI: Remove useless code and comments 2020-06-22 00:03:02 +02:00
aryanrawlani28
07ab77d065 GUI: RTL: Get internal widget RTL flag from theme 2020-06-22 00:03:02 +02:00
aryanrawlani28
d6a340d3b4 GUI: Cleanup hacky function for internal flip and fix review issues 2020-06-22 00:03:02 +02:00
aryanrawlani28
d6c2d4b809 GUI: RTL: Align fixes for text in Load game dialog 2020-06-22 00:03:02 +02:00
Eugene Sandulenko
6aacdb1938 GUI: Normalize width/height parameters
The fact that ThemeLayout had them int, and GuiObject as uint, was
leading to number of unexpected overflows.
2020-05-09 21:59:07 +02:00
Eugene Sandulenko
3a0ddbf667 GUI: Added sanity check 2020-04-27 14:50:58 +02:00
Paul Gilbert
1687427e8e ENGINES: Mark autosave slots as write protected
If the autosave slot doesn't yet have any file in it, when the
GMM save dialog is open, the autosave slot will show a default
'Autosave' entry which is write-only, to prevent users
accidentally making a savegame in that slot
2020-02-16 15:44:28 -08:00
Bastien Bouclet
6e1abf064a GUI: Use nullptr instead of 0 or NULL where appropriate 2020-01-19 15:08:37 +01:00
Bastien Bouclet
4182c50a92 GUI: Fix the SaveLoadDialog with the lowres layouts
The thumbnail layout element is not available in the lowres layouts.
Issue introduced by c0d8b6d9fc73abc8de4575686e0776e3468d37b2.

Fixes #11304.
2020-01-05 08:34:24 +01:00
Bastien Bouclet
c0d8b6d9fc GUI: Introduce dynamic layouts
Prior to this change, a GUI layout was only affected by the screen size.
Now, a layout can additionally be influenced by the GUI dialog and widgets
that uses it. This capability is leveraged to implement the following
features:

* Layout elements that are not bound to a GUI widget do not take space.
   This means that dialogs where the widgets shown depend on for example
   a feature being enabled at configure time no longer have blank spaces.
* Widgets can define a minimal required size for their contents not to be
   cut. For now this is only used for buttons so their width is always
   sufficient for their caption not to be cut. This mechanism could be
   applied to other widget types in the future.
2020-01-04 10:56:25 +01:00
D G Turner
30c366ee5d GUI: Add Missing Switch Default Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-03 06:03:46 +01:00
D G Turner
9831f6ddd2 GUI: Disable Current View Selection Button in Save/Load Chooser.
Switching between List and Grid views causes a nasty redraw flicker.
This also occurs if you press the button for the current view type.

This patch does not fix the underlying refresh issue, but it does
disable the button for the current view type as pressing this is not
useful in any case.

This is a partial fix for bug Trac #10441.
2018-10-10 08:20:17 +01:00
David Fioramonti
81e0fa37ff GUI: Show saveload date/time, or playtime even if thumbnail not enabled
Previously, if playtime or date/time support was added it would not be displayed
unless thumbnail support was also valid.

Now they will be shown even if the thumbnail is not valid.

No container is shown if only metainfo support is enabled.
2018-07-09 21:31:23 +01:00
Bastien Bouclet
5878c618c9 GUI: Remove Dialog::markAsDirty to expose full GUI redraws 2018-01-27 18:12:34 +01:00
Bastien Bouclet
0496ede62f GUI: Implement dirty-checking for widget redraws 2018-01-27 18:12:34 +01:00
D G Turner
afdcde4b54 GUI: Fix Signed vs. Unsigned Comparison GCC Compiler Warning. 2017-11-27 11:39:58 +00:00
Thierry Crozat
469e75cb64 GUI: Fix incorrect SaveLoad dialog state after updating the save list
Updating the list reset the selection in the list widget, however if
a save had previously been selected and the Choose button was enabled,
it remained enabled despite no save being selected. Trying to load
the game resulted in a crash. This was particularly an issue with
cloud enabled as if you are unlucky you could have tried to load a
save just as the cloud sync finished, which updated the list and
unselected the save. This change fixes bug #9766: Assert in
SaveLoadChooser dialog.

In addition to adding a sanity check on the selected index for the
Choose command, this commit also preserves the selection when
updating the list as I think this would be the expected behaviour
in this dialog.
2017-11-24 22:44:41 +00:00
Tarek Soliman
2977ae546e GUI: Improve calculation for savegame thumbnail labels
Instead of shrinking the rect based on how many labels aren't there,
expand the rect based on how many labels are there.

Closes gh-958
2017-06-09 13:17:09 -05:00
Tarek Soliman
7de8be411d GUI: Fix savegame thumbnail label layout
The Save/Load screen has a preview area with labels for date and time.
The bottom label was drawing past the bottom of the rect.
2017-06-09 13:17:09 -05:00
Ben Castricum
6f38c1e55d ALL: game state => saved game 2016-11-29 20:15:20 +01:00
Eugene Sandulenko
e8b70a4686 ALL: Fix compilation with disabled cloud but enabled libcurl 2016-10-17 18:55:22 +02:00
Bastien Bouclet
1a1a5b5f69 CLOUD: Change the cloud icon to be updated by the main thread
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.

Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.
2016-09-18 17:54:12 +02:00
Thierry Crozat
a87a702eb2 ALL: Homogeneize use of 'saved game' in messages 2016-09-18 16:40:34 +01:00
Alexander Tkachev
b665fc933d ALL: Make simpleSaveNames() a MetaEngineFeature
Added it into hasFeature() of all engines which returned `true` in
simpleSaveNames() before.

As mentioned in #788, SCI is not always using simple names, so it
doesn't have such feature now.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
53aa0c46f1 GUI: JANITORIAL: Fix code formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
3da38ca60b CLOUD: Replace USE_CLOUD with USE_LIBCURL
In most cases that's the right one to check. USE_CLOUD is defined when
either USE_LIBCURL or USE_SDL_NET are, which means if there is no curl,
USE_CLOUD still could be defined and linking errors would appear.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
81c85b6651 CLOUD: Fix SaveLoadDialogs to check USE_CLOUD
Linking was failing when disabling curl support.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
659dcd9702 GUI: Fix SaveLoadDialog
It was SavesSyncRequest's target even when closed.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
62a640ff44 GUI: Disable "Run in background" for "difficult" engines
During saves sync slots of MetaEngines with simpleSaveNames() == false
would not be available at all. User would have to wait for sync to
complete.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ab1d160ec8 ALL: Add MetaEngine::simpleSaveNames()
Engines with "simple" savenames would support "Run in background" in
save/load dialog and gradual save slots unlocking. Other engines
save/load feature would be locked until save sync is over.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f24a89e080 GUI: Fix SaveLoadCloudSyncProgressDialog
* disabled progress bar;
* removed syncTarget segfault;
* fixed grid slots disabling for "locked" slots.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f5cb5be393 GUI: Add SaveLoadCloudSyncProgress in ScummModern theme
ScummVM would probably crash when using a theme without
SaveLoadCloudSyncProgress dialog described.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
67789c3c16 GUI: Update SaveLoadCloudSyncProgressDialog
So now it's centered, includes a progress bar and two labels instead of
one. Works fine in 320x200.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f1a56eaf36 GUI: Show "locked" saves during sync 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6c5a8f34ea CLOUD: Add SaveLoadCloudSyncProgress enum
It's common for Save/Load dialogs and SavesSyncRequest.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9eb4aad7fd CLOUD: Make DefaultSaveFileManager ignore syncing files
MetaEngines don't get "locked" files in the list, so won't try to open
these.

Save/Load dialog updates save list every time SavesSyncRequest tells it
to.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0ce7be17d3 CLOUD: Make ProgressDialog display downloading progress 2016-08-24 16:07:55 +06:00
Alexander Tkachev
3db80154d6 CLOUD: Fix SaveLoadCloudSyncProgressDialog crash
It's closing itself a bit later now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e9721976aa GUI: Add SaveLoadCloudSyncProgressDialog
It's shown by SaveLoadChooserDialog when files are downloaded and some
save slots are locked. One can hide that dialog to interact with
non-locked slots or cancel saves sync completely. Dialog's label shows
current sync progress.

Dialog automatically hides itself when all files are downloaded.
WARNING: right now that results in a crash!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e7763700e2 CLOUD: Make Save/Load dialog start saves sync
It also shows a "sync disabled" icon in case it has a savepath override.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
b590cc2d8f GUI: Cleanup class initialization 2016-06-01 13:16:12 +02:00
Johannes Schickel
bbfff93c64 GUI: Do not overwrite write protected saves in grid based save dialog.
This fixes overwriting of, for example, autosaves in the grid based save load
dialog when using "New Save".
2014-12-29 14:59:13 +01:00
Ben Castricum
9d885bce22 GUI: s/savegame/saved game/
Makes it consistant throughout the GUI
2014-08-22 07:11:03 +02:00
Johannes Schickel
f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Johannes Schickel
6a1112f98f GUI: Mark some intentional fall throughs in switches.
All of these are for handling kCloseCmd.
2013-07-15 13:44:24 +02:00
Johannes Schickel
0052ef2802 GUI: Check for screen changes in the saveload chooser selection code. 2012-10-28 21:44:05 +01:00