Skip to content

Commit 5ae90c4

Browse files
committed
Merge branch 'master' into alpha_release
Conflicts: src/Battlescape/DebriefingState.cpp
2 parents 9a9e4d6 + 80c3daf commit 5ae90c4

84 files changed

Lines changed: 602 additions & 541 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Makefile.am‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ openxcom_SOURCES = \
143143
src/Battlescape/CivilianBAIState.h \
144144
src/Battlescape/DebriefingState.cpp \
145145
src/Battlescape/DebriefingState.h \
146-
src/Battlescape/DelayedSaveState.cpp \
147-
src/Battlescape/DelayedSaveState.h \
148146
src/Battlescape/ExplosionBState.cpp \
149147
src/Battlescape/ExplosionBState.h \
150148
src/Battlescape/Explosion.cpp \

‎bin/data/Language/en-GB.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,8 @@ en-GB:
13251325
STR_FULL_DISPLAY: "Full Display"
13261326
STR_FPS_LIMIT: "FPS limit"
13271327
STR_FPS_LIMIT_DESC: "Limits the number of screen updates per second, 0 for no limit. If OpenGL rendering is enabled, the game uses Vsync instead."
1328+
STR_FPS_INACTIVE_LIMIT: "FPS limit background"
1329+
STR_FPS_INACTIVE_LIMIT_DESC: "Limits the number of screen updates per second if OpenXcom is in the background."
13281330
STR_NOALIENPANICMESSAGES: "Suppress panic messages for aliens"
13291331
STR_NOALIENPANICMESSAGES_DESC: "Don't show panic messages for aliens unless they are visible to the player."
13301332
STR_ALIENBLEEDING: "Alien bleeding"
@@ -1357,7 +1359,6 @@ en-GB:
13571359
STR_DISABLED: "Disabled"
13581360
STR_MAXIMIZE_INFO_SCREENS: "Maximize info screens"
13591361
STR_MAXIMIZE_INFO_SCREENS_DESC: "Inventory and various other screens will be displayed at full screen, regardless of scale settings."
1360-
STR_JAPANESE_FONT: "If you have a Japanese font that works in OpenXCom: please, send it to us and let us know if we can use it."
13611362
STR_NOT_ENOUGH_ITEMS_FOR_TEMPLATE: "Not enough items to copy template!"
13621363
STR_DIARY: "RECORD"
13631364
STR_KILLED: "KILLED"
@@ -1401,3 +1402,8 @@ en-GB:
14011402
STR_HEAVY_WEAPONS_PLATFORM_LC: "Heavy Weapons Platform"
14021403
STR_UNLOAD_WEAPON: "Unload weapon"
14031404
STR_ALL_ITEMS: "All Items"
1405+
STR_NO_MORE_EQUIPMENT_ALLOWED:
1406+
one: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} item of equipment on this craft."
1407+
few: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} items of equipment on this craft."
1408+
many: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} items of equipment on this craft."
1409+
other: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} items of equipment on this craft."

‎bin/data/Language/en-US.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,8 @@ en-US:
13251325
STR_FULL_DISPLAY: "Full Display"
13261326
STR_FPS_LIMIT: "FPS limit"
13271327
STR_FPS_LIMIT_DESC: "Limits the number of screen updates per second, 0 for no limit. If OpenGL rendering is enabled, the game uses Vsync instead."
1328+
STR_FPS_INACTIVE_LIMIT: "FPS limit background"
1329+
STR_FPS_INACTIVE_LIMIT_DESC: "Limits the number of screen updates per second if OpenXcom is in the background."
13281330
STR_NOALIENPANICMESSAGES: "Suppress panic messages for aliens"
13291331
STR_NOALIENPANICMESSAGES_DESC: "Don't show panic messages for aliens unless they are visible to the player."
13301332
STR_ALIENBLEEDING: "Alien bleeding"
@@ -1357,7 +1359,6 @@ en-US:
13571359
STR_DISABLED: "Disabled"
13581360
STR_MAXIMIZE_INFO_SCREENS: "Maximize info screens"
13591361
STR_MAXIMIZE_INFO_SCREENS_DESC: "Inventory and various other screens will be displayed at full screen, regardless of scale settings."
1360-
STR_JAPANESE_FONT: "If you have a Japanese font that works in OpenXCom: please, send it to us and let us know if we can use it."
13611362
STR_NOT_ENOUGH_ITEMS_FOR_TEMPLATE: "Not enough items to copy template!"
13621363
STR_DIARY: "RECORD"
13631364
STR_KILLED: "KILLED"
@@ -1401,3 +1402,8 @@ en-US:
14011402
STR_HEAVY_WEAPONS_PLATFORM_LC: "Heavy Weapons Platform"
14021403
STR_UNLOAD_WEAPON: "Unload weapon"
14031404
STR_ALL_ITEMS: "All Items"
1405+
STR_NO_MORE_EQUIPMENT_ALLOWED:
1406+
one: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} item of equipment on this craft."
1407+
few: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} items of equipment on this craft."
1408+
many: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} items of equipment on this craft."
1409+
other: "NO MORE EQUIPMENT ALLOWED ON BOARD!{SMALLLINE}You are only allowed to take a maximum of {N} items of equipment on this craft."
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Enforce the old 80 item limit on crafts.
2+
# includes the interceptor and firestorm in this list in case people are using the interceptor/firestorm maps
3+
crafts:
4+
- type: STR_SKYRANGER
5+
maxItems: 80
6+
- type: STR_INTERCEPTOR
7+
maxItems: 80
8+
- type: STR_FIRESTORM
9+
maxItems: 80
10+
- type: STR_LIGHTNING
11+
maxItems: 80
12+
- type: STR_AVENGER
13+
maxItems: 80

‎src/Basescape/BaseInfoState.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ void BaseInfoState::handleKeyPress(Action *action)
461461
{
462462
if (key == baseKeys[i])
463463
{
464+
_mini->setSelectedBase(i);
464465
_base = _game->getSavedGame()->getBases()->at(i);
466+
_state->setBase(_base);
465467
init();
466468
break;
467469
}

‎src/Basescape/CraftEquipmentState.cpp‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace OpenXcom
5959
* @param base Pointer to the base to get info from.
6060
* @param craft ID of the selected craft.
6161
*/
62-
CraftEquipmentState::CraftEquipmentState(Base *base, size_t craft) : _sel(0), _craft(craft), _base(base)
62+
CraftEquipmentState::CraftEquipmentState(Base *base, size_t craft) : _sel(0), _craft(craft), _base(base), _totalItems(0)
6363
{
6464
Craft *c = _base->getCrafts()->at(_craft);
6565
bool craftHasACrew = c->getNumSoldiers() > 0;
@@ -166,6 +166,7 @@ CraftEquipmentState::CraftEquipmentState(Base *base, size_t craft) : _sel(0), _c
166166
else
167167
{
168168
cQty = c->getItems()->getItem(*i);
169+
_totalItems += cQty;
169170
}
170171
if (rule->getBigSprite() > -1 && rule->getBattleType() != BT_NONE && rule->getBattleType() != BT_CORPSE &&
171172
_game->getSavedGame()->isResearched(rule->getRequirements()) &&
@@ -489,6 +490,7 @@ void CraftEquipmentState::moveLeftByValue(int change)
489490
else
490491
{
491492
c->getItems()->removeItem(_items[_sel], change);
493+
_totalItems -= change;
492494
if (_game->getSavedGame()->getMonthsPassed() > -1)
493495
{
494496
_base->getItems()->addItem(_items[_sel], change);
@@ -582,7 +584,15 @@ void CraftEquipmentState::moveRightByValue(int change)
582584
}
583585
else
584586
{
587+
if (c->getRules()->getMaxItems() > 0 && _totalItems + change > c->getRules()->getMaxItems())
588+
{
589+
_timerRight->stop();
590+
LocalizedText msg(tr("STR_NO_MORE_EQUIPMENT_ALLOWED", c->getRules()->getMaxItems()));
591+
_game->pushState(new ErrorMessageState(msg, _palette, Palette::blockOffset(15)+1, "BACK04.SCR", 2));
592+
change = c->getRules()->getMaxItems() - _totalItems;
593+
}
585594
c->getItems()->addItem(_items[_sel],change);
595+
_totalItems += change;
586596
if (_game->getSavedGame()->getMonthsPassed() > -1)
587597
{
588598
_base->getItems()->removeItem(_items[_sel],change);

‎src/Basescape/CraftEquipmentState.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class CraftEquipmentState : public State
4848
size_t _sel, _craft;
4949
Base *_base;
5050
std::vector<std::string> _items;
51+
int _totalItems;
5152
/// Updates quantities of item.
5253
void updateQuantity();
5354
public:

‎src/Basescape/CraftSoldiersState.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void CraftSoldiersState::init()
175175
*/
176176
void CraftSoldiersState::lstItemsLeftArrowClick(Action *action)
177177
{
178-
int row = _lstSoldiers->getSelectedRow();
178+
unsigned int row = _lstSoldiers->getSelectedRow();
179179
if (row > 0)
180180
{
181181
if (action->getDetails()->button.button == SDL_BUTTON_LEFT)
@@ -195,7 +195,7 @@ void CraftSoldiersState::lstItemsLeftArrowClick(Action *action)
195195
* @param row Selected soldier row.
196196
* @param max Move the soldier to the top?
197197
*/
198-
void CraftSoldiersState::moveSoldierUp(Action *action, int row, bool max)
198+
void CraftSoldiersState::moveSoldierUp(Action *action, unsigned int row, bool max)
199199
{
200200
Soldier *s = _base->getSoldiers()->at(row);
201201
if (max)
@@ -225,9 +225,9 @@ void CraftSoldiersState::moveSoldierUp(Action *action, int row, bool max)
225225
*/
226226
void CraftSoldiersState::lstItemsRightArrowClick(Action *action)
227227
{
228-
int row = _lstSoldiers->getSelectedRow();
228+
unsigned int row = _lstSoldiers->getSelectedRow();
229229
size_t numSoldiers = _base->getSoldiers()->size();
230-
if (0 < numSoldiers && INT_MAX >= numSoldiers && row < (int)numSoldiers - 1)
230+
if (0 < numSoldiers && INT_MAX >= numSoldiers && row < numSoldiers - 1)
231231
{
232232
if (action->getDetails()->button.button == SDL_BUTTON_LEFT)
233233
{
@@ -246,7 +246,7 @@ void CraftSoldiersState::lstItemsRightArrowClick(Action *action)
246246
* @param row Selected soldier row.
247247
* @param max Move the soldier to the bottom?
248248
*/
249-
void CraftSoldiersState::moveSoldierDown(Action *action, int row, bool max)
249+
void CraftSoldiersState::moveSoldierDown(Action *action, unsigned int row, bool max)
250250
{
251251
Soldier *s = _base->getSoldiers()->at(row);
252252
if (max)
@@ -322,7 +322,7 @@ void CraftSoldiersState::lstSoldiersMousePress(Action *action)
322322
{
323323
if (Options::changeValueByMouseWheel == 0)
324324
return;
325-
int row = _lstSoldiers->getSelectedRow();
325+
unsigned int row = _lstSoldiers->getSelectedRow();
326326
size_t numSoldiers = _base->getSoldiers()->size();
327327
if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP &&
328328
row > 0)
@@ -334,7 +334,7 @@ void CraftSoldiersState::lstSoldiersMousePress(Action *action)
334334
}
335335
}
336336
else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN &&
337-
0 < numSoldiers && INT_MAX >= numSoldiers && row < (int)numSoldiers - 1)
337+
0 < numSoldiers && INT_MAX >= numSoldiers && row < numSoldiers - 1)
338338
{
339339
if (action->getAbsoluteXMouse() >= _lstSoldiers->getArrowsLeftEdge() &&
340340
action->getAbsoluteXMouse() <= _lstSoldiers->getArrowsRightEdge())

‎src/Basescape/CraftSoldiersState.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ class CraftSoldiersState : public State
5656
/// Handler for clicking the Soldiers reordering button.
5757
void lstItemsLeftArrowClick(Action *action);
5858
/// Moves a soldier up.
59-
void moveSoldierUp(Action *action, int row, bool max = false);
59+
void moveSoldierUp(Action *action, unsigned int row, bool max = false);
6060
/// Handler for clicking the Soldiers reordering button.
6161
void lstItemsRightArrowClick(Action *action);
6262
/// Moves a soldier down.
63-
void moveSoldierDown(Action *action, int row, bool max = false);
63+
void moveSoldierDown(Action *action, unsigned int row, bool max = false);
6464
/// Handler for clicking the Soldiers list.
6565
void lstSoldiersClick(Action *action);
6666
/// Handler for pressing-down a mouse-button in the list.

‎src/Basescape/NewManufactureListState.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void NewManufactureListState::btnOkClick(Action *)
146146
*/
147147
void NewManufactureListState::lstProdClick(Action *)
148148
{
149-
RuleManufacture *rule;
149+
RuleManufacture *rule = 0;
150150
for (std::vector<RuleManufacture *>::iterator it = _possibleProductions.begin(); it != _possibleProductions.end(); ++it)
151151
{
152152
if ((*it)->getName().c_str() == _displayedStrings[_lstManufacture->getSelectedRow()])

0 commit comments

Comments
 (0)