Skip to content

Commit

Permalink
Merge branch 'ustringmestring' into 'master'
Browse files Browse the repository at this point in the history
Use MyGUI::UString's new string_view support

See merge request OpenMW/openmw!3610
  • Loading branch information
uramer committed Nov 25, 2023
2 parents 47d176e + 81b8328 commit 22dbb3e
Show file tree
Hide file tree
Showing 38 changed files with 115 additions and 143 deletions.
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/activator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "activator.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadacti.hpp>
#include <components/esm3/loadcrea.hpp>
Expand All @@ -27,7 +28,6 @@
#include "../mwrender/vismask.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwmechanics/npcstats.hpp"

Expand Down Expand Up @@ -102,8 +102,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);

std::string text;
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/apparatus.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "apparatus.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
Expand All @@ -15,7 +16,6 @@
#include "../mwrender/renderinginterface.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "classmodel.hpp"

Expand Down Expand Up @@ -92,8 +92,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/armor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "armor.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadarmo.hpp>
#include <components/esm3/loadgmst.hpp>
Expand All @@ -24,7 +25,6 @@
#include "../mwrender/renderinginterface.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "classmodel.hpp"

Expand Down Expand Up @@ -217,8 +217,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/book.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "book.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadbook.hpp>
#include <components/esm3/loadsoun.hpp>
Expand All @@ -19,7 +20,6 @@
#include "../mwrender/renderinginterface.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwmechanics/npcstats.hpp"

Expand Down Expand Up @@ -111,8 +111,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/clothing.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "clothing.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadclot.hpp>
#include <components/esm3/loadnpc.hpp>
Expand All @@ -16,7 +17,6 @@
#include "../mwworld/ptr.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -154,8 +154,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwclass/container.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "container.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/containerstate.hpp>
#include <components/esm3/loadcont.hpp>
Expand All @@ -24,7 +25,6 @@
#include "../mwworld/worldmodel.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/animation.hpp"
#include "../mwrender/objects.hpp"
Expand Down Expand Up @@ -249,7 +249,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MWGui::toUString(name));
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name));

std::string text;
int lockLevel = ptr.getCellRef().getLockLevel();
Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwclass/creature.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "creature.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/creaturestate.hpp>
#include <components/esm3/loadclas.hpp>
Expand Down Expand Up @@ -45,7 +46,6 @@
#include "../mwrender/renderinginterface.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "classmodel.hpp"

Expand Down Expand Up @@ -582,7 +582,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MWGui::toUString(name));
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name));

std::string text;
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwclass/door.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "door.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/doorstate.hpp>
#include <components/esm3/loaddoor.hpp>
Expand All @@ -25,7 +26,6 @@
#include "../mwworld/worldmodel.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/animation.hpp"
#include "../mwrender/objects.hpp"
Expand Down Expand Up @@ -267,7 +267,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MWGui::toUString(name));
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name));

std::string text;

Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/esm4base.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "esm4base.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/sceneutil/positionattitudetransform.hpp>

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -35,8 +35,7 @@ namespace MWClass
MWGui::ToolTipInfo ESM4Impl::getToolTipInfo(std::string_view name, int count)
{
MWGui::ToolTipInfo info;
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
return info;
}
}
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/ingredient.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ingredient.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadingr.hpp>
#include <components/esm3/loadnpc.hpp>
Expand All @@ -16,7 +17,6 @@
#include "../mwworld/ptr.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -107,8 +107,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/light.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "light.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadligh.hpp>
#include <components/esm3/loadnpc.hpp>
Expand All @@ -21,7 +22,6 @@
#include "../mwworld/ptr.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -159,8 +159,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/lockpick.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "lockpick.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadlock.hpp>
#include <components/esm3/loadnpc.hpp>
Expand All @@ -15,7 +16,6 @@
#include "../mwworld/ptr.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -104,8 +104,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
6 changes: 3 additions & 3 deletions apps/openmw/mwclass/misc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "misc.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <components/esm3/loadcrea.hpp>
#include <components/esm3/loadmisc.hpp>
Expand All @@ -19,7 +20,6 @@
#include "../mwworld/worldmodel.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -151,8 +151,8 @@ namespace MWClass
countString = " (" + std::to_string(count) + ")";

std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MWGui::toUString(name))
+ MWGui::ToolTips::getCountString(count) + MWGui::ToolTips::getSoulString(ptr.getCellRef());
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count)
+ MWGui::ToolTips::getSoulString(ptr.getCellRef());
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwclass/npc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "npc.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include <cassert>
#include <memory>
Expand Down Expand Up @@ -57,7 +58,6 @@
#include "../mwrender/renderinginterface.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

namespace
{
Expand Down Expand Up @@ -1089,7 +1089,7 @@ namespace MWClass
MWGui::ToolTipInfo info;

std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MWGui::toUString(name));
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name));
if (fullHelp && !ref->mBase->mName.empty() && ptr.getRefData().getCustomData()
&& ptr.getRefData().getCustomData()->asNpcCustomData().mNpcStats.isWerewolf())
{
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwclass/potion.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "potion.hpp"

#include <MyGUI_TextIterator.h>
#include <MyGUI_UString.h>

#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
Expand All @@ -13,7 +14,6 @@
#include "../mwworld/ptr.hpp"

#include "../mwgui/tooltips.hpp"
#include "../mwgui/ustring.hpp"

#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
Expand Down Expand Up @@ -95,8 +95,7 @@ namespace MWClass

MWGui::ToolTipInfo info;
std::string_view name = getName(ptr);
info.caption
= MyGUI::TextIterator::toTagsString(MWGui::toUString(name)) + MWGui::ToolTips::getCountString(count);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
info.icon = ref->mBase->mIcon;

std::string text;
Expand Down
Loading

0 comments on commit 22dbb3e

Please sign in to comment.