Commit Graph
140 Commits
Author SHA1 Message Date
Matthew Duggan 07c20aa94b GUI: Partially revert c++11 iterators in saveload-dialog
This loop needs to update the iterator after doing an insertion to correctly
skip empty slots.

This partially reverts e157b7044e.
This fixes #15850.
2025-04-05 21:02:48 +11:00
Filippos Karapetis e157b7044e GUI: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Le Philousophe 057bb00950 GUI: Properly redraw the saves list when called from the progress dialog
When the SaveLoadCloudSyncProgressDialog dialog is displayed, the top
dialog is not the saveload dialog anymore.
In this case, a full redraw is needed for proper display.
2024-11-15 18:23:35 +01:00
Eugene Sandulenko f0e1234a81 GUI: Do not allow new saveslots exceed engine max. Bug #11645 2024-11-08 00:08:56 +01:00
sluicebox 81bde441b2 GUI: Display message when deleting a save fails 2024-10-18 09:41:03 +03:00
sluicebox 697840c372 GUI: Improve save/load list input handling
- Selecting a list item with the keyboard no longer automatically enters
  edit mode; this makes keyboard navigation on the save list possible
  because subsequent keys are no longer trapped by the text field.
- Clicking a selected item that's not in edit mode will now correctly
  cause it to enter edit mode, instead of doing nothing.
- "Untitled saved game" edit mode initialization is no longer skipped
  when entering edit mode by pressing the Enter key.
- Deleting an item now leaves the slot selected so that the selection
  can be changed with the keyboard.
2024-05-22 21:47:07 -04:00
sluicebox e83073df0a GUI: Disable quick select on save/load list
Fixes alphanumeric keys causing unpredictable item selection.
Quick select is only for sorted lists.
2024-05-22 21:47:07 -04:00
sluicebox 425ee5e8d7 GUI: Fix saveload display of selected empty items
Fixes minor bug introduced in 829c600a02

In the saveload list dialog, selecting an empty slot before the last
save stopped coloring most of the row. Empty slots after the last save
continued to display correctly. Now both code blocks are consistent and
the selected row is always fully colored.
2024-05-22 21:46:24 -04:00
macca8 0feaeb1ab0 GUI: Relocate variable declaration & initialize 2023-11-05 22:10:17 +01:00
macca8 030c889bcf GUI:Properly initialise isWriteProtected variable 2023-11-05 22:10:17 +01:00
macca8 3d5ee80403 GUI: Fix usage of dummy autosave in empty autosave slot
Changes include:
- the empty autosave slot's Delete button is now disabled (since no save file exists).
- adds the dummy autosave's name to the empty autosave button's label & tooltip.
- the empty autosave button is now disabled.
2023-11-05 22:10:17 +01:00
Cameron Cawley fb2503d02e GUI: Only use a transparent colour for BMP images 2023-04-09 12:54:38 +02:00
Cameron Cawley 6903fb4be1 COMMON: Simplify API for getHumanReadableBytes() 2023-02-05 23:08:21 +01:00
D G Turner 2537d29332 GUI: Fix GCC Compiler Warnings in Save Load Dialog 2022-08-03 01:47:09 +01:00
Alexander Tkachev 09639e7f23 GUI: Add files amount to SaveLoadCloudSyncProgressDialog
Also adds Cloud::Storage::SyncDownloadingInfo struct to pass around a bunch of numbers instead of having 3 methods for each number (in CloudManager, Storage and SavesSyncRequest).
2022-08-02 22:08:19 +02:00
Alexander Tkachev 85739018fe GUI: Show bytes sizes in saves sync dialog
And also makes percentage calculated based on bytes sizes, not files count.
2022-08-02 22:08:19 +02:00
Alexander Tkachev dbbdf28482 COMMON: Redraw Save/Load dialog while syncing
A bit hacky (uses `friend`), but now while SaveLoadCloudSyncProgressDialog is modal, SaveLoadChooserDialog is still redrawing in the background, so the not-yet-ready saves buttons are being replaced with ready ones while the sync is in progress.
2022-08-02 22:08:19 +02:00
Alexander Tkachev 6901e941aa CLOUD: Fix #11244: Crash when loading a save from the launcher
Removing GUI::CommandSender from SavesSyncRequest, so it doesn't update SaveLoadCloudSyncProgressDialog or SaveLoadChooserDialog from another thread.

Instead, these two are now polling CloudMan once per second themselves.
2022-08-02 22:08:19 +02:00
Eugene Sandulenko 829c600a02 GUI: Remove remains of the old color lists in *ListWidget 2022-05-29 00:39:35 +02:00
athrxx ea39342113 GUI: (SaveLoad) - remove unnecessary dialog
The dialog

"WARNING: Existing save has longer gameplay duration than the current state. Are you sure you want to overwrite it?"

is not really helpful and seems to have more negative than positive impact on the user experience, so I have removed it.
2022-05-12 19:01:36 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko 109beb4f86 GUI: Explicitely use Common:: namespace 2021-11-12 14:46:34 +01:00
Orgad Shaneh fe104cc337 ENGINES: Use MetaEngine consistently for getting autosave slot
The autosave refactoring that was done in
7adad5aaf5 used g_engine for identifying the
autosave slot. This worked for in-game save/load, but doesn't fit when
called from the launcher.

Fix by passing MetaEngine to SaveStateDescriptor ctor and using it for this
query.

Amends 7adad5aaf5.
2021-10-24 16:46:06 +02:00
Orgad Shaneh b7a46e97f5 GUI: Re-enable warning when saving over an older savegame
The assignment back to _saveList is required, because the initial read does
not assign playtime.

In case the slot is empty, querySaveMetaInfos returns an empty description
with saveSlot -1 on most engines, so _saveList[selItem] loses its slot.
Cover this by adding a check.

Reverts 0425dff824.
2021-08-28 21:36:35 +03:00
D G Turner 8b239a2577 GUI: Fix GCC Signed vs. Unsigned Comparison Warning 2021-08-28 13:56:09 +01:00
Thierry Crozat 0425dff824 GUI: Fix saving in a new slot with the list save dialog
This revert part of a17816f1 (GUI: Warn when saving a "young" game
over an "older" one).

The issue was that when trying to save in a new slot with the list
save dialog, this was not creating the save.

This finishes to fix bug #12850
2021-08-27 23:30:44 +01:00
Thierry Crozat 626d0ed4b6 GUI: Fix assert when double clicking on item in list save dialog
This was a regression from 44e5d3f9 (GUI: Factor out save/load
activation to a function).

This fixes part of bug #12850
2021-08-27 23:30:44 +01:00
Thierry Crozat 5867d5420f GUI: Fix clicking in an empty space in the Grid Load dialog
This was unexpectedly closing the dialog.
This was a regression from 44e5d3f9 (GUI: Factor out save/load
activation to a function)
2021-08-27 23:30:44 +01:00
Orgad Shaneh a17816f14d GUI: Warn when saving a "young" game over an "older" one 2021-08-25 05:56:22 +03:00
Orgad Shaneh 44e5d3f9bd GUI: Factor out save/load activation to a function 2021-08-25 05:56:22 +03:00
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