mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 01:10:10 +00:00
Merge branch 'save-game-string-view' into 'master'
Refactor saveGame to use string_view See merge request OpenMW/openmw!3271
This commit is contained in:
commit
b9460afdfd
@ -55,7 +55,7 @@ namespace MWBase
|
||||
|
||||
virtual void deleteGame(const MWState::Character* character, const MWState::Slot* slot) = 0;
|
||||
|
||||
virtual void saveGame(const std::string& description, const MWState::Slot* slot = nullptr) = 0;
|
||||
virtual void saveGame(std::string_view description, const MWState::Slot* slot = nullptr) = 0;
|
||||
///< Write a saved game to \a slot or create a new slot if \a slot == 0.
|
||||
///
|
||||
/// \note Slot must belong to the current character.
|
||||
|
@ -301,7 +301,7 @@ namespace MWGui
|
||||
|
||||
if (mSaving)
|
||||
{
|
||||
MWBase::Environment::get().getStateManager()->saveGame(mSaveNameEdit->getCaption(), mCurrentSlot);
|
||||
MWBase::Environment::get().getStateManager()->saveGame(mSaveNameEdit->getCaption().asUTF8(), mCurrentSlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ void MWState::StateManager::resumeGame()
|
||||
mState = State_Running;
|
||||
}
|
||||
|
||||
void MWState::StateManager::saveGame(const std::string& description, const Slot* slot)
|
||||
void MWState::StateManager::saveGame(std::string_view description, const Slot* slot)
|
||||
{
|
||||
MWState::Character* character = getCurrentCharacter();
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace MWState
|
||||
///< Delete a saved game slot from this character. If all save slots are deleted, the character will be deleted
|
||||
///< too.
|
||||
|
||||
void saveGame(const std::string& description, const Slot* slot = nullptr) override;
|
||||
void saveGame(std::string_view description, const Slot* slot = nullptr) override;
|
||||
///< Write a saved game to \a slot or create a new slot if \a slot == 0.
|
||||
///
|
||||
/// \note Slot must belong to the current character.
|
||||
|
Loading…
Reference in New Issue
Block a user