@@ -53,9 +53,8 @@ namespace OpenXcom
5353{
5454
5555static const int _templateBtnX = 288 ;
56- static const int _createTemplateBtnY = 67 ;
57- static const int _applyTemplateBtnY = 90 ;
58- static const int _clearInventoryBtnY = 113 ;
56+ static const int _createTemplateBtnY = 90 ;
57+ static const int _applyTemplateBtnY = 113 ;
5958
6059/* *
6160 * Initializes all the elements in the Inventory screen.
@@ -99,7 +98,6 @@ InventoryState::InventoryState(bool tu, BattlescapeState *parent) : _tu(tu), _pa
9998 _btnRank = new InteractiveSurface (26 , 23 , 0 , 0 );
10099 _btnCreateTemplate = new InteractiveSurface (32 , 22 , _templateBtnX, _createTemplateBtnY);
101100 _btnApplyTemplate = new InteractiveSurface (32 , 22 , _templateBtnX, _applyTemplateBtnY);
102- _btnClearInventory = new InteractiveSurface (32 , 22 , _templateBtnX, _clearInventoryBtnY);
103101 _selAmmo = new Surface (RuleInventory::HAND_W * RuleInventory::SLOT_W , RuleInventory::HAND_H * RuleInventory::SLOT_H , 272 , 88 );
104102 _inv = new Inventory (_game, 320 , 200 , 0 , 0 , _parent == 0 );
105103
@@ -125,7 +123,6 @@ InventoryState::InventoryState(bool tu, BattlescapeState *parent) : _tu(tu), _pa
125123 add (_btnRank);
126124 add (_btnCreateTemplate);
127125 add (_btnApplyTemplate);
128- add (_btnClearInventory);
129126 add (_selAmmo);
130127 add (_inv);
131128
@@ -212,23 +209,17 @@ InventoryState::InventoryState(bool tu, BattlescapeState *parent) : _tu(tu), _pa
212209
213210 _btnApplyTemplate->onMouseClick ((ActionHandler)&InventoryState::btnApplyTemplateClick);
214211 _btnApplyTemplate->onKeyboardPress ((ActionHandler)&InventoryState::btnApplyTemplateClick, Options::keyInvApplyTemplate);
212+ _btnApplyTemplate->onKeyboardPress ((ActionHandler)&InventoryState::onClearInventory, Options::keyInvClear);
215213 _btnApplyTemplate->setTooltip (" STR_APPLY_INVENTORY_TEMPLATE" );
216214 _btnApplyTemplate->onMouseIn ((ActionHandler)&InventoryState::txtTooltipIn);
217215 _btnApplyTemplate->onMouseOut ((ActionHandler)&InventoryState::txtTooltipOut);
218216
219- _btnClearInventory->onMouseClick ((ActionHandler)&InventoryState::btnClearInventoryClick);
220- _btnClearInventory->onKeyboardPress ((ActionHandler)&InventoryState::btnClearInventoryClick, Options::keyInvClear);
221- _btnClearInventory->setTooltip (" STR_CLEAR_INVENTORY" );
222- _btnClearInventory->onMouseIn ((ActionHandler)&InventoryState::txtTooltipIn);
223- _btnClearInventory->onMouseOut ((ActionHandler)&InventoryState::txtTooltipOut);
224-
225217
226218 // only use copy/paste buttons in setup (i.e. non-tu) mode
227219 if (_tu)
228220 {
229221 _btnCreateTemplate->setVisible (false );
230222 _btnApplyTemplate->setVisible (false );
231- _btnClearInventory->setVisible (false );
232223 }
233224 else
234225 {
@@ -600,6 +591,7 @@ void InventoryState::btnCreateTemplateClick(Action *action)
600591
601592 // give audio feedback
602593 _game->getResourcePack ()->getSound (" BATTLE.CAT" , 38 )->play ();
594+ _refreshMouse ();
603595}
604596
605597static void _clearInventory (Game *game, std::vector<BattleItem*> *unitInv, Tile *groundTile)
@@ -744,7 +736,7 @@ void InventoryState::_refreshMouse()
744736 SDL_WarpMouse (x, y);
745737}
746738
747- void InventoryState::btnClearInventoryClick (Action *action)
739+ void InventoryState::onClearInventory (Action *action)
748740{
749741 // don't accept clicks when moving items
750742 if (_inv->getSelectedItem () != 0 )
@@ -919,8 +911,6 @@ void InventoryState::_updateTemplateButtons(bool isVisible)
919911{
920912 if (isVisible)
921913 {
922- _game->getResourcePack ()->getSurface (" InvClear" )->blit (_btnClearInventory);
923-
924914 if (_curInventoryTemplate.empty ())
925915 {
926916 // use "empty template" icons
@@ -938,7 +928,6 @@ void InventoryState::_updateTemplateButtons(bool isVisible)
938928 {
939929 _btnCreateTemplate->clear ();
940930 _btnApplyTemplate->clear ();
941- _btnClearInventory->clear ();
942931 }
943932}
944933}
0 commit comments