mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 14:36:39 +00:00
Merge branch 'formatustring' into 'master'
Disallow formatting of UString See merge request OpenMW/openmw!3085
This commit is contained in:
commit
5517c99ff9
2 changed files with 4 additions and 2 deletions
|
@ -261,8 +261,8 @@ void MWMechanics::NpcStats::increaseSkill(
|
||||||
MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("skillraise"));
|
MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("skillraise"));
|
||||||
|
|
||||||
std::string message{ MWBase::Environment::get().getWindowManager()->getGameSettingString("sNotifyMessage39", {}) };
|
std::string message{ MWBase::Environment::get().getWindowManager()->getGameSettingString("sNotifyMessage39", {}) };
|
||||||
message
|
message = Misc::StringUtils::format(
|
||||||
= Misc::StringUtils::format(message, MyGUI::TextIterator::toTagsString(skill->mName), static_cast<int>(base));
|
message, MyGUI::TextIterator::toTagsString(skill->mName).asUTF8(), static_cast<int>(base));
|
||||||
|
|
||||||
if (readBook)
|
if (readBook)
|
||||||
message = "#{sBookSkillMessage}\n" + message;
|
message = "#{sBookSkillMessage}\n" + message;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef COMPONENTS_MISC_STRINGS_FORMAT_H
|
#ifndef COMPONENTS_MISC_STRINGS_FORMAT_H
|
||||||
#define COMPONENTS_MISC_STRINGS_FORMAT_H
|
#define COMPONENTS_MISC_STRINGS_FORMAT_H
|
||||||
|
|
||||||
|
#include <MyGUI_UString.h>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -19,6 +20,7 @@ namespace Misc::StringUtils
|
||||||
T argument(T value) noexcept
|
T argument(T value) noexcept
|
||||||
{
|
{
|
||||||
static_assert(!std::is_same_v<T, std::string_view>, "std::string_view is not supported");
|
static_assert(!std::is_same_v<T, std::string_view>, "std::string_view is not supported");
|
||||||
|
static_assert(!std::is_same_v<T, MyGUI::UString>, "MyGUI::UString is not supported");
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue