mirror of https://github.com/zeldaret/botw.git
uking/ui: Add named constants for inventory item limits
Cleaner
This commit is contained in:
parent
2ae06d6b39
commit
d943be4ea1
|
|
@ -688,23 +688,23 @@ bool PauseMenuDataMgr::isOverCategoryLimit(PouchItemType type) const {
|
|||
const auto count = countItemsWithType(type);
|
||||
switch (type) {
|
||||
case PouchItemType::Weapon:
|
||||
return ksys::gdt::getFlag_WeaponPorchStockNum() <= count || count >= 20;
|
||||
return ksys::gdt::getFlag_WeaponPorchStockNum() <= count || count >= NumWeaponsMax;
|
||||
case PouchItemType::Bow:
|
||||
return ksys::gdt::getFlag_BowPorchStockNum() <= count || count >= 14;
|
||||
return ksys::gdt::getFlag_BowPorchStockNum() <= count || count >= NumBowsMax;
|
||||
case PouchItemType::Arrow:
|
||||
return count >= 6;
|
||||
return count >= NumArrowsMax;
|
||||
case PouchItemType::Shield:
|
||||
return ksys::gdt::getFlag_ShieldPorchStockNum() <= count || count >= 20;
|
||||
return ksys::gdt::getFlag_ShieldPorchStockNum() <= count || count >= NumShieldsMax;
|
||||
case PouchItemType::ArmorHead:
|
||||
case PouchItemType::ArmorUpper:
|
||||
case PouchItemType::ArmorLower:
|
||||
return count >= 100;
|
||||
return count >= NumArmorsMax;
|
||||
case PouchItemType::Material:
|
||||
return count >= 160;
|
||||
return count >= NumMaterialsMax;
|
||||
case PouchItemType::Food:
|
||||
return count >= 60;
|
||||
return count >= NumFoodMax;
|
||||
case PouchItemType::KeyItem:
|
||||
return count >= 40;
|
||||
return count >= NumKeyItemsMax;
|
||||
case PouchItemType::Invalid:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,20 @@ class InfoData;
|
|||
|
||||
namespace uking::ui {
|
||||
|
||||
constexpr int NumPouchItemsMax = 420;
|
||||
constexpr int NumWeaponsMax = 20;
|
||||
constexpr int NumBowsMax = 14;
|
||||
constexpr int NumArrowsMax = 6;
|
||||
constexpr int NumShieldsMax = 20;
|
||||
constexpr int NumArmorsMax = 100;
|
||||
constexpr int NumMaterialsMax = 160;
|
||||
constexpr int NumFoodMax = 60;
|
||||
constexpr int NumKeyItemsMax = 40;
|
||||
|
||||
constexpr int NumPouchItemsMax = NumWeaponsMax + NumBowsMax + NumArrowsMax + NumShieldsMax +
|
||||
NumArmorsMax + NumMaterialsMax + NumFoodMax + NumKeyItemsMax;
|
||||
|
||||
static_assert(NumPouchItemsMax == 420, "NumPouchItemsMax must be 420 for now");
|
||||
|
||||
// TODO: figure out what this is
|
||||
constexpr int NumPouch50 = 50;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue