Skip to content

Commit

Permalink
= fixed being able to repair consumables with more then 1 usage
Browse files Browse the repository at this point in the history
~ st_unequip is hardcoded string to display text for unequippable slotted items
  • Loading branch information
revolucas authored and Xottab-DUTY committed Dec 17, 2017
1 parent d25f6bf commit 4c6fc27
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/xrGame/ui/UIActorMenuInventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,12 @@ void CUIActorMenu::PropertiesBoxForSlots(PIItem item, bool& b_show)
if (!pOutfit)
{
if (!pHelmet)
m_UIPropertiesBox->AddItem("st_move_to_bag", NULL, INVENTORY_TO_BAG_ACTION);
{
if (m_currMenuMode == mmDeadBodySearch)
m_UIPropertiesBox->AddItem("st_move_to_bag", nullptr, INVENTORY_TO_BAG_ACTION);
else
m_UIPropertiesBox->AddItem("st_unequip", nullptr, INVENTORY_TO_BAG_ACTION);
}
else
m_UIPropertiesBox->AddItem("st_undress_helmet", NULL, INVENTORY_TO_BAG_ACTION);
}
Expand Down
10 changes: 10 additions & 0 deletions src/xrGame/ui/UIActorMenu_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "UICellItem.h"
#include "ai_space.h"
#include "xrScriptEngine/script_engine.hpp"
#include "eatable_item.h"

using namespace luabind;

Expand All @@ -27,6 +28,15 @@ void CUIActorMenu::TryRepairItem(CUIWindow* w, void* d)
return;
}
LPCSTR item_name = item->m_section_id.c_str();

CEatableItem* EItm = smart_cast<CEatableItem*>(item);
if (EItm)
{
bool allow_repair = !!READ_IF_EXISTS(pSettings, r_bool, item_name, "allow_repair", false);
if (!allow_repair)
return;
}

LPCSTR partner = m_pPartnerInvOwner->CharacterInfo().Profile().c_str();

luabind::functor<bool> funct;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ui/UIDragDropListEx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ void CUICellContainer::Draw()
//Alundaio: Highlight equipped items
PIItem iitem = static_cast<PIItem>(ui_cell.m_item->m_pData);
if (iitem && iitem->m_pInventory && iitem->m_pInventory->ItemFromSlot(iitem->BaseSlot()) == iitem)
select_mode = 3;
select_mode = 2;
//-Alundaio
}
}
Expand Down

0 comments on commit 4c6fc27

Please sign in to comment.