mirror of
https://github.com/OpenMW/openmw.git
synced 2026-05-06 07:56:40 -04:00
Use normalized paths to construct big icon paths
This commit is contained in:
@@ -354,12 +354,8 @@ namespace MWGui
|
||||
// use the icon of the first effect
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getESMStore()->get<ESM::MagicEffect>().find(
|
||||
spell->mEffects.mList.front().mData.mEffectID);
|
||||
std::string icon = effect->mIcon;
|
||||
std::replace(icon.begin(), icon.end(), '/', '\\');
|
||||
size_t slashPos = icon.rfind('\\');
|
||||
icon.insert(slashPos + 1, "b_");
|
||||
const VFS::Path::Normalized iconPath = Misc::ResourceHelpers::correctIconPath(
|
||||
VFS::Path::toNormalized(icon), *MWBase::Environment::get().getResourceSystem()->getVFS());
|
||||
const VFS::Path::Normalized iconPath = Misc::ResourceHelpers::correctBigIconPath(
|
||||
VFS::Path::toNormalized(effect->mIcon), *MWBase::Environment::get().getResourceSystem()->getVFS());
|
||||
mSpellImage->setSpellIcon(iconPath);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -323,11 +323,8 @@ namespace MWGui
|
||||
const ESM::MagicEffect* effect
|
||||
= esmStore.get<ESM::MagicEffect>().find(spell->mEffects.mList.front().mData.mEffectID);
|
||||
|
||||
std::string path = effect->mIcon;
|
||||
std::replace(path.begin(), path.end(), '/', '\\');
|
||||
path.insert(path.rfind('\\') + 1, "b_");
|
||||
const VFS::Path::Normalized iconPath = Misc::ResourceHelpers::correctIconPath(
|
||||
VFS::Path::toNormalized(path), *MWBase::Environment::get().getResourceSystem()->getVFS());
|
||||
const VFS::Path::Normalized iconPath = Misc::ResourceHelpers::correctBigIconPath(
|
||||
VFS::Path::toNormalized(effect->mIcon), *MWBase::Environment::get().getResourceSystem()->getVFS());
|
||||
|
||||
float scale = 1.f;
|
||||
MyGUI::ITexture* texture
|
||||
|
||||
@@ -959,10 +959,8 @@ namespace MWGui
|
||||
const auto& store = MWBase::Environment::get().getESMStore();
|
||||
const ESM::MagicEffect* effect = store->get<ESM::MagicEffect>().find(effectId);
|
||||
|
||||
std::string icon = effect->mIcon;
|
||||
icon.insert(icon.rfind('\\') + 1, "b_");
|
||||
const VFS::Path::Normalized iconPath = Misc::ResourceHelpers::correctIconPath(
|
||||
VFS::Path::toNormalized(icon), *MWBase::Environment::get().getResourceSystem()->getVFS());
|
||||
const VFS::Path::Normalized iconPath = Misc::ResourceHelpers::correctBigIconPath(
|
||||
VFS::Path::toNormalized(effect->mIcon), *MWBase::Environment::get().getResourceSystem()->getVFS());
|
||||
|
||||
widget->setUserString("ToolTipType", "Layout");
|
||||
widget->setUserString("ToolTipLayout", "MagicEffectToolTip");
|
||||
|
||||
@@ -145,6 +145,14 @@ VFS::Path::Normalized Misc::ResourceHelpers::correctIconPath(VFS::Path::Normaliz
|
||||
return correctResourcePath({ { icons } }, resPath, vfs, dds);
|
||||
}
|
||||
|
||||
VFS::Path::Normalized Misc::ResourceHelpers::correctBigIconPath(
|
||||
VFS::Path::NormalizedView resPath, const VFS::Manager& vfs)
|
||||
{
|
||||
std::string name("b_");
|
||||
name += resPath.filename().value();
|
||||
return correctIconPath(VFS::Path::join(resPath.parent(), name), vfs);
|
||||
}
|
||||
|
||||
VFS::Path::Normalized Misc::ResourceHelpers::correctBookartPath(
|
||||
VFS::Path::NormalizedView resPath, const VFS::Manager& vfs)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Misc
|
||||
VFS::Path::NormalizedView resPath, const VFS::Manager& vfs, VFS::Path::ExtensionView ext = {});
|
||||
VFS::Path::Normalized correctTexturePath(VFS::Path::NormalizedView resPath, const VFS::Manager& vfs);
|
||||
VFS::Path::Normalized correctIconPath(VFS::Path::NormalizedView resPath, const VFS::Manager& vfs);
|
||||
VFS::Path::Normalized correctBigIconPath(VFS::Path::NormalizedView resPath, const VFS::Manager& vfs);
|
||||
VFS::Path::Normalized correctBookartPath(VFS::Path::NormalizedView resPath, const VFS::Manager& vfs);
|
||||
VFS::Path::Normalized correctBookartPath(
|
||||
VFS::Path::NormalizedView resPath, int width, int height, const VFS::Manager& vfs);
|
||||
|
||||
Reference in New Issue
Block a user