Skip to content

Commit 5f1e7b1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into mission_triggers
2 parents 47ed112 + 52dbe0d commit 5f1e7b1

20 files changed

Lines changed: 193 additions & 92 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ at:
2323

2424
Do not use modded versions (e.g. with XcomUtil) as they may cause bugs and
2525
crashes. Copy the UFO subfolders to the UFO subdirectory in OpenXcom's data
26-
folder and/or the TFTD subfolders to the TFTD subdirectory in OpenXcom's data
27-
folder (see below for data folder locations).
26+
or user folder and/or the TFTD subfolders to the TFTD subdirectory in OpenXcom's
27+
data or user folder (see below for folder locations).
2828

2929
## Mods
3030

@@ -87,6 +87,10 @@ passing a commandline argument when running OpenXcom. For example:
8787

8888
openxcom -data "$HOME/bin/OpenXcom/usr/share/openxcom"
8989

90+
or, if you have a fully self-contained installation:
91+
92+
openxcom -data "$HOME/games/openxcom/data" -user "$HOME/games/openxcom/user" -config "$HOME/games/openxcom/config"
93+
9094
### Windows
9195

9296
User and Config folder:

bin/TFTD/README.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Copy all the X-COM: Terror From the Deep subfolders to this directory!
22

3+
If you can't write to this directory, you can also create a TFTD folder in your
4+
user folder (where your OpenXcom savegames are) and copy your TFTD subfolders
5+
there.
6+
37
After the copy, this directory should contain at least the following items:
8+
ANIMS (optional -- not all TFTD versions have this directory)
49
FLOP_INT
510
GEODATA
611
GEOGRAPH

bin/UFO/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Copy all the UFO: Enemy Unknown / X-COM: UFO Defense subfolders to this directory!
22

3+
If you can't write to this directory, you can also create a UFO folder in your
4+
user folder (where your OpenXcom savegames are) and copy your UFO subfolders
5+
there.
6+
37
After the copy, this directory should contain at least the following items:
48
GEODATA
59
GEOGRAPH

bin/standard/xcom1/Language/en-GB.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,9 @@ en-GB:
11711171
STR_PSISTRENGTHEVAL: "Psi-Strength Evaluation"
11721172
STR_PSISTRENGTHEVAL_DESC: "Evaluates the psionic strength of all soldiers after the appropriate research has been completed."
11731173
STR_REMOVE_SELECTED: "Remove Selected"
1174-
STR_LIVE_ALIENS: "Live Aliens"
1175-
STR_DEAD_ALIENS: "Dead Aliens"
1174+
STR_LIVE_ALIENS: "Live{NEWLINE}Specimens"
1175+
STR_DEAD_ALIENS: "Rejected{NEWLINE}Specimens"
1176+
STR_UNDER_INTERROGATION: "Being{NEWLINE}Studied"
11761177
STR_CONTAINMENT_EXCEEDED: "ALIEN CONTAINMENT LIMITS EXCEEDED!{SMALLLINE}Insufficient containment space at {0}. You must remove excess aliens from containment (who will then die)."
11771178
STR_MANAGE_CONTAINMENT: "Manage Alien Containment"
11781179
STR_STORAGE_EXCEEDED: "STORAGE SPACE EXCEEDED!{SMALLLINE}Insufficient storage space at {0}. You must sell off excess items."

bin/standard/xcom1/Language/en-US.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,9 @@ en-US:
11711171
STR_PSISTRENGTHEVAL: "Psi-Strength Evaluation"
11721172
STR_PSISTRENGTHEVAL_DESC: "Evaluates the psionic strength of all soldiers after the appropriate research has been completed."
11731173
STR_REMOVE_SELECTED: "Remove Selected"
1174-
STR_LIVE_ALIENS: "Live Aliens"
1175-
STR_DEAD_ALIENS: "Dead Aliens"
1174+
STR_LIVE_ALIENS: "Live{NEWLINE}Specimens"
1175+
STR_DEAD_ALIENS: "Rejected{NEWLINE}Specimens"
1176+
STR_UNDER_INTERROGATION: "Being{NEWLINE}Studied"
11761177
STR_CONTAINMENT_EXCEEDED: "ALIEN CONTAINMENT LIMITS EXCEEDED!{SMALLLINE}Insufficient containment space at {0}. You must remove excess aliens from containment (who will then die)."
11771178
STR_MANAGE_CONTAINMENT: "Manage Alien Containment"
11781179
STR_STORAGE_EXCEEDED: "STORAGE SPACE EXCEEDED!{SMALLLINE}Insufficient storage space at {0}. You must sell off excess items."

bin/standard/xcom1/font.rul

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fontName: Font.dat
2+

bin/standard/xcom2/Language/en-GB.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,8 +1303,9 @@ en-US:
13031303
STR_PSISTRENGTHEVAL: "Psi-Strength Evaluation"
13041304
STR_PSISTRENGTHEVAL_DESC: "Evaluates the psionic strength of all soldiers after the appropriate research has been completed."
13051305
STR_REMOVE_SELECTED: "Remove Selected"
1306-
STR_LIVE_ALIENS: "Live Aliens"
1307-
STR_DEAD_ALIENS: "Dead Aliens"
1306+
STR_LIVE_ALIENS: "Live{NEWLINE}Specimens"
1307+
STR_DEAD_ALIENS: "Rejected{NEWLINE}Specimens"
1308+
STR_UNDER_INTERROGATION: "Being{NEWLINE}Studied"
13081309
STR_CONTAINMENT_EXCEEDED: "ALIEN CONTAINMENT LIMITS EXCEEDED!{SMALLLINE}Insufficient containment space at {0}. You must remove excess aliens from containment (who will then die)."
13091310
STR_MANAGE_CONTAINMENT: "Manage Alien Containment"
13101311
STR_STORAGE_EXCEEDED: "STORAGE SPACE EXCEEDED!{SMALLLINE}Insufficient storage space at {0}. You must sell off excess items."

bin/standard/xcom2/Language/en-US.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,8 +1303,9 @@ en-US:
13031303
STR_PSISTRENGTHEVAL: "Psi-Strength Evaluation"
13041304
STR_PSISTRENGTHEVAL_DESC: "Evaluates the psionic strength of all soldiers after the appropriate research has been completed."
13051305
STR_REMOVE_SELECTED: "Remove Selected"
1306-
STR_LIVE_ALIENS: "Live Aliens"
1307-
STR_DEAD_ALIENS: "Dead Aliens"
1306+
STR_LIVE_ALIENS: "Live{NEWLINE}Specimens"
1307+
STR_DEAD_ALIENS: "Rejected{NEWLINE}Specimens"
1308+
STR_UNDER_INTERROGATION: "Being{NEWLINE}Studied"
13081309
STR_CONTAINMENT_EXCEEDED: "ALIEN CONTAINMENT LIMITS EXCEEDED!{SMALLLINE}Insufficient containment space at {0}. You must remove excess aliens from containment (who will then die)."
13091310
STR_MANAGE_CONTAINMENT: "Manage Alien Containment"
13101311
STR_STORAGE_EXCEEDED: "STORAGE SPACE EXCEEDED!{SMALLLINE}Insufficient storage space at {0}. You must sell off excess items."

bin/standard/xcom2/font.rul

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fontName: Font.dat
2+

src/Basescape/ManageAlienContainmentState.cpp

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,31 @@ namespace OpenXcom
5050
* @param base Pointer to the base to get info from.
5151
* @param origin Game section that originated this state.
5252
*/
53-
ManageAlienContainmentState::ManageAlienContainmentState(Base *base, OptionsOrigin origin) : _base(base), _origin(origin), _sel(0), _aliensSold(0), _researchedAliens(0)
53+
ManageAlienContainmentState::ManageAlienContainmentState(Base *base, OptionsOrigin origin) : _base(base), _origin(origin), _sel(0), _aliensSold(0)
5454
{
55-
_overCrowded = Options::storageLimitsEnforced && _base->getAvailableContainment() < _base->getUsedContainment();
56-
55+
bool overCrowded = Options::storageLimitsEnforced && _base->getFreeContainment() < 0;
56+
std::vector<std::string> researchList;
5757
for (std::vector<ResearchProject*>::const_iterator iter = _base->getResearch().begin(); iter != _base->getResearch().end(); ++iter)
5858
{
5959
const RuleResearch *research = (*iter)->getRules();
6060
if (_game->getRuleset()->getUnit(research->getName()))
6161
{
62-
++_researchedAliens;
62+
researchList.push_back(research->getName());
6363
}
6464
}
6565

6666
// Create objects
6767
_window = new Window(this, 320, 200, 0, 0);
68-
_btnOk = new TextButton(_overCrowded? 288:148, 16, _overCrowded? 16:8, 176);
68+
_btnOk = new TextButton(overCrowded ? 288:148, 16, overCrowded ? 16:8, 176);
6969
_btnCancel = new TextButton(148, 16, 164, 176);
7070
_txtTitle = new Text(310, 17, 5, 8);
7171
_txtAvailable = new Text(190, 9, 10, 24);
7272
_txtUsed = new Text(110, 9, 136, 24);
7373
_txtItem = new Text(120, 9, 10, 41);
74-
_txtLiveAliens = new Text(54, 18, 136, 32);
75-
_txtDeadAliens = new Text(54, 18, 220, 32);
76-
_lstAliens = new TextList(280, 112, 8, 53);
74+
_txtLiveAliens = new Text(54, 18, 153, 32);
75+
_txtDeadAliens = new Text(54, 18, 207, 32);
76+
_txtInterrogatedAliens = new Text(54, 18, 261, 32);
77+
_lstAliens = new TextList(286, 112, 8, 53);
7778

7879
// Set palette
7980
setInterface("manageContainment");
@@ -87,6 +88,7 @@ ManageAlienContainmentState::ManageAlienContainmentState(Base *base, OptionsOrig
8788
add(_txtItem, "text", "manageContainment");
8889
add(_txtLiveAliens, "text", "manageContainment");
8990
add(_txtDeadAliens, "text", "manageContainment");
91+
add(_txtInterrogatedAliens, "text", "manageContainment");
9092
add(_lstAliens, "list", "manageContainment");
9193

9294
centerAllSurfaces();
@@ -102,7 +104,7 @@ ManageAlienContainmentState::ManageAlienContainmentState(Base *base, OptionsOrig
102104
_btnCancel->onMouseClick((ActionHandler)&ManageAlienContainmentState::btnCancelClick);
103105
_btnCancel->onKeyboardPress((ActionHandler)&ManageAlienContainmentState::btnCancelClick, Options::keyCancel);
104106

105-
if (_overCrowded)
107+
if (overCrowded)
106108
{
107109
_btnCancel->setVisible(false);
108110
_btnOk->setVisible(false);
@@ -122,12 +124,16 @@ ManageAlienContainmentState::ManageAlienContainmentState(Base *base, OptionsOrig
122124
_txtDeadAliens->setWordWrap(true);
123125
_txtDeadAliens->setVerticalAlign(ALIGN_BOTTOM);
124126

125-
_txtAvailable->setText(tr("STR_SPACE_AVAILABLE").arg(_base->getAvailableContainment() - _base->getUsedContainment() - _researchedAliens));
127+
_txtInterrogatedAliens->setText(tr("STR_UNDER_INTERROGATION"));
128+
_txtInterrogatedAliens->setWordWrap(true);
129+
_txtInterrogatedAliens->setVerticalAlign(ALIGN_BOTTOM);
130+
131+
_txtAvailable->setText(tr("STR_SPACE_AVAILABLE").arg(_base->getFreeContainment()));
126132

127-
_txtUsed->setText(tr("STR_SPACE_USED").arg( _base->getUsedContainment() + _researchedAliens));
133+
_txtUsed->setText(tr("STR_SPACE_USED").arg( _base->getUsedContainment()));
128134

129135
_lstAliens->setArrowColumn(184, ARROW_HORIZONTAL);
130-
_lstAliens->setColumns(3, 150, 84, 46);
136+
_lstAliens->setColumns(4, 160, 64, 46, 46);
131137
_lstAliens->setSelectable(true);
132138
_lstAliens->setBackground(_window);
133139
_lstAliens->setMargin(2);
@@ -149,10 +155,28 @@ ManageAlienContainmentState::ManageAlienContainmentState(Base *base, OptionsOrig
149155
_aliens.push_back(*i);
150156
std::wostringstream ss;
151157
ss << qty;
152-
_lstAliens->addRow(3, tr(*i).c_str(), ss.str().c_str(), L"0");
158+
std::wstring rqty;
159+
std::vector<std::string>::iterator research = std::find(researchList.begin(), researchList.end(), *i);
160+
if (research != researchList.end())
161+
{
162+
rqty = L"1";
163+
researchList.erase(research);
164+
}
165+
else
166+
{
167+
rqty = L"0";
168+
}
169+
_lstAliens->addRow(4, tr(*i).c_str(), ss.str().c_str(), L"0", rqty.c_str());
153170
}
154171
}
155172

173+
for (std::vector<std::string>::const_iterator i = researchList.begin(); i != researchList.end(); ++i)
174+
{
175+
_aliens.push_back(*i);
176+
_qtys.push_back(0);
177+
_lstAliens->addRow(4, tr(*i).c_str(), L"0", L"0", L"1");
178+
_lstAliens->setRowColor(_qtys.size() -1, _lstAliens->getSecondaryColor());
179+
}
156180
_timerInc = new Timer(250);
157181
_timerInc->onTimer((StateHandler)&ManageAlienContainmentState::increase);
158182
_timerDec = new Timer(250);
@@ -361,7 +385,7 @@ void ManageAlienContainmentState::increase()
361385
void ManageAlienContainmentState::increaseByValue(int change)
362386
{
363387
int qty = getQuantity() - _qtys[_sel];
364-
if (0 >= change || qty <= 0) return;
388+
if (change <= 0 || qty <= 0) return;
365389

366390
change = std::min(qty, change);
367391
_qtys[_sel] += change;
@@ -385,7 +409,7 @@ void ManageAlienContainmentState::decrease()
385409
*/
386410
void ManageAlienContainmentState::decreaseByValue(int change)
387411
{
388-
if (0 >= change || 0 >= _qtys[_sel]) return;
412+
if (change <= 0 || _qtys[_sel] <= 0) return;
389413
change = std::min(_qtys[_sel], change);
390414
_qtys[_sel] -= change;
391415
_aliensSold -= change;
@@ -406,12 +430,12 @@ void ManageAlienContainmentState::updateStrings()
406430
_lstAliens->setCellText(_sel, 1, ss.str());
407431
_lstAliens->setCellText(_sel, 2, ss2.str());
408432

409-
int aliens = _base->getUsedContainment() - (_aliensSold - _researchedAliens);
433+
int aliens = _base->getUsedContainment() - _aliensSold;
410434
int spaces = _base->getAvailableContainment() - aliens;
411-
bool enoughSpace = Options::storageLimitsEnforced ? spaces >= 0 : true;
412-
413-
_btnCancel->setVisible(!_overCrowded);
414-
_btnOk->setVisible(enoughSpace);
435+
if (Options::storageLimitsEnforced)
436+
{
437+
_btnOk->setVisible(spaces >= 0);
438+
}
415439
_txtAvailable->setText(tr("STR_SPACE_AVAILABLE").arg(spaces));
416440
_txtUsed->setText(tr("STR_SPACE_USED").arg(aliens));
417441
}

0 commit comments

Comments
 (0)