Skip to content

Commit 090e14e

Browse files
committed
Merge branch 'feature242' of https://github.com/cfailde/OpenXcom
Conflicts: src/Menu/OptionsAdvancedState.cpp
2 parents d1915a8 + 7d16c5a commit 090e14e

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

‎src/Engine/Options.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void createDefault()
9090
setString("language", "");
9191
setInt("battleScrollSpeed", 12); // 4, 8, 12, 16, 24
9292
setInt("battleScrollType", SCROLL_AUTO);
93-
setInt("battleScrollDragButton", SDL_BUTTON_MIDDLE);
93+
setInt("battleScrollDragButton", SDL_BUTTON_MIDDLE);
9494
setBool("battleScrollDragInvert", false); // true drags away from the cursor, false drags towards (like a grab)
9595
setInt("battleScrollDragTimeTolerance", 300); // miliSecond
9696
setInt("battleScrollDragPixelTolerance", 10); // count of pixels
@@ -145,7 +145,7 @@ void createDefault()
145145
setInt("NewBattleDifficulty", 0);
146146
setInt("NewBattleDarkness", 0);
147147
setInt("NewBattleCraft", 0);
148-
148+
149149
// new battle loadout data
150150
setInt("NewBattle_STR_AC_AP_AMMO", 0);
151151
setInt("NewBattle_STR_AC_HE_AMMO", 0);

‎src/Geoscape/InterceptState.cpp‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "../Ruleset/RuleCraft.h"
3232
#include "../Savegame/SavedGame.h"
3333
#include "../Engine/Options.h"
34+
#include "Globe.h"
3435
#include "SelectDestinationState.h"
3536

3637
namespace OpenXcom
@@ -104,6 +105,7 @@ InterceptState::InterceptState(Game *game, Globe *globe, Base *base) : State(gam
104105
_lstCrafts->setBackground(_window);
105106
_lstCrafts->setMargin(6);
106107
_lstCrafts->onMouseClick((ActionHandler)&InterceptState::lstCraftsClick);
108+
_lstCrafts->onMouseClick((ActionHandler)&InterceptState::lstCraftsRightClick, SDL_BUTTON_RIGHT);
107109

108110
int row = 0;
109111
for (std::vector<Base*>::iterator i = _game->getSavedGame()->getBases()->begin(); i != _game->getSavedGame()->getBases()->end(); ++i)
@@ -119,7 +121,7 @@ InterceptState::InterceptState(Game *game, Globe *globe, Base *base) : State(gam
119121
}
120122
else
121123
{
122-
ss << (*j)->getNumWeapons();
124+
ss << 0;
123125
}
124126
ss << "/";
125127
if ((*j)->getNumSoldiers() > 0)
@@ -128,7 +130,7 @@ InterceptState::InterceptState(Game *game, Globe *globe, Base *base) : State(gam
128130
}
129131
else
130132
{
131-
ss << (*j)->getNumSoldiers();
133+
ss << 0;
132134
}
133135
ss << "/";
134136
if ((*j)->getNumVehicles() > 0)
@@ -137,7 +139,7 @@ InterceptState::InterceptState(Game *game, Globe *globe, Base *base) : State(gam
137139
}
138140
else
139141
{
140-
ss << (*j)->getNumVehicles();
142+
ss << 0;
141143
}
142144
_crafts.push_back(*j);
143145
_lstCrafts->addRow(4, (*j)->getName(_game->getLanguage()).c_str(), tr((*j)->getStatus()).c_str(), (*i)->getName().c_str(), ss.str().c_str());
@@ -174,11 +176,25 @@ void InterceptState::btnCancelClick(Action *)
174176
void InterceptState::lstCraftsClick(Action *)
175177
{
176178
Craft* c = _crafts[_lstCrafts->getSelectedRow()];
177-
if (c->getStatus() != "STR_OUT" && (c->getStatus() == "STR_READY" || Options::getBool("craftLaunchAlways")))
179+
if ((c->getStatus() != "STR_OUT" && (c->getStatus() == "STR_READY" || Options::getBool("craftLaunchAlways"))) || c->getStatus() == "STR_OUT")
178180
{
179181
_game->popState();
180182
_game->pushState(new SelectDestinationState(_game, c, _globe));
181183
}
182184
}
183185

186+
/**
187+
* Centers on the selected craft.
188+
* @param action Pointer to an action.
189+
*/
190+
void InterceptState::lstCraftsRightClick(Action *)
191+
{
192+
Craft* c = _crafts[_lstCrafts->getSelectedRow()];
193+
if (c->getStatus() == "STR_OUT")
194+
{
195+
_globe->center(c->getLongitude(), c->getLatitude());
196+
_game->popState();
197+
}
198+
}
199+
184200
}

‎src/Geoscape/InterceptState.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class InterceptState : public State
5656
void btnCancelClick(Action *action);
5757
/// Handler for clicking the Crafts list.
5858
void lstCraftsClick(Action *action);
59+
/// Handler for right clicking the Crafts list.
60+
void lstCraftsRightClick(Action *action);
5961
};
6062

6163
}

0 commit comments

Comments
 (0)