Commit Graph

30 Commits

Author SHA1 Message Date
macca8
6ae964bb61 ENGINES: Remove all user access to autosave slot 2023-03-05 23:19:40 +01:00
macca8
414facb1cb ENGINES: Add user support only when autosaving is enabled
Allows autosave file to be:
- deleted,
- manually overwritten,
- tested when autosave fails or produces unexpected results.
2023-03-05 23:19:40 +01:00
macca8
95c542e713 ENGINES: Clarify configuration of autosave slot
Establishes the relationship between the autosave slot and the current autosave status.
2023-03-05 23:19:40 +01:00
macca8
142ad94149 ENGINES: Rename initSaveType() method (#6)
Rename method to match its purpose.
2023-03-05 23:19:40 +01:00
macca8
252fb66539 ENGINES: Revert setting _saveType value based on slot type
The saveType property is intended to identify the type of save stored in the autosave slot. Setting the saveType property based on slot type identifies any type of save stored in the autosave slot as an autosave.  It's therefore inappropriate for identifying the actual type of save in the slot

Reverting the method prevents an autosave from overwriting a regular save without warning (fixes [#13841](https://bugs.scummvm.org/ticket/13841)).
2023-03-05 23:19:40 +01:00
Misty De Meo
94889b6e99
ENGINES: correct function name typo 2022-10-24 21:46:42 -07:00
macca8
572b3a5f4a
ENGINES: Properly identify the autosave file
Restructure isAutosave() function:
- Prioritize name test
- Access saveType test only if name test fails
Performs both tests when required, resolving false positives unique to each test, and ensures that only saves which fail both tests appear in autosave warning dialogs.

Properly fixes [https://bugs.scummvm.org/ticket/12363 #12363], refer [https://bugs.scummvm.org/ticket/13842 #13842]
2022-10-25 02:37:01 +03:00
Die4Ever
0d364029fc
ENGINES: Fix autosave name check (#3648)
The length of the German translation for Autosave is 23 characters. Save names in Groovie are limited to 15 characters, and it's probably not the only engine with a similar limit. This meant you would get a warning on every autosave, even though you just told it to overwrite. Mminimum of 14 characters for confidence that the name is a match and not a false positive.
2022-01-13 02:52:59 -06:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh
aa8cabd18f ENGINE: Suppress autosave overwrite warning when description is empty
Some engines (like kyra) return a SaveStateDescriptor with slot assigned,
even when the slot is free. The indication for an empty save is empty
description on these cases.
2021-11-24 09:07:03 +02: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
6aeda12247 ENGINES: Warn when overwriting a non-autosave on autosave 2021-08-23 13:34:35 +02:00
Orgad Shaneh
7adad5aaf5 ENGINES: Streamline auto-save write/delete protection
Some engines call setAutosave and some don't. isAutosave is used to
determine if a saved game is an autosave, but in fact, on most cases it
just falls back to comparing the name to "Autosave".

This is wrong for several reasons:
* Older versions of ScummVM used Autosave 0.
* The name "Autosave" is translated, so if you change the language, it
  won't be detected.

Instead of relying on the name, use the well-known getAutosaveSlot() from
Engine/MetaEngine.

Fixes #12735.
2021-08-23 13:34:35 +02:00
aryanrawlani28
c855f6259a GUI: U32: Fix incorrect code for redirecting constructors.
- The changes previously were creating a temporary object whose lifetime was limited to that line.
- Additionally, use Strings instead of const char* in MessageDialogs.
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
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
Paul Gilbert
0b81eaab7b ENGINES: Abstract autosave check into SaveStateDescriptor 2020-02-16 15:44:28 -08:00
David Fioramonti
9d88afe6bf GRAPHICS: Add playtime in milliseconds to SaveStateDescriptor
This will make setting the playtime for the engine easier since
the current savestate stores it as a string.

This value gets set at the same time that the string playtime gets set.
2018-07-21 13:15:14 +02:00
Colin Snover
076667dc00 COMMON: Add limited support for custom deleters to ScopedPtr
Custom deleters of ScopedPtr are not currently fully conforming to
C++11's support for custom deleters in std::unique_ptr for the
sake of simplicity of implementation. Unlike in the standard
library, plain functions and lvalue references are not supported,
nor may custom deleters be passed to the constructor at runtime.
This can be improved in the future, if necessary, by doing what
standard library implementations usually do and creating a Pair
class that uses the Empty Base Optimization idiom to avoid extra
storage overhead of the deleter instance when it is not needed, as
in typical standard library implementations, plus some additional
type traits to support the necessary metaprogramming for the
different type overloads.
2017-11-18 22:35:12 +01:00
Tarek Soliman
255cd0452c ENGINES: Display savestate date as YYYY-MM-DD
This avoids confusion in locales that use MM/DD/YYYY vs DD/MM/YYYY
2017-06-09 13:15:38 -05:00
Alexander Tkachev
f1a56eaf36 GUI: Show "locked" saves during sync 2016-08-24 16:07:55 +06:00
Johannes Schickel
53e83147be ENGINES: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
Christoph Mallon
23a0f5318c JANITORIAL: Remove trailing empty lines. 2011-08-07 13:53:33 +02:00
Johannes Schickel
09501be85b ENGINES: Clean up SaveStateDescriptor.
Now SaveStateDescriptor no longer subclasses HashMap. Instead all possible
saved meta data is included directly into SaveStateDescriptor.

This is slightly less flexible, but we never needed that flexibility so far.
On the other hand it should reduce the memory usage. At least on my system
(Linux/amd64) the old SaveStateDescriptor had a size of 928 and the new
SaveStateDescriptor has a size of 200.
2011-07-02 21:07:55 +02:00
Max Horn
86240bb0dc ENGINES: Get rid of some s(n)printf calls 2011-06-02 18:31:58 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel
1b2952e3ff ENGINE: Add a setPlayTime to SaveStateDescriptor taking an ms value.
svn-id: r53922
2010-10-29 16:41:30 +00:00
Max Horn
56e81ac0da Switch SaveStateDescriptor::getBool to use Common::parseBool
svn-id: r48567
2010-04-06 09:27:27 +00:00
Max Horn
8db54382bb ENGINES: Move SaveStateDescriptor etc. to engine/savestate.*
svn-id: r48283
2010-03-18 15:09:48 +00:00