Commit Graph
110 Commits
Author SHA1 Message Date
antoniou79 e128d69748 GUI: Don't draw invisible thumbnail obstucting selection in Load Save dialogue
This fix is particular to the Load Save ScummVM dialogue where the issue is observed

A more general fix is proposed in PR https://github.com/scummvm/scummvm/pull/3080.
2021-06-26 16:44:23 +03:00
sluicebox aac1eb12bf GUI: Add delete/backspace support to save/load list
- SaveLoadChooserSimple responds to kListItemRemovalRequestCmd
- ListWidget::scrollToCurrent() only scrolls when there is a
  current selected item
2021-05-28 23:15:04 +03:00
Eugene Sandulenko 69ea52c2d0 GUI: Scale thumbnails in saveload dialog in HiDPI 2021-04-17 15:04:36 +02:00
SupSuper 8f7d28f85e GUI: Fix scaling for simple saveload dialog 2021-04-13 19:08:22 +01:00
Eugene Sandulenko d69f496380 GUI: Fix compilation with clouds disabled 2021-04-11 21:21:44 +02:00
Eugene Sandulenko bd083c7fa7 GUI: Switch GUI to ManagedSurface 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 37982f9eb4 GUI: Fix scaling for saveload dialog 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 48faae426a GUI: Rename getBaseWidth/Height to getGUIWidth/Height
This reflects its purpose better, so the user code will be
more logical
2021-04-11 21:21:44 +02:00
Eugene Sandulenko 0f925f3d87 GUI: Dropped g_gui.getWidth() and getHeight() 2021-04-11 21:21:44 +02:00
Cameron Cawley a1890ede9c BASE: Avoid calling PluginMan.getEngineFromMetaEngine where possible 2021-04-05 15:33:23 +01:00
SupSuper 70dc08f46e JANITORIAL: Cleanup inconsistent includes 2021-02-22 10:54:07 +00:00
sluicebox 6d3ed4268f GUI: Retain scroll position when deleting a save 2020-11-22 16:45:17 +00:00
Cameron Cawley c877097b49 ALL: Remove use of "" in Common::U32String constructors 2020-11-16 16:56:58 +00:00
aryanrawlani28 71a820caff ENGINES: Begin class renaming of ME & AME
- ME -> MetaEngineStatic (static parts)
- MEC -> MetaEngine (dynamic parts)
2020-10-03 14:56:36 +02:00
aryanrawlani28 8b43e79695 GUI: Fix namespaces for saveload dialogs when cloud is enabled. 2020-10-03 14:56:36 +02:00
aryanrawlani28 73cc973ad7 BASE: ENGINES: Change saveload code to adapt to the new MEC class.
- MEC: MetaEngineConnect.
- How do games handle save/load if MetaEngine (detection) is seperate from MetaEngineConnect (engine factory)?

- Most of the changes are quite similiar. ConfMan finds us the relevant MetaEngine, then simply use the new helpers from PluginMan.
- The new helpers will help convert a relevant MetaEngine into the other format or vice versa.
- Once the matching is complete, simply invoke functions by:
plugin->get<MetaEngineConnect>().engineMethod();
- Refer to previous commits to see the new class changes & notes.
2020-10-03 14:56:36 +02:00
Thierry Crozat e0802ec341 GUI: Fix SaveLoadChooserGrid not disabling write protected slots
This was broken in commit f24a89e that disabled the slots when they
are locked due to cloud sync.
2020-09-12 21:41:57 +01:00
aryanrawlani28 68d01321d6 GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.

- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-08-30 14:43:41 +02:00
aryanrawlani28 d12c6c4338 GUI: U32: Code cleanup
- Remove extra parantheses leftover from temp code
- SaveLoadDialog - do not encode when setting labels
- Remove mapping variable from ThemeEngine::loadScalableFont (and use default 0)
- Remove incorrect u32 constructor wrapper from confman.set in eventrecorder.cpp
2020-08-30 14:43:41 +02:00
aryanrawlani28 a9bfe35216 GUI: U32: More issue fixes and general improvements
- Use the fake constructor for message dialog less often
- solve errors regarding comparision between string and u32string in midi
- solve errors in testbed/speech related to ttsMan->say
- fix unsigned comparision warning in tab.cpp
- fix issue with static strings and translations in sdl-graphics
2020-08-30 14:43:41 +02:00
aryanrawlani28 e22b32abfe GUI: U32: Use Common::U32String::format where necessary and GUIError to u32
- Where necessary as in, where translated messages are used.
- GUIErrorMessage now takes in U32String
- error messages across some engines use U32Strings. they are changed because they show a message dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28 bed05ea134 GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project

- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28 b9a449480b GUI: U32: Remove u32::format references
- Removed because implicit conversion can simply handle this usecase
2020-08-30 14:43:41 +02:00
aryanrawlani28 160a1320cc GUI: U32: Rename more temp code and fix issues
- Remove convertFromU32.. where necessary
- Replace convertFromU32 to .encode() for better readability
- Fix spacing issues in tabs
- Fix spacing issues in popups
- Fix weird font rendering in certain menus.
- Fix dialog changing sizes by huge amount when changing languages
- Some minor changes from String::format to U32String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28 96912f4adb GUI: U32: Rename some references of strings to use U32() & not helper method 2020-08-30 14:43:41 +02:00
aryanrawlani28 f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28 5f2af6b93e GUI: U32: Add u32 support to Editables and Dialogs
- Editable widgets
- Lists
- SaveLoad Dialogs
- Browser Dialogs
2020-08-30 14:43:41 +02:00
aryanrawlani28 aafade4507 GUI: U32: Shift most widgets to draw with u32
- ButtonWidgets (Button, Radio, Checkbox, dropdown)
- StaticTextWidgets
- PopUpWidgets
- Tabs
- Add a temporary overloaded drawDDText function to make other widgets draw normally
2020-08-30 14:43:41 +02:00
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 c0d8b6d9fc.

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