Skip to content

Commit 4c6fc27

Browse files
revolucasXottab-DUTY
authored andcommitted
= fixed being able to repair consumables with more then 1 usage
~ st_unequip is hardcoded string to display text for unequippable slotted items
1 parent d25f6bf commit 4c6fc27

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/xrGame/ui/UIActorMenuInventory.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,12 @@ void CUIActorMenu::PropertiesBoxForSlots(PIItem item, bool& b_show)
926926
if (!pOutfit)
927927
{
928928
if (!pHelmet)
929-
m_UIPropertiesBox->AddItem("st_move_to_bag", NULL, INVENTORY_TO_BAG_ACTION);
929+
{
930+
if (m_currMenuMode == mmDeadBodySearch)
931+
m_UIPropertiesBox->AddItem("st_move_to_bag", nullptr, INVENTORY_TO_BAG_ACTION);
932+
else
933+
m_UIPropertiesBox->AddItem("st_unequip", nullptr, INVENTORY_TO_BAG_ACTION);
934+
}
930935
else
931936
m_UIPropertiesBox->AddItem("st_undress_helmet", NULL, INVENTORY_TO_BAG_ACTION);
932937
}

src/xrGame/ui/UIActorMenu_script.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "UICellItem.h"
1313
#include "ai_space.h"
1414
#include "xrScriptEngine/script_engine.hpp"
15+
#include "eatable_item.h"
1516

1617
using namespace luabind;
1718

@@ -27,6 +28,15 @@ void CUIActorMenu::TryRepairItem(CUIWindow* w, void* d)
2728
return;
2829
}
2930
LPCSTR item_name = item->m_section_id.c_str();
31+
32+
CEatableItem* EItm = smart_cast<CEatableItem*>(item);
33+
if (EItm)
34+
{
35+
bool allow_repair = !!READ_IF_EXISTS(pSettings, r_bool, item_name, "allow_repair", false);
36+
if (!allow_repair)
37+
return;
38+
}
39+
3040
LPCSTR partner = m_pPartnerInvOwner->CharacterInfo().Profile().c_str();
3141

3242
luabind::functor<bool> funct;

src/xrGame/ui/UIDragDropListEx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ void CUICellContainer::Draw()
871871
//Alundaio: Highlight equipped items
872872
PIItem iitem = static_cast<PIItem>(ui_cell.m_item->m_pData);
873873
if (iitem && iitem->m_pInventory && iitem->m_pInventory->ItemFromSlot(iitem->BaseSlot()) == iitem)
874-
select_mode = 3;
874+
select_mode = 2;
875875
//-Alundaio
876876
}
877877
}

0 commit comments

Comments
 (0)