mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-08 11:03:14 +00:00
TU24
This commit is contained in:
@@ -25,19 +25,6 @@ UIScene_InventoryMenu::UIScene_InventoryMenu(int iPad, void *_initData, UILayer
|
||||
|
||||
InventoryScreenInput *initData = static_cast<InventoryScreenInput *>(_initData);
|
||||
|
||||
if (app.GetGameSettings(iPad,eGameSetting_ClassicCrafting))
|
||||
{
|
||||
m_slotListCrafting.addSlots(InventoryMenu::CRAFT_SLOT_START, 4);
|
||||
m_slotListResult.addSlots(InventoryMenu::RESULT_SLOT, 1);
|
||||
m_labelCrafting.init(app.GetString(IDS_HOW_TO_PLAY_MENU_CRAFTING));
|
||||
|
||||
this->m_bIsClassicCrafting = true;
|
||||
}
|
||||
else
|
||||
this->m_bIsClassicCrafting = false;
|
||||
|
||||
SetClassicCrafting(this->m_bIsClassicCrafting);
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
|
||||
{
|
||||
@@ -50,17 +37,16 @@ UIScene_InventoryMenu::UIScene_InventoryMenu(int iPad, void *_initData, UILayer
|
||||
|
||||
initData->player->awardStat(GenericStats::openInventory(),GenericStats::param_openInventory());
|
||||
|
||||
if (this->m_bIsClassicCrafting)
|
||||
Initialize( initData->iPad, menu, false, InventoryMenu::INV_SLOT_START, eSectionInventoryUsing, eSectionInventoryMax, initData->bNavigateBack );
|
||||
else
|
||||
Initialize( initData->iPad, menu, false, InventoryMenu::INV_SLOT_START, eSectionInventoryUsing, eSectionInventoryCraftingGrid, initData->bNavigateBack );
|
||||
Initialize( initData->iPad, menu, false, InventoryMenu::INV_SLOT_START, eSectionInventoryUsing, eSectionInventoryMax, initData->bNavigateBack );
|
||||
|
||||
m_slotListArmor.addSlots(InventoryMenu::ARMOR_SLOT_START, InventoryMenu::ARMOR_SLOT_END - InventoryMenu::ARMOR_SLOT_START);
|
||||
|
||||
if(initData) delete initData;
|
||||
|
||||
for(unsigned int i = 0; i < MobEffect::NUM_EFFECTS; ++i)
|
||||
{
|
||||
m_bEffectTime[i] = 0;
|
||||
}
|
||||
|
||||
updateEffectsDisplay();
|
||||
addTimer(INVENTORY_UPDATE_EFFECTS_TIMER_ID,INVENTORY_UPDATE_EFFECTS_TIMER_TIME);
|
||||
@@ -69,27 +55,25 @@ UIScene_InventoryMenu::UIScene_InventoryMenu(int iPad, void *_initData, UILayer
|
||||
wstring UIScene_InventoryMenu::getMoviePath()
|
||||
{
|
||||
if(app.GetLocalPlayerCount() > 1)
|
||||
{
|
||||
return L"InventoryMenuSplit";
|
||||
}
|
||||
else
|
||||
{
|
||||
return L"InventoryMenu";
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_InventoryMenu::handleReload()
|
||||
{
|
||||
Initialize( m_iPad, m_menu, false, InventoryMenu::INV_SLOT_START, eSectionInventoryUsing, eSectionInventoryMax, m_bNavigateBack );
|
||||
|
||||
SetClassicCrafting(this->m_bIsClassicCrafting);
|
||||
|
||||
m_slotListArmor.addSlots(InventoryMenu::ARMOR_SLOT_START, InventoryMenu::ARMOR_SLOT_END - InventoryMenu::ARMOR_SLOT_START);
|
||||
|
||||
if (this->m_bIsClassicCrafting)
|
||||
{
|
||||
m_slotListCrafting.addSlots(InventoryMenu::CRAFT_SLOT_START, 4);
|
||||
m_slotListResult.addSlots(InventoryMenu::RESULT_SLOT, 1);
|
||||
}
|
||||
|
||||
for(unsigned int i = 0; i < MobEffect::NUM_EFFECTS; ++i)
|
||||
{
|
||||
m_bEffectTime[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int UIScene_InventoryMenu::getSectionColumns(ESceneSection eSection)
|
||||
@@ -106,12 +90,6 @@ int UIScene_InventoryMenu::getSectionColumns(ESceneSection eSection)
|
||||
case eSectionInventoryUsing:
|
||||
cols = 9;
|
||||
break;
|
||||
case eSectionInventoryCraftingGrid:
|
||||
cols = 2;
|
||||
break;
|
||||
case eSectionInventoryCraftingResult:
|
||||
cols = 1;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@@ -133,12 +111,6 @@ int UIScene_InventoryMenu::getSectionRows(ESceneSection eSection)
|
||||
case eSectionInventoryUsing:
|
||||
rows = 1;
|
||||
break;
|
||||
case eSectionInventoryCraftingGrid:
|
||||
rows = 2;
|
||||
break;
|
||||
case eSectionInventoryCraftingResult:
|
||||
rows = 1;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@@ -162,14 +134,6 @@ void UIScene_InventoryMenu::GetPositionOfSection( ESceneSection eSection, UIVec2
|
||||
pPosition->x = m_slotListHotbar.getXPos();
|
||||
pPosition->y = m_slotListHotbar.getYPos();
|
||||
break;
|
||||
case eSectionInventoryCraftingGrid:
|
||||
pPosition->x = m_slotListCrafting.getXPos();
|
||||
pPosition->y = m_slotListCrafting.getYPos();
|
||||
break;
|
||||
case eSectionInventoryCraftingResult:
|
||||
pPosition->x = m_slotListResult.getXPos();
|
||||
pPosition->y = m_slotListResult.getYPos();
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@@ -194,14 +158,6 @@ void UIScene_InventoryMenu::GetItemScreenData( ESceneSection eSection, int iItem
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
break;
|
||||
case eSectionInventoryCraftingGrid:
|
||||
sectionSize.x = m_slotListCrafting.getWidth();
|
||||
sectionSize.y = m_slotListCrafting.getHeight();
|
||||
break;
|
||||
case eSectionInventoryCraftingResult:
|
||||
sectionSize.x = m_slotListResult.getWidth();
|
||||
sectionSize.y = m_slotListResult.getHeight();
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@@ -238,15 +194,6 @@ void UIScene_InventoryMenu::setSectionSelectedSlot(ESceneSection eSection, int x
|
||||
case eSectionInventoryUsing:
|
||||
slotList = &m_slotListHotbar;
|
||||
break;
|
||||
case eSectionInventoryCraftingGrid:
|
||||
slotList = &m_slotListCrafting;
|
||||
break;
|
||||
case eSectionInventoryCraftingResult:
|
||||
slotList = &m_slotListResult;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
|
||||
slotList->setHighlightSlot(index);
|
||||
@@ -266,15 +213,6 @@ UIControl *UIScene_InventoryMenu::getSection(ESceneSection eSection)
|
||||
case eSectionInventoryUsing:
|
||||
control = &m_slotListHotbar;
|
||||
break;
|
||||
case eSectionInventoryCraftingGrid:
|
||||
control = &m_slotListCrafting;
|
||||
break;
|
||||
case eSectionInventoryCraftingResult:
|
||||
control = &m_slotListResult;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
return control;
|
||||
}
|
||||
@@ -296,7 +234,9 @@ void UIScene_InventoryMenu::customDraw(IggyCustomDrawCallbackRegion *region)
|
||||
ui.endCustomDraw(region);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIScene_AbstractContainerMenu::customDraw(region);
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_InventoryMenu::handleTimerComplete(int id)
|
||||
@@ -390,19 +330,3 @@ void UIScene_InventoryMenu::updateEffectsDisplay()
|
||||
|
||||
delete activeEffects;
|
||||
}
|
||||
|
||||
void UIScene_InventoryMenu::SetClassicCrafting(bool m_bIsClassicCrafting)
|
||||
{
|
||||
IggyDataValue result;
|
||||
IggyDataValue arg;
|
||||
arg.type = IGGY_DATATYPE_boolean;
|
||||
arg.boolval = m_bIsClassicCrafting;
|
||||
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetClassicCrafting , 1 , &arg );
|
||||
|
||||
if (!m_bIsClassicCrafting)
|
||||
{
|
||||
m_slotListArmor.UpdateControl();
|
||||
m_playerPreview.UpdateControl();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user