Skip to content

Commit fab16e7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into loadout_copy_paste
2 parents c176149 + 6ed4a5c commit fab16e7

82 files changed

Lines changed: 1617 additions & 472 deletions

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ openxcom_SOURCES = \
403403
src/Interface/ArrowButton.h \
404404
src/Interface/Bar.cpp \
405405
src/Interface/Bar.h \
406+
src/Interface/ComboBox.cpp \
407+
src/Interface/ComboBox.h \
406408
src/Interface/Cursor.cpp \
407409
src/Interface/Cursor.h \
408410
src/Interface/FpsCounter.cpp \
@@ -413,6 +415,8 @@ openxcom_SOURCES = \
413415
src/Interface/ImageButton.h \
414416
src/Interface/NumberText.cpp \
415417
src/Interface/NumberText.h \
418+
src/Interface/ScrollBar.cpp \
419+
src/Interface/ScrollBar.h \
416420
src/Interface/Slider.cpp \
417421
src/Interface/Slider.h \
418422
src/Interface/TextButton.cpp \
@@ -427,8 +431,6 @@ openxcom_SOURCES = \
427431
src/Interface/ToggleTextButton.h \
428432
src/Interface/Window.cpp \
429433
src/Interface/Window.h \
430-
src/Interface/ComboBox.cpp \
431-
src/Interface/ComboBox.h \
432434
src/lodepng.cpp \
433435
src/lodepng.h \
434436
src/main.cpp \

Run-Win64-Debug.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@cd bin\Win32
1+
@cd bin\Win64
22
@start Debug\OpenXcom.exe -data "..\data"

bin/data/Language/en-GB.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ en-GB:
2222
STR_MUTON_UFOPEDIA: "This humanoid creature is physically powerful and intelligent. They have a particular appetite for consuming raw flesh of any kind, which they need for sustenance like earth based carnivores. They appear to rely on telepathic commands from a race known as 'Ethereals'. Once separated from this telepathic link their mental system appears to break down and they die. The cybernetic implants are used to enhance their combat performance. They are clearly the foot soldiers for a higher intelligence."
2323
STR_MUTON_AUTOPSY: "Muton autopsy"
2424
STR_MUTON_AUTOPSY_UFOPEDIA: "The 'skin' of this creature appears to be an organically created protective armour which is grafted onto the body. There are numerous cybernetic implants which are used to enhance the cardio-vascular system and the senses. The reproductive organs appear to have been surgically removed. Evidently these unfortunate creatures are limited to a life of warfare and conquest. Armour piercing ammunition is not very effective against their toughened skin."
25-
STR_CELATID_UFOPEDIA: "This life-form has the mysterious natural ability to float through the air. It appears to detect human brain waves and will move towards a human target even if well hidden. Once a target is detected the Celatid lands and fires small globules of extremely corrosive venom. The creature has the ability to clone itself at an alarming rate. It accompanies the Muton race in its wonderings."
25+
STR_CELATID_UFOPEDIA: "This life-form has the mysterious natural ability to float through the air. It appears to detect human brain waves and will move towards a human target even if well hidden. Once a target is detected the Celatid lands and fires small globules of extremely corrosive venom. The creature has the ability to clone itself at an alarming rate. It accompanies the Muton race in its wanderings."
2626
STR_CELATID_AUTOPSY: "Celatid autopsy"
2727
STR_CELATID_AUTOPSY_UFOPEDIA: "The core contains a small bio-mechanical device which appears to be a naturally evolved anti-gravity propulsion system. The sac of venom is the largest organ and there does not appear to be a separate brain structure. There is no discernible digestive or reproductive system. A small organ contains embryos which can grow rapidly into a new being."
2828
STR_SILACOID_UFOPEDIA: "This silicon based life form generates an enormous amount of heat. It has the strength to crush rocks which can then be ingested by the hot core. It has a primitive intelligence and can be controlled by implants or telepathic beings. It works with the Muton alien race."
@@ -1121,10 +1121,10 @@ en-GB:
11211121
STR_ADVANCED: "ADVANCED"
11221122
STR_AGGRESSIVERETALIATION: "Aggressive retaliation"
11231123
STR_AGGRESSIVERETALIATION_DESC: "UFOs will attempt to detect your bases at all times, regardless of their mission parameters."
1124-
STR_STORAGELIMITSENFORCED: "Storage limits"
1125-
STR_STORAGELIMITSENFORCED_DESC: "Live alien containment and general stores limits will be imposed at all times."
1124+
STR_STORAGELIMITSENFORCED: "Storage limits for recovered items"
1125+
STR_STORAGELIMITSENFORCED_DESC: "Enforces alien containment and general store limits for live aliens and artifacts recovered from missions, unlike UFO: Enemy Unknown."
11261126
STR_CANSELLLIVEALIENS: "Live alien sale"
1127-
STR_CANSELLLIVEALIENS_DESC: "Allows the sale of live aliens, recommended when using containment limits."
1127+
STR_CANSELLLIVEALIENS_DESC: "Allows the sale of live aliens, recommended when using storage limits."
11281128
STR_ALLOWAUTOSELLPRODUCTION: "Manufacture auto-sale"
11291129
STR_ALLOWAUTOSELLPRODUCTION_DESC: "Right-click the increase button on a manufacturing project's \"total to produce\" to auto-sell."
11301130
STR_ALLOWBUILDINGQUEUE: "Allow building queue"
@@ -1136,7 +1136,7 @@ en-GB:
11361136
STR_BATTLEUFOEXTENDERACCURACY: "UFO Extender accuracy"
11371137
STR_BATTLEUFOEXTENDERACCURACY_DESC: "Accuracy of shots drops off after a certain distance, according to shot type. Adjusted accuracy will be displayed on the cursor."
11381138
STR_CANMANUFACTUREMOREITEMSPERHOUR: "TFTD manufacture rules"
1139-
STR_CANMANUFACTUREMOREITEMSPERHOUR_DESC: "Allows manufacturing projects to produce multiple items per hour, as opposed to X-COM: UFO Defense's one item limit."
1139+
STR_CANMANUFACTUREMOREITEMSPERHOUR_DESC: "Allows manufacturing projects to produce multiple items per hour, as opposed to UFO: Enemy Unknown's one item limit."
11401140
STR_CANTRANSFERCRAFTSWHILEAIRBORNE: "Airborne transfers"
11411141
STR_CANTRANSFERCRAFTSWHILEAIRBORNE_DESC: "Craft currently in-flight can be transferred."
11421142
STR_CRAFTLAUNCHALWAYS: "Force craft launch"
@@ -1326,18 +1326,24 @@ en-GB:
13261326
STR_FULL_DISPLAY: "Full Display"
13271327
STR_FPS_LIMIT: "FPS limit"
13281328
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."
1329-
STR_NOALIENPANICMESSAGES: "Supress panic messages for aliens."
1329+
STR_NOALIENPANICMESSAGES: "Supress panic messages for aliens"
13301330
STR_NOALIENPANICMESSAGES_DESC: "Don't show panic messages for aliens unless they are visible to the player."
13311331
STR_ALIENBLEEDING: "Alien bleeding"
13321332
STR_ALIENBLEEDING_DESC: "Allows fatal wounds to be inflicted on most aliens."
13331333
STR_FIELDPROMOTIONS: "Field promotions"
13341334
STR_FIELDPROMOTIONS_DESC: "Only soldiers that were present at the mission site are eligible for promotion."
13351335
STR_IRONMAN: "IRONMAN"
1336-
STR_IRONMAN_DESC: "No manual saving. All choices are permanent."
1336+
STR_IRONMAN_DESC: "No manual saving"
13371337
STR_SAVE_AND_ABANDON_GAME: "SAVE AND ABANDON GAME"
13381338
STR_MOD_UNSUCCESSFUL: "Mod failed to load"
13391339
STR_NEW_SAVED_GAME_SLOT: "<NEW SAVED GAME>"
13401340
STR_AUTO_SAVE_GEOSCAPE_SLOT: "<AUTOSAVE GEOSCAPE>"
13411341
STR_AUTO_SAVE_BATTLESCAPE_SLOT: "<AUTOSAVE BATTLESCAPE>"
13421342
STR_QUICK_SAVE_SLOT: "<QUICKSAVE>"
13431343
STR_DISPLAY_MODE_DESC: "Change how the game is displayed on your screen."
1344+
STR_PREFERRED_MUSIC_FORMAT: "Music Format"
1345+
STR_PREFERRED_MUSIC_FORMAT_DESC: "Chooses the preferred music format to use when multiple ones are available.{NEWLINE}NOTE: MIDI playback may be buggy on Windows."
1346+
STR_PREFERRED_SFX_FORMAT: "SFX Format"
1347+
STR_PREFERRED_SFX_FORMAT_DESC: "Chooses the preferred sound effects format to use when multiple ones are available."
1348+
STR_PREFERRED_FORMAT_AUTO: "Auto"
1349+
STR_CURRENT_FORMAT: "Current: {0}"

bin/data/Language/en-US.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,10 @@ en-US:
11211121
STR_ADVANCED: "ADVANCED"
11221122
STR_AGGRESSIVERETALIATION: "Aggressive retaliation"
11231123
STR_AGGRESSIVERETALIATION_DESC: "UFOs will attempt to detect your bases at all times, regardless of their mission parameters."
1124-
STR_STORAGELIMITSENFORCED: "Storage limits"
1125-
STR_STORAGELIMITSENFORCED_DESC: "Live alien containment and general stores limits will be imposed at all times."
1124+
STR_STORAGELIMITSENFORCED: "Storage limits for recovered items"
1125+
STR_STORAGELIMITSENFORCED_DESC: "Enforces alien containment and general store limits for live aliens and artifacts recovered from missions, unlike X-COM: UFO Defense."
11261126
STR_CANSELLLIVEALIENS: "Live alien sale"
1127-
STR_CANSELLLIVEALIENS_DESC: "Allows the sale of live aliens, recommended when using containment limits."
1127+
STR_CANSELLLIVEALIENS_DESC: "Allows the sale of live aliens, recommended when using storage limits."
11281128
STR_ALLOWAUTOSELLPRODUCTION: "Manufacture auto-sale"
11291129
STR_ALLOWAUTOSELLPRODUCTION_DESC: "Right-click the increase button on a manufacturing project's \"total to produce\" to auto-sell."
11301130
STR_ALLOWBUILDINGQUEUE: "Allow building queue"
@@ -1326,18 +1326,24 @@ en-US:
13261326
STR_FULL_DISPLAY: "Full Display"
13271327
STR_FPS_LIMIT: "FPS limit"
13281328
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."
1329-
STR_NOALIENPANICMESSAGES: "Supress panic messages for aliens."
1329+
STR_NOALIENPANICMESSAGES: "Supress panic messages for aliens"
13301330
STR_NOALIENPANICMESSAGES_DESC: "Don't show panic messages for aliens unless they are visible to the player."
13311331
STR_ALIENBLEEDING: "Alien bleeding"
13321332
STR_ALIENBLEEDING_DESC: "Allows fatal wounds to be inflicted on most aliens."
13331333
STR_FIELDPROMOTIONS: "Field promotions"
13341334
STR_FIELDPROMOTIONS_DESC: "Only soldiers that were present at the mission site are eligible for promotion."
13351335
STR_IRONMAN: "IRONMAN"
1336-
STR_IRONMAN_DESC: "No manual saving. All choices are permanent."
1336+
STR_IRONMAN_DESC: "No manual saving"
13371337
STR_SAVE_AND_ABANDON_GAME: "SAVE AND ABANDON GAME"
13381338
STR_MOD_UNSUCCESSFUL: "Mod failed to load"
13391339
STR_NEW_SAVED_GAME_SLOT: "<NEW SAVED GAME>"
13401340
STR_AUTO_SAVE_GEOSCAPE_SLOT: "<AUTOSAVE GEOSCAPE>"
13411341
STR_AUTO_SAVE_BATTLESCAPE_SLOT: "<AUTOSAVE BATTLESCAPE>"
13421342
STR_QUICK_SAVE_SLOT: "<QUICKSAVE>"
13431343
STR_DISPLAY_MODE_DESC: "Change how the game is displayed on your screen."
1344+
STR_PREFERRED_MUSIC_FORMAT: "Music Format"
1345+
STR_PREFERRED_MUSIC_FORMAT_DESC: "Chooses the preferred music format to use when multiple ones are available.{NEWLINE}NOTE: MIDI playback may be buggy on Windows."
1346+
STR_PREFERRED_SFX_FORMAT: "SFX Format"
1347+
STR_PREFERRED_SFX_FORMAT_DESC: "Chooses the preferred sound effects format to use when multiple ones are available."
1348+
STR_PREFERRED_FORMAT_AUTO: "Auto"
1349+
STR_CURRENT_FORMAT: "Current: {0}"

bin/data/Ruleset/Xcom1Ruleset.rul

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,7 @@ items:
19721972
bigSprite: 33
19731973
floorSprite: 32
19741974
handSprite: 88
1975-
meleeSound: 36
1975+
hitSound: 36
19761976
battleType: 9
19771977
twoHanded: true
19781978
invWidth: 1
@@ -1996,6 +1996,7 @@ items:
19961996
twoHanded: true
19971997
invWidth: 1
19981998
invHeight: 3
1999+
skillApplied: false
19992000
- type: STR_ELECTRO_FLARE
20002001
size: 0.1
20012002
costBuy: 60
@@ -2830,7 +2831,7 @@ items:
28302831
# Usage of this is hard-coded.
28312832
# DO NOT DELETE!
28322833
- type: ALIEN_PSI_WEAPON
2833-
meleeSound: 36
2834+
hitSound: 36
28342835
battleType: 9
28352836
tuUse: 25
28362837
flatRate: true

src/Basescape/BuildFacilitiesState.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ BuildFacilitiesState::BuildFacilitiesState(Game *game, Base *base, State *state)
4747
// Create objects
4848
_window = new Window(this, 128, 160, 192, 40, POPUP_VERTICAL);
4949
_btnOk = new TextButton(112, 16, 200, 176);
50-
_lstFacilities = new TextList(112, 104, 200, 64);
50+
_lstFacilities = new TextList(100, 104, 200, 64);
5151
_txtTitle = new Text(118, 17, 197, 48);
5252

5353
// Set palette
@@ -76,9 +76,8 @@ BuildFacilitiesState::BuildFacilitiesState(Game *game, Base *base, State *state)
7676

7777
_lstFacilities->setColor(Palette::blockOffset(13)+5);
7878
_lstFacilities->setArrowColor(Palette::blockOffset(13)+5);
79-
_lstFacilities->setColumns(1, 112);
79+
_lstFacilities->setColumns(1, 100);
8080
_lstFacilities->setSelectable(true);
81-
_lstFacilities->setScrolling(true, -12);
8281
_lstFacilities->setBackground(_window);
8382
_lstFacilities->setMargin(2);
8483
_lstFacilities->setWordWrap(true);

src/Basescape/CraftsState.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "../Menu/ErrorMessageState.h"
3434
#include "CraftInfoState.h"
3535
#include "SellState.h"
36+
#include "../Savegame/SavedGame.h"
3637

3738
namespace OpenXcom
3839
{
@@ -148,7 +149,7 @@ void CraftsState::btnOkClick(Action *)
148149
{
149150
_game->popState();
150151

151-
if (Options::storageLimitsEnforced && _base->storesOverfull())
152+
if (_game->getSavedGame()->getMonthsPassed() > -1 && Options::storageLimitsEnforced && _base->storesOverfull())
152153
{
153154
_game->pushState(new SellState(_game, _base));
154155
_game->pushState(new ErrorMessageState(_game, tr("STR_STORAGE_EXCEEDED").arg(_base->getName()).c_str(), _palette, Palette::blockOffset(15)+1, "BACK01.SCR", 0));

src/Basescape/ManageAlienContainmentState.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,21 @@ void ManageAlienContainmentState::btnOkClick(Action *)
217217
// remove the aliens
218218
_base->getItems()->removeItem(_aliens[i], _qtys[i]);
219219

220-
// add the corpses
221-
_base->getItems()->addItem(
222-
_game->getRuleset()->getArmor(
223-
_game->getRuleset()->getUnit(
224-
_aliens[i]
225-
)->getArmor()
226-
)->getCorpseGeoscape(), _qtys[i]
227-
); // ;)
220+
if (Options::canSellLiveAliens)
221+
{
222+
_game->getSavedGame()->setFunds(_game->getSavedGame()->getFunds() + _game->getRuleset()->getItem(_aliens[i])->getSellCost() * _qtys[i]);
223+
}
224+
else
225+
{
226+
// add the corpses
227+
_base->getItems()->addItem(
228+
_game->getRuleset()->getArmor(
229+
_game->getRuleset()->getUnit(
230+
_aliens[i]
231+
)->getArmor()
232+
)->getCorpseGeoscape(), _qtys[i]
233+
); // ;)
234+
}
228235
}
229236
}
230237
_game->popState();

src/Basescape/PurchaseState.cpp

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "PurchaseState.h"
2020
#include <sstream>
2121
#include <climits>
22+
#include <cfloat>
2223
#include <cmath>
2324
#include <iomanip>
2425
#include "../aresame.h"
@@ -53,7 +54,7 @@ namespace OpenXcom
5354
* @param game Pointer to the core game.
5455
* @param base Pointer to the base to get info from.
5556
*/
56-
PurchaseState::PurchaseState(Game *game, Base *base) : State(game), _base(base), _crafts(), _items(), _qtys(), _sel(0), _itemOffset(0), _total(0), _pQty(0), _cQty(0), _iQty(0)
57+
PurchaseState::PurchaseState(Game *game, Base *base) : State(game), _base(base), _crafts(), _items(), _qtys(), _sel(0), _itemOffset(0), _total(0), _pQty(0), _cQty(0), _iQty(0.0)
5758
{
5859
// Create objects
5960
_window = new Window(this, 320, 200, 0, 0);
@@ -485,7 +486,7 @@ void PurchaseState::increaseByValue(int change)
485486
_game->pushState(new ErrorMessageState(_game, "STR_NO_FREE_HANGARS_FOR_PURCHASE", _palette, Palette::blockOffset(15)+1, "BACK13.SCR", 0));
486487
}
487488
else if (_sel >= 3 + _crafts.size()
488-
&& _iQty + _game->getRuleset()->getItem(_items[_sel - 3 - _crafts.size()])->getSize() > (10 * _base->getAvailableStores() - (int)(10 *_base->getUsedStores() + 0.5)))
489+
&& _iQty + _game->getRuleset()->getItem(_items[_sel - 3 - _crafts.size()])->getSize() > _base->getAvailableStores() - _base->getUsedStores())
489490
{
490491
_timerInc->stop();
491492
_game->pushState(new ErrorMessageState(_game, "STR_NOT_ENOUGH_STORE_SPACE", _palette, Palette::blockOffset(15)+1, "BACK13.SCR", 0));
@@ -513,18 +514,14 @@ void PurchaseState::increaseByValue(int change)
513514
RuleItem *rule = _game->getRuleset()->getItem(_items[_sel - 3 - _crafts.size()]);
514515

515516
// Item count
516-
int storesNeededPerItem = (int)(10 * rule->getSize());
517-
int freeStores = 10 * _base->getAvailableStores() - (int)(10 * _base->getUsedStores() + 0.5) - _iQty;
518-
int maxByStores;
519-
if (storesNeededPerItem == 0)
517+
double storesNeededPerItem = rule->getSize();
518+
double freeStores = _base->getAvailableStores() - _base->getUsedStores() - _iQty;
519+
double maxByStores = DBL_MAX;
520+
if (!AreSame(storesNeededPerItem, 0.0))
520521
{
521-
maxByStores = INT_MAX;
522+
maxByStores = (freeStores + 0.05) / storesNeededPerItem;
522523
}
523-
else
524-
{
525-
maxByStores = freeStores / storesNeededPerItem;
526-
}
527-
change = std::min(maxByStores, change);
524+
change = std::min((int)maxByStores, change);
528525
_iQty += change * storesNeededPerItem;
529526
}
530527
_qtys[_sel] += change;
@@ -553,13 +550,20 @@ void PurchaseState::decreaseByValue(int change)
553550
change = std::min(_qtys[_sel], change);
554551

555552
// Personnel count
556-
if (_sel <= 2) _pQty -= change;
553+
if (_sel <= 2)
554+
{
555+
_pQty -= change;
556+
}
557557
// Craft count
558-
else if (_sel >= 3 && _sel < 3 + _crafts.size()) _cQty -= change;
558+
else if (_sel >= 3 && _sel < 3 + _crafts.size())
559+
{
560+
_cQty -= change;
561+
}
559562
// Item count
560563
else
561-
_iQty -= (int)(10 * _game->getRuleset()->getItem(_items[_sel - 3 - _crafts.size()])->getSize()) * change;
562-
564+
{
565+
_iQty -= _game->getRuleset()->getItem(_items[_sel - 3 - _crafts.size()])->getSize() * change;
566+
}
563567
_qtys[_sel] -= change;
564568
_total -= getPrice() * change;
565569
updateItemStrings();
@@ -591,12 +595,12 @@ void PurchaseState::updateItemStrings()
591595
}
592596
}
593597
ss5 << _base->getUsedStores();
594-
if (_iQty != 0)
598+
if (std::abs(_iQty) > 0.05)
595599
{
596600
ss5 << "(";
597-
if (_iQty > 0)
601+
if (_iQty > 0.05)
598602
ss5 << "+";
599-
ss5 << std::fixed << std::setprecision(1) << (float)_iQty/10 << ")";
603+
ss5 << std::fixed << std::setprecision(1) << _iQty << ")";
600604
}
601605
ss5 << ":" << _base->getAvailableStores();
602606
_txtSpaceUsed->setText(tr("STR_SPACE_USED").arg(ss5.str()));

src/Basescape/PurchaseState.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class PurchaseState : public State
4949
std::vector<std::string> _crafts, _items;
5050
std::vector<int> _qtys;
5151
size_t _sel, _itemOffset;
52-
int _total, _pQty, _cQty, _iQty;
52+
int _total, _pQty, _cQty;
53+
double _iQty;
5354
Timer *_timerInc, *_timerDec;
5455
/// Gets selected price.
5556
int getPrice();

0 commit comments

Comments
 (0)