mirror of
https://github.com/zeldaret/botw
synced 2026-06-18 07:15:22 -04:00
uking/ui: Implement material sorting for inventory
This commit is contained in:
+26
-1
@@ -1,8 +1,10 @@
|
||||
#include "Game/UI/uiUtils.h"
|
||||
#include "Game/Actor/actWeapon.h"
|
||||
#include "Game/DLC/aoc2.h"
|
||||
#include "Game/UI/uiPauseMenuDataMgr.h"
|
||||
#include "KingSystem/ActorSystem/actInfoCommon.h"
|
||||
#include "KingSystem/ActorSystem/actInfoData.h"
|
||||
#include "Game/UI/uiPauseMenuDataMgr.h"
|
||||
#include "KingSystem/Utils/Byaml/Byaml.h"
|
||||
|
||||
namespace uking::ui {
|
||||
|
||||
@@ -10,6 +12,29 @@ bool isMasterSwordItem(const PouchItem& item) {
|
||||
return item.getType() == PouchItemType::Sword && isMasterSwordActorName(item.getName());
|
||||
}
|
||||
|
||||
int getItemHitPointRecover(const sead::SafeString& name) {
|
||||
auto* info = ksys::act::InfoData::instance();
|
||||
if (!info)
|
||||
return 0;
|
||||
|
||||
al::ByamlIter iter;
|
||||
if (!info->getActorIter(&iter, name.cstr()))
|
||||
return 0;
|
||||
if (!info->hasTag(iter, ksys::act::tags::CureItem))
|
||||
return 0;
|
||||
if (!info->hasTag(iter, ksys::act::tags::CanUse))
|
||||
return 0;
|
||||
|
||||
int value = ksys::act::getCureItemHitPointRecover(iter);
|
||||
|
||||
if (aoc2::instance() && aoc2::instance()->checkFlag(aoc2::Flag::EnableHardMode) &&
|
||||
aoc2::instance()->isHardModeChangeOn(aoc2::HardModeChange::NerfHpRestore)) {
|
||||
aoc2::instance()->nerfHpRestore(&value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
int getWeaponInventoryLife(const sead::SafeString& name) {
|
||||
auto* info = ksys::act::InfoData::instance();
|
||||
if (!info)
|
||||
|
||||
Reference in New Issue
Block a user