Skip to content

Commit 6a4e890

Browse files
committed
Merge remote-tracking branch 'upstream/master' into loadout_copy_paste
Conflicts: src/Battlescape/InventoryState.cpp
2 parents 69ff86b + 8e9f987 commit 6a4e890

44 files changed

Lines changed: 528 additions & 304 deletions

Some content is hidden

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

CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ New features:
4545
- Added ironman mode.
4646
- Multithreading added to startup loading.
4747
- Shortcut added to enable/disable input grabbing.
48+
- Mousewheel scroll speed is now configurable.
4849

4950
Geoscape:
5051
- Automatically end dogfights if the UFO outpaces the fighter and the window is minimised.
@@ -65,6 +66,8 @@ New features:
6566
- Storage limit enforcement option added, complete with "overflowed item" management screen.
6667
- Drag scroll added.
6768
- Melee accuracy now shown on soldier stat screens.
69+
- Manufacture auto sale button added to manufacture screen.
70+
- Background now filled out in higher base resolutions.
6871

6972
Battlescape:
7073
- Inventory: Control-click an item to attempt to swap it between the ground and your soldier's inventory.

bin/data/Language/en-GB.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ en-GB:
11211121
STR_AGGRESSIVERETALIATION: "Aggressive retaliation"
11221122
STR_AGGRESSIVERETALIATION_DESC: "UFOs will attempt to detect your bases at all times, regardless of their mission parameters."
11231123
STR_STORAGELIMITSENFORCED: "Storage limits for recovered items"
1124-
STR_STORAGELIMITSENFORCED_DESC: "Enforces alien containment and general store limits for live aliens and artifacts recovered from missions, unlike UFO: Enemy Unknown."
1124+
STR_STORAGELIMITSENFORCED_DESC: "Enforces alien containment and general store limits for live aliens and artifacts recovered from missions."
11251125
STR_CANSELLLIVEALIENS: "Live alien sale"
11261126
STR_CANSELLLIVEALIENS_DESC: "Allows the sale of live aliens, recommended when using storage limits."
11271127
STR_ALLOWBUILDINGQUEUE: "Allow building queue"
@@ -1157,7 +1157,7 @@ en-GB:
11571157
STR_ALLOWPSIONICCAPTURE: "Allow psi-capture"
11581158
STR_ALLOWPSIONICCAPTURE_DESC: "Mind-controlling all remaining aliens results in victory, and they count as live captures."
11591159
STR_ANYTIMEPSITRAINING: "Psionic training at any time"
1160-
STR_ANYTIMEPSITRAINING_DESC: "You can at any time send soldiers into (or remove from) psionic training. Remember, initial training takes from 30 to 60 days."
1160+
STR_ANYTIMEPSITRAINING_DESC: "Allows assigning soldiers to psionic training at any time of the month. Remember, initial training takes from 30 to 60 days."
11611161
STR_SKIPNEXTTURNSCREEN: "Skip \"Next Turn\" screen"
11621162
STR_SKIPNEXTTURNSCREEN_DESC: "\"Next Turn\" screens during battle are advanced automatically after a short delay."
11631163
STR_NOT_ENOUGH_SPACE: "Not Enough Space!"
@@ -1310,7 +1310,7 @@ en-GB:
13101310
STR_BATTLEHAIRBLEACH: "Enhanced soldier sprites"
13111311
STR_BATTLEHAIRBLEACH_DESC: "Changes soldier Battlescape sprites to match their inventory look."
13121312
STR_DRAGSCROLLINVERT: "Invert drag-scrolling"
1313-
STR_DRAGSCROLLINVERT_DESC: "Inverts the direction of drag-scrolling. When enabled you drag towards the target, when disabled you drag away instead."
1313+
STR_DRAGSCROLLINVERT_DESC: "When enabled, dragging scrolls in the opposite direction to the mouse."
13141314
STR_BATTLESCAPE_SCALE: "Battlescape Resolution"
13151315
STR_BATTLESCAPE_SCALE_DESC: "Changes the resolution of the Battlescape viewport.{NEWLINE}EXPERIMENTAL! May cause interface and performance bugs! Check the documentation for more details."
13161316
STR_GEOSCAPE_SCALE: "Geoscape Resolution"
@@ -1351,3 +1351,6 @@ en-GB:
13511351
STR_BOTH_HANDS_MUST_BE_EMPTY: "Both hands must be empty!"
13521352
STR_MOUSEWHEEL_SPEED: "Mouse wheel scroll speed"
13531353
STR_MOUSEWHEEL_SPEED_DESC: "Adjusts the number of lines scrolled in lists with each increment of the mouse wheel."
1354+
STR_DISABLED: "Disabled"
1355+
STR_MAXIMIZE_INFO_SCREENS: "Maximize info screens"
1356+
STR_MAXIMIZE_INFO_SCREENS_DESC: "Inventory and various other screens will be displayed at full screen, regardless of scale settings."

bin/data/Language/en-US.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ en-US:
11211121
STR_AGGRESSIVERETALIATION: "Aggressive retaliation"
11221122
STR_AGGRESSIVERETALIATION_DESC: "UFOs will attempt to detect your bases at all times, regardless of their mission parameters."
11231123
STR_STORAGELIMITSENFORCED: "Storage limits for recovered items"
1124-
STR_STORAGELIMITSENFORCED_DESC: "Enforces alien containment and general store limits for live aliens and artifacts recovered from missions, unlike X-COM: UFO Defense."
1124+
STR_STORAGELIMITSENFORCED_DESC: "Enforces alien containment and general store limits for live aliens and artifacts recovered from missions."
11251125
STR_CANSELLLIVEALIENS: "Live alien sale"
11261126
STR_CANSELLLIVEALIENS_DESC: "Allows the sale of live aliens, recommended when using storage limits."
11271127
STR_ALLOWBUILDINGQUEUE: "Allow building queue"
@@ -1157,7 +1157,7 @@ en-US:
11571157
STR_ALLOWPSIONICCAPTURE: "Allow psi-capture"
11581158
STR_ALLOWPSIONICCAPTURE_DESC: "Mind-controlling all remaining aliens results in victory, and they count as live captures."
11591159
STR_ANYTIMEPSITRAINING: "Psionic training at any time"
1160-
STR_ANYTIMEPSITRAINING_DESC: "You can at any time send soldiers into (or remove from) psionic training. Remember, initial training takes from 30 to 60 days."
1160+
STR_ANYTIMEPSITRAINING_DESC: "Allows assigning soldiers to psionic training at any time of the month. Remember, initial training takes from 30 to 60 days."
11611161
STR_SKIPNEXTTURNSCREEN: "Skip \"Next Turn\" screen"
11621162
STR_SKIPNEXTTURNSCREEN_DESC: "\"Next Turn\" screens during battle are advanced automatically after a short delay."
11631163
STR_NOT_ENOUGH_SPACE: "Not Enough Space!"
@@ -1310,7 +1310,7 @@ en-US:
13101310
STR_BATTLEHAIRBLEACH: "Enhanced soldier sprites"
13111311
STR_BATTLEHAIRBLEACH_DESC: "Changes soldier Battlescape sprites to match their inventory look."
13121312
STR_DRAGSCROLLINVERT: "Invert drag-scrolling"
1313-
STR_DRAGSCROLLINVERT_DESC: "Inverts the direction of drag-scrolling. When enabled you drag towards the target, when disabled you drag away instead."
1313+
STR_DRAGSCROLLINVERT_DESC: "When enabled, dragging scrolls in the opposite direction to the mouse."
13141314
STR_BATTLESCAPE_SCALE: "Battlescape Resolution"
13151315
STR_BATTLESCAPE_SCALE_DESC: "Changes the resolution of the Battlescape viewport.{NEWLINE}EXPERIMENTAL! May cause interface and performance bugs! Check the documentation for more details."
13161316
STR_GEOSCAPE_SCALE: "Geoscape Resolution"
@@ -1351,3 +1351,6 @@ en-US:
13511351
STR_BOTH_HANDS_MUST_BE_EMPTY: "Both hands must be empty!"
13521352
STR_MOUSEWHEEL_SPEED: "Mouse wheel scroll speed"
13531353
STR_MOUSEWHEEL_SPEED_DESC: "Adjusts the number of lines scrolled in lists with each increment of the mouse wheel."
1354+
STR_DISABLED: "Disabled"
1355+
STR_MAXIMIZE_INFO_SCREENS: "Maximize info screens"
1356+
STR_MAXIMIZE_INFO_SCREENS_DESC: "Inventory and various other screens will be displayed at full screen, regardless of scale settings."

bin/data/Ruleset/Xcom1Ruleset.rul

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6924,10 +6924,7 @@ research:
69246924
points: 25
69256925
dependencies:
69266926
- STR_ETHEREAL_COMMANDER
6927-
- STR_ETHEREAL_ENGINEER
69286927
- STR_ETHEREAL_LEADER
6929-
- STR_ETHEREAL_MEDIC
6930-
- STR_ETHEREAL_NAVIGATOR
69316928
- STR_ETHEREAL_SOLDIER
69326929
- STR_SECTOID_LEADER
69336930
- STR_SECTOID_COMMANDER
@@ -7148,35 +7145,6 @@ research:
71487145
- STR_ALIEN_TERROR
71497146
- STR_ALIEN_RETALIATION
71507147
- STR_ALIEN_SUPPLY
7151-
- name: STR_SNAKEMAN_MEDIC
7152-
cost: 192
7153-
points: 50
7154-
lookup: STR_SNAKEMAN
7155-
needItem: true
7156-
unlocks:
7157-
- STR_ALIEN_ORIGINS
7158-
getOneFree:
7159-
- STR_SECTOID
7160-
- STR_MUTON
7161-
- STR_ETHEREAL
7162-
- STR_FLOATER
7163-
- STR_CHRYSSALID
7164-
- STR_SECTOPOD
7165-
- STR_CYBERDISC
7166-
- STR_SILACOID
7167-
- STR_CELATID
7168-
- STR_REAPER
7169-
- STR_SECTOID_CORPSE
7170-
- STR_SNAKEMAN_CORPSE
7171-
- STR_MUTON_CORPSE
7172-
- STR_ETHEREAL_CORPSE
7173-
- STR_FLOATER_CORPSE
7174-
- STR_CHRYSSALID_CORPSE
7175-
- STR_SECTOPOD_CORPSE
7176-
- STR_CYBERDISC_CORPSE
7177-
- STR_SILACOID_CORPSE
7178-
- STR_CELATID_CORPSE
7179-
- STR_REAPER_CORPSE
71807148
- name: STR_SNAKEMAN_LEADER
71817149
cost: 192
71827150
points: 50
@@ -9269,7 +9237,7 @@ MCDPatches:
92699237
- MCDIndex: 48
92709238
bigWall: 2
92719239
- MCDIndex: 54
9272-
TUFly: 2
9240+
TUSlide: 2
92739241
- MCDIndex: 56
92749242
terrainHeight: -7
92759243
- type: LIGHTNIN
@@ -9335,6 +9303,37 @@ MCDPatches:
93359303
bigWall: 2
93369304
- MCDIndex: 15
93379305
bigWall: 2
9306+
- type: U_BITS
9307+
data:
9308+
- MCDIndex: 6
9309+
TUWalk: 4
9310+
TUFly: 4
9311+
TUSlide: 4
9312+
- MCDIndex: 7
9313+
TUWalk: 4
9314+
TUFly: 4
9315+
TUSlide: 4
9316+
- type: U_BASE
9317+
data:
9318+
- MCDIndex: 9
9319+
TUFly: 2
9320+
- MCDIndex: 10
9321+
deathTile: 30
9322+
- MCDIndex: 17
9323+
armor: 60
9324+
HEBlock: 60
9325+
- MCDIndex: 22
9326+
flammability: 40
9327+
fuel: 4
9328+
- MCDIndex: 23
9329+
flammability: 40
9330+
fuel: 4
9331+
- MCDIndex: 24
9332+
flammability: 40
9333+
fuel: 4
9334+
- MCDIndex: 25
9335+
flammability: 40
9336+
fuel: 4
93389337
# Mountain terrain death tile fix
93399338
- type: MOUNT
93409339
data:
@@ -9408,6 +9407,12 @@ MCDPatches:
94089407
TUWalk: 4
94099408
TUFly: 4
94109409
TUSlide: 4
9410+
- type: URBITS
9411+
data:
9412+
- MCDIndex: 6
9413+
TUFly: 2
9414+
- MCDIndex: 7
9415+
TUFly: 2
94119416
extraSprites:
94129417
- type: Pathfinding
94139418
files:

src/Basescape/CraftInfoState.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void CraftInfoState::init()
249249
frame->blit(_weapon1);
250250

251251
_txtW1Name->setText(tr(w1->getRules()->getType()));
252-
std::wstringstream ss;
252+
std::wostringstream ss;
253253
ss << tr("STR_AMMO_").arg(w1->getAmmo()) << L"\n\x01";
254254
ss << tr("STR_MAX").arg(w1->getRules()->getAmmoMax());
255255
if (_craft->getStatus() == "STR_REARMING" && w1->getAmmo() < w1->getRules()->getAmmoMax())
@@ -286,7 +286,7 @@ void CraftInfoState::init()
286286
frame->blit(_weapon2);
287287

288288
_txtW2Name->setText(tr(w2->getRules()->getType()));
289-
std::wstringstream ss;
289+
std::wostringstream ss;
290290
ss << tr("STR_AMMO_").arg(w2->getAmmo()) << L"\n\x01";
291291
ss << tr("STR_MAX").arg(w2->getRules()->getAmmoMax());
292292
if (_craft->getStatus() == "STR_REARMING" && w2->getAmmo() < w2->getRules()->getAmmoMax())

src/Battlescape/BattlescapeMessage.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,15 @@ void BattlescapeMessage::blit(Surface *surface)
131131
_text->blit(surface);
132132
}
133133

134+
/*
135+
* Special handling for setting the height of the battlescape message.
136+
* @param height the new height.
137+
*/
138+
void BattlescapeMessage::setHeight(int height)
139+
{
140+
Surface::setHeight(height);
141+
_window->setHeight(height);
142+
_text->setHeight(height);
143+
}
144+
134145
}

src/Battlescape/BattlescapeMessage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class BattlescapeMessage : public Surface
5757
void setPalette(SDL_Color *colors, int firstcolor = 0, int ncolors = 256);
5858
/// Blits the warning message.
5959
void blit(Surface *surface);
60+
/// Special handling for setting the height of the battlescape message.
61+
void setHeight(int height);
6062
};
6163

6264
}

src/Battlescape/Camera.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -572,18 +572,28 @@ bool Camera::getShowAllLayers() const
572572
* @param mapPos Coordinates to check.
573573
* @return True if the map coordinates are on screen.
574574
*/
575-
bool Camera::isOnScreen(const Position &mapPos) const
575+
bool Camera::isOnScreen(const Position &mapPos, const bool unitWalking) const
576576
{
577577
Position screenPos;
578578
convertMapToScreen(mapPos, &screenPos);
579579
screenPos.x += _mapOffset.x;
580580
screenPos.y += _mapOffset.y;
581-
return screenPos.x >= -32
582-
&& screenPos.x <= _screenWidth + 24
583-
&& screenPos.y >= -32
584-
&& ((screenPos.y <= _screenHeight + 8 && (screenPos.x <= _screenWidth / 2 - Map::ICON_WIDTH / 2 || screenPos.x >= _screenWidth / 2 + Map::ICON_WIDTH / 2 - 32))
585-
||
586-
screenPos.y <= _screenHeight - 16);
581+
if (unitWalking)
582+
{
583+
return screenPos.x >= -32
584+
&& screenPos.x <= _screenWidth + 24
585+
&& screenPos.y >= -32
586+
&& ((screenPos.y <= _screenHeight + 8 && (screenPos.x <= _screenWidth / 2 - Map::ICON_WIDTH / 2 || screenPos.x >= _screenWidth / 2 + Map::ICON_WIDTH / 2 - 32))
587+
||
588+
screenPos.y <= _screenHeight - 16);
589+
}
590+
else
591+
{
592+
return screenPos.x >= 0
593+
&& screenPos.x <= _screenWidth - 10
594+
&& screenPos.y >= 0
595+
&& screenPos.y <= _screenHeight - 10;
596+
}
587597
}
588598

589599
/**

src/Battlescape/Camera.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class Camera
105105
/// Checks if the camera is showing all map layers.
106106
bool getShowAllLayers() const;
107107
/// Checks if map coordinates X,Y,Z are on screen.
108-
bool isOnScreen(const Position &mapPos) const;
108+
bool isOnScreen(const Position &mapPos, const bool unitWalking) const;
109109
/// Resize the viewable area.
110110
void resize();
111111
/// stop mouse scrolling.

src/Battlescape/InventoryState.cpp

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,20 @@ static const int _applyTemplateBtnY = 113;
6464
*/
6565
InventoryState::InventoryState(Game *game, bool tu, BattlescapeState *parent) : State(game), _tu(tu), _parent(parent)
6666
{
67-
Options::baseXResolution = Screen::ORIGINAL_WIDTH;
68-
Options::baseYResolution = Screen::ORIGINAL_HEIGHT;
69-
_game->getScreen()->resetDisplay(false);
70-
7167
_battleGame = _game->getSavedGame()->getSavedBattle();
7268

69+
if (Options::maximizeInfoScreens)
70+
{
71+
Options::baseXResolution = Screen::ORIGINAL_WIDTH;
72+
Options::baseYResolution = Screen::ORIGINAL_HEIGHT;
73+
_game->getScreen()->resetDisplay(false);
74+
}
75+
else if (!_battleGame->getTileEngine())
76+
{
77+
Screen::updateScale(Options::battlescapeScale, Options::battlescapeScale, Options::baseXBattlescape, Options::baseYBattlescape, true);
78+
_game->getScreen()->resetDisplay(false);
79+
}
80+
7381
// Create objects
7482
_bg = new Surface(320, 200, 0, 0);
7583
_soldier = new Surface(320, 200, 0, 0);
@@ -223,6 +231,24 @@ static void _clearInventoryTemplate(std::vector<EquipmentLayoutItem*> &inventory
223231
InventoryState::~InventoryState()
224232
{
225233
_clearInventoryTemplate(_curInventoryTemplate);
234+
235+
Tile *inventoryTile = _battleGame->getSelectedUnit()->getTile();
236+
if (_battleGame->getTileEngine())
237+
{
238+
if (Options::maximizeInfoScreens)
239+
{
240+
Screen::updateScale(Options::battlescapeScale, Options::battlescapeScale, Options::baseXBattlescape, Options::baseYBattlescape, true);
241+
_game->getScreen()->resetDisplay(false);
242+
}
243+
_battleGame->getTileEngine()->applyGravity(inventoryTile);
244+
_battleGame->getTileEngine()->calculateTerrainLighting(); // dropping/picking up flares
245+
_battleGame->getTileEngine()->recalculateFOV();
246+
}
247+
else
248+
{
249+
Screen::updateScale(Options::geoscapeScale, Options::geoscapeScale, Options::baseXGeoscape, Options::baseYGeoscape, true);
250+
_game->getScreen()->resetDisplay(false);
251+
}
226252
}
227253

228254
/**
@@ -419,19 +445,6 @@ void InventoryState::btnOkClick(Action *)
419445
}
420446
}
421447
}
422-
if (_battleGame->getTileEngine())
423-
{
424-
Screen::updateScale(Options::battlescapeScale, Options::battlescapeScale, Options::baseXBattlescape, Options::baseYBattlescape, true);
425-
_game->getScreen()->resetDisplay(false);
426-
_battleGame->getTileEngine()->applyGravity(inventoryTile);
427-
_battleGame->getTileEngine()->calculateTerrainLighting(); // dropping/picking up flares
428-
_battleGame->getTileEngine()->recalculateFOV();
429-
}
430-
else
431-
{
432-
Screen::updateScale(Options::geoscapeScale, Options::geoscapeScale, Options::baseXGeoscape, Options::baseYGeoscape, true);
433-
_game->getScreen()->resetDisplay(false);
434-
}
435448
}
436449

437450
/**

0 commit comments

Comments
 (0)