Skip to content

Commit

Permalink
Merge branch 'ltexmstt' into 'master'
Browse files Browse the repository at this point in the history
Add movable static and ESM4 land texture stores, don't show tooltips for unnamed ESM4Named objects

See merge request OpenMW/openmw!3528
  • Loading branch information
petrmikheev committed Oct 29, 2023
2 parents a891965 + 84cad3d commit 62b787a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 12 deletions.
2 changes: 2 additions & 0 deletions apps/openmw/mwclass/classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadmisc.hpp>
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadnpc.hpp>
#include <components/esm4/loadstat.hpp>
#include <components/esm4/loadterm.hpp>
Expand Down Expand Up @@ -85,6 +86,7 @@ namespace MWClass
ESM4Named<ESM4::Ingredient>::registerSelf();
ESM4Light::registerSelf();
ESM4Named<ESM4::MiscItem>::registerSelf();
ESM4Named<ESM4::MovableStatic>::registerSelf();
ESM4Npc::registerSelf();
ESM4Named<ESM4::Potion>::registerSelf();
ESM4Static::registerSelf();
Expand Down
12 changes: 6 additions & 6 deletions apps/openmw/mwclass/esm4base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ namespace MWClass
{
}

bool hasToolTip(const MWWorld::ConstPtr& ptr) const override { return true; }

MWGui::ToolTipInfo getToolTipInfo(const MWWorld::ConstPtr& ptr, int count) const override
std::string_view getName(const MWWorld::ConstPtr& ptr) const override
{
return ESM4Impl::getToolTipInfo(ptr.get<Record>()->mBase->mFullName, count);
return ptr.get<Record>()->mBase->mFullName;
}

std::string_view getName(const MWWorld::ConstPtr& ptr) const override
MWGui::ToolTipInfo getToolTipInfo(const MWWorld::ConstPtr& ptr, int count) const override
{
return ptr.get<Record>()->mBase->mFullName;
return ESM4Impl::getToolTipInfo(getName(ptr), count);
}

bool hasToolTip(const MWWorld::ConstPtr& ptr) const override { return !getName(ptr).empty(); }
};
}

Expand Down
4 changes: 4 additions & 0 deletions apps/openmw/mwlua/cellbindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadmisc.hpp>
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadrefr.hpp>
#include <components/esm4/loadstat.hpp>
#include <components/esm4/loadtree.hpp>
Expand Down Expand Up @@ -240,6 +241,9 @@ namespace MWLua
case ESM::REC_MISC4:
cell.mStore->template forEachType<ESM4::MiscItem>(visitor);
break;
case ESM::REC_MSTT4:
cell.mStore->template forEachType<ESM4::MovableStatic>(visitor);
break;
case ESM::REC_ALCH4:
cell.mStore->template forEachType<ESM4::Potion>(visitor);
break;
Expand Down
3 changes: 3 additions & 0 deletions apps/openmw/mwlua/types/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace MWLua
constexpr std::string_view ESM4Ingredient = "ESM4Ingredient";
constexpr std::string_view ESM4Light = "ESM4Light";
constexpr std::string_view ESM4MiscItem = "ESM4Miscellaneous";
constexpr std::string_view ESM4MovableStatic = "ESM4MovableStatic";
constexpr std::string_view ESM4Potion = "ESM4Potion";
constexpr std::string_view ESM4Static = "ESM4Static";
constexpr std::string_view ESM4Terminal = "ESM4Terminal";
Expand Down Expand Up @@ -91,6 +92,7 @@ namespace MWLua
{ ESM::REC_INGR4, ObjectTypeName::ESM4Ingredient },
{ ESM::REC_LIGH4, ObjectTypeName::ESM4Light },
{ ESM::REC_MISC4, ObjectTypeName::ESM4MiscItem },
{ ESM::REC_MSTT4, ObjectTypeName::ESM4MovableStatic },
{ ESM::REC_ALCH4, ObjectTypeName::ESM4Potion },
{ ESM::REC_STAT4, ObjectTypeName::ESM4Static },
{ ESM::REC_TERM4, ObjectTypeName::ESM4Terminal },
Expand Down Expand Up @@ -230,6 +232,7 @@ namespace MWLua
addType(ObjectTypeName::ESM4Ingredient, { ESM::REC_INGR4 });
addType(ObjectTypeName::ESM4Light, { ESM::REC_LIGH4 });
addType(ObjectTypeName::ESM4MiscItem, { ESM::REC_MISC4 });
addType(ObjectTypeName::ESM4MovableStatic, { ESM::REC_MSTT4 });
addType(ObjectTypeName::ESM4Potion, { ESM::REC_ALCH4 });
addType(ObjectTypeName::ESM4Static, { ESM::REC_STAT4 });
addESM4TerminalBindings(addType(ObjectTypeName::ESM4Terminal, { ESM::REC_TERM4 }), context);
Expand Down
1 change: 1 addition & 0 deletions apps/openmw/mwworld/cellstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadmisc.hpp>
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadnpc.hpp>
#include <components/esm4/loadrefr.hpp>
#include <components/esm4/loadstat.hpp>
Expand Down
6 changes: 4 additions & 2 deletions apps/openmw/mwworld/cellstore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ namespace ESM4
struct Flora;
struct Ingredient;
struct MiscItem;
struct MovableStatic;
struct Terminal;
struct Tree;
struct Weapon;
Expand All @@ -95,8 +96,9 @@ namespace MWWorld
CellRefList<ESM4::Static>, CellRefList<ESM4::Light>, CellRefList<ESM4::Activator>, CellRefList<ESM4::Potion>,
CellRefList<ESM4::Ammunition>, CellRefList<ESM4::Armor>, CellRefList<ESM4::Book>, CellRefList<ESM4::Clothing>,
CellRefList<ESM4::Container>, CellRefList<ESM4::Door>, CellRefList<ESM4::Flora>, CellRefList<ESM4::Ingredient>,
CellRefList<ESM4::Terminal>, CellRefList<ESM4::Tree>, CellRefList<ESM4::MiscItem>, CellRefList<ESM4::Weapon>,
CellRefList<ESM4::Furniture>, CellRefList<ESM4::Creature>, CellRefList<ESM4::Npc>>;
CellRefList<ESM4::Terminal>, CellRefList<ESM4::Tree>, CellRefList<ESM4::MiscItem>,
CellRefList<ESM4::MovableStatic>, CellRefList<ESM4::Weapon>, CellRefList<ESM4::Furniture>,
CellRefList<ESM4::Creature>, CellRefList<ESM4::Npc>>;

/// \brief Mutable state of a cell
class CellStore
Expand Down
1 change: 1 addition & 0 deletions apps/openmw/mwworld/esmstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ namespace MWWorld
case ESM::REC_LVLC4:
case ESM::REC_LVLN4:
case ESM::REC_MISC4:
case ESM::REC_MSTT4:
case ESM::REC_NPC_4:
case ESM::REC_STAT4:
case ESM::REC_TERM4:
Expand Down
10 changes: 6 additions & 4 deletions apps/openmw/mwworld/esmstore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ namespace ESM4
struct HeadPart;
struct Ingredient;
struct Land;
struct LandTexture;
struct LevelledCreature;
struct LevelledItem;
struct LevelledNpc;
struct Light;
struct MiscItem;
struct MovableStatic;
struct Npc;
struct Outfit;
struct Potion;
Expand Down Expand Up @@ -139,10 +141,10 @@ namespace MWWorld
Store<ESM4::Armor>, Store<ESM4::ArmorAddon>, Store<ESM4::Book>, Store<ESM4::Cell>, Store<ESM4::Clothing>,
Store<ESM4::Container>, Store<ESM4::Creature>, Store<ESM4::Door>, Store<ESM4::Furniture>,
Store<ESM4::Flora>, Store<ESM4::Hair>, Store<ESM4::HeadPart>, Store<ESM4::Ingredient>, Store<ESM4::Land>,
Store<ESM4::LevelledCreature>, Store<ESM4::LevelledItem>, Store<ESM4::LevelledNpc>, Store<ESM4::Light>,
Store<ESM4::MiscItem>, Store<ESM4::Npc>, Store<ESM4::Outfit>, Store<ESM4::Potion>, Store<ESM4::Race>,
Store<ESM4::Reference>, Store<ESM4::Static>, Store<ESM4::Terminal>, Store<ESM4::Tree>, Store<ESM4::Weapon>,
Store<ESM4::World>>;
Store<ESM4::LandTexture>, Store<ESM4::LevelledCreature>, Store<ESM4::LevelledItem>,
Store<ESM4::LevelledNpc>, Store<ESM4::Light>, Store<ESM4::MiscItem>, Store<ESM4::MovableStatic>,
Store<ESM4::Npc>, Store<ESM4::Outfit>, Store<ESM4::Potion>, Store<ESM4::Race>, Store<ESM4::Reference>,
Store<ESM4::Static>, Store<ESM4::Terminal>, Store<ESM4::Tree>, Store<ESM4::Weapon>, Store<ESM4::World>>;

private:
template <typename T>
Expand Down
2 changes: 2 additions & 0 deletions apps/openmw/mwworld/store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,11 +1363,13 @@ template class MWWorld::TypedDynamicStore<ESM4::Hair>;
template class MWWorld::TypedDynamicStore<ESM4::HeadPart>;
template class MWWorld::TypedDynamicStore<ESM4::Ingredient>;
template class MWWorld::TypedDynamicStore<ESM4::Land>;
template class MWWorld::TypedDynamicStore<ESM4::LandTexture>;
template class MWWorld::TypedDynamicStore<ESM4::LevelledCreature>;
template class MWWorld::TypedDynamicStore<ESM4::LevelledItem>;
template class MWWorld::TypedDynamicStore<ESM4::LevelledNpc>;
template class MWWorld::TypedDynamicStore<ESM4::Light>;
template class MWWorld::TypedDynamicStore<ESM4::MiscItem>;
template class MWWorld::TypedDynamicStore<ESM4::MovableStatic>;
template class MWWorld::TypedDynamicStore<ESM4::Npc>;
template class MWWorld::TypedDynamicStore<ESM4::Outfit>;
template class MWWorld::TypedDynamicStore<ESM4::Potion>;
Expand Down
2 changes: 2 additions & 0 deletions components/esm/records.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadland.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadltex.hpp>
#include <components/esm4/loadlvlc.hpp>
#include <components/esm4/loadlvli.hpp>
#include <components/esm4/loadlvln.hpp>
#include <components/esm4/loadmisc.hpp>
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadnpc.hpp>
#include <components/esm4/loadotft.hpp>
#include <components/esm4/loadrace.hpp>
Expand Down
3 changes: 3 additions & 0 deletions files/lua_api/openmw/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,9 @@
--- Functions for @{#ESM4Miscellaneous} objects
-- @field [parent=#types] #ESM4Miscellaneous ESM4Miscellaneous

--- Functions for @{#ESM4MovableStatic} objects
-- @field [parent=#types] #ESM4MovableStatic ESM4MovableStatic

--- Functions for @{#ESM4Potion} objects
-- @field [parent=#types] #ESM4Potion ESM4Potion

Expand Down

0 comments on commit 62b787a

Please sign in to comment.