MCPcopy Create free account
hub / github.com/TurningWheel/Barony / executeOnItemClick

Method executeOnItemClick

src/interface/interface.cpp:8167–8386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8165}
8166
8167bool GenericGUIMenu::executeOnItemClick(Item* item)
8168{
8169 if ( !item )
8170 {
8171 return false;
8172 }
8173
8174 if ( guiType == GUI_TYPE_ITEMFX )
8175 {
8176 if ( itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_SCROLL_REPAIR
8177 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_SCROLL_CHARGING )
8178 {
8179 if ( itemEffectScrollItem && itemCategory(itemEffectScrollItem) == SCROLL )
8180 {
8181 messagePlayer(gui_player, MESSAGE_INVENTORY, Language::get(848)); // as you read the scroll it disappears...
8182 consumeItem(itemEffectScrollItem, gui_player);
8183 }
8184 repairItem(item);
8185 return true;
8186 }
8187 else if ( itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_RESTORE )
8188 {
8189 repairItem(item);
8190 return true;
8191 }
8192 else if ( itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_SCROLL_REMOVECURSE
8193 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_SPELL_REMOVECURSE )
8194 {
8195 if ( itemEffectScrollItem && itemCategory(itemEffectScrollItem) == SCROLL )
8196 {
8197 messagePlayer(gui_player, MESSAGE_INVENTORY, Language::get(848)); // as you read the scroll it disappears...
8198 consumeItem(itemEffectScrollItem, gui_player);
8199 }
8200 uncurseItem(item);
8201 return true;
8202 }
8203 else if ( itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_SCROLL_IDENTIFY
8204 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_SPELL_IDENTIFY )
8205 {
8206 if ( itemEffectScrollItem && itemCategory(itemEffectScrollItem) == SCROLL )
8207 {
8208 messagePlayer(gui_player, MESSAGE_INVENTORY, Language::get(848)); // as you read the scroll it disappears...
8209 consumeItem(itemEffectScrollItem, gui_player);
8210 }
8211 identifyItem(item);
8212 return true;
8213 }
8214 else if ( itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_ALTER_INSTRUMENT
8215 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_METALLURGY
8216 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_GEOMANCY
8217 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_FORGE_KEY
8218 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_FORGE_JEWEL
8219 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_ENHANCE_WEAPON
8220 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_RESHAPE_WEAPON
8221 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_ALTER_ARROW
8222 || itemfxGUI.currentMode == ItemEffectGUI_t::ITEMFX_MODE_VANDALISE )
8223 {
8224 alterItem(item);

Callers 3

updateTinkerMenuMethod · 0.80
updateFeatherMenuMethod · 0.80
updateItemEffectMenuMethod · 0.80

Calls 5

consumeItemFunction · 0.85
onFeatherChangeTabActionFunction · 0.85
itemCategoryFunction · 0.50
messagePlayerFunction · 0.50
uidToEntityFunction · 0.50

Tested by

no test coverage detected