uking/ui: Add even more inventory functions

This commit is contained in:
Léo Lam
2021-01-21 14:01:41 +01:00
parent 3b996a212c
commit 620eb2b39e
10 changed files with 473 additions and 94 deletions
+16
View File
@@ -1,7 +1,23 @@
#include "Game/UI/uiUtils.h"
#include "Game/Actor/actWeapon.h"
#include "KingSystem/ActorSystem/actInfoCommon.h"
#include "KingSystem/ActorSystem/actInfoData.h"
#include "Game/UI/uiPauseMenuDataMgr.h"
namespace uking::ui {
bool isMasterSwordItem(const PouchItem& item) {
return item.getType() == PouchItemType::Sword && isMasterSwordActorName(item.getName());
}
int getWeaponInventoryLife(const sead::SafeString& name) {
auto* info = ksys::act::InfoData::instance();
if (!info)
return 0;
const int life = ksys::act::getGeneralLife(info, name.cstr());
return act::WeaponModifierInfo::getLifeMultiplier() * life;
}
bool isMasterSwordActorName(const sead::SafeString& name) {
return name == "Weapon_Sword_070";
}