Skip to content

Commit 567ff46

Browse files
committed
Merge remote-tracking branch 'upstream/master' into loadout_copy_paste
2 parents dc3ae3a + f2728b9 commit 567ff46

17 files changed

Lines changed: 214 additions & 222 deletions

bin/data/Language/en-GB.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,8 @@ en-GB:
11471147
STR_SNEAKYAI_DESC: "AI avoids exposing themselves to the player whenever possible."
11481148
STR_STRAFE: "Strafe setting"
11491149
STR_STRAFE_DESC: "Enable strafing, running, and independent tank turret movement. Hold CTRL to use alternate movement methods."
1150-
STR_BATTLESCROLLDRAGINVERT: "Inverted drag-scrolling"
1151-
STR_BATTLESCROLLDRAGINVERT_DESC: "Inverts drag-scrolling on the Battlescape."
1150+
STR_DRAGSCROLLINVERT: "Invert drag-scrolling"
1151+
STR_DRAGSCROLLINVERT_DESC: "Inverts the direction of drag-scrolling. When enabled you drag towards the target, when disabled you drag away instead."
11521152
STR_BATTLEEXPLOSIONHEIGHT: "Explosion height"
11531153
STR_BATTLEEXPLOSIONHEIGHT_DESC: "Change how far height-wise explosions may spread.{NEWLINE}(Flat: 0, Round: 3)"
11541154
STR_AUTOSAVE: "Autosave mode"
@@ -1164,6 +1164,12 @@ en-GB:
11641164
STR_WEAPONSELFDESTRUCTION_DESC: "Weapons carried by aliens will self destruct if their owner is killed, like in XCOM 2012."
11651165
STR_SPENDRESEARCHEDITEMS: "Spend Researched items"
11661166
STR_SPENDRESEARCHEDITEMS_DESC: "Researched items are removed from your stores and will be disassembled, like in XCOM 2012. After \"researching\" living aliens, the body will be returned to the base stores."
1167+
STR_NEWSEEDONLOAD: "Save scumming"
1168+
STR_NEWSEEDONLOAD_DESC: "Loading a game will reset the random number seed, so taking the same action can yield different results."
1169+
STR_CHANGEVALUEBYMOUSEWHEEL: "Change values with mouse wheel"
1170+
STR_CHANGEVALUEBYMOUSEWHEEL_DESC: "Allows you to use the mouse wheel to increase/decrease values by this amount."
1171+
STR_BATTLEHAIRBLEACH: "Enhanced soldier sprites"
1172+
STR_BATTLEHAIRBLEACH_DESC: "Changes soldier Battlescape sprites to match their inventory look."
11671173
STR_SAVE_VOXEL_VIEW: "Save First-Person Screenshot"
11681174
STR_TIME_UNITS_RESERVED_FOR_KNEELING: "Time Units reserved for Kneeling"
11691175
STR_TIME_UNITS_RESERVED_FOR_KNEELING_AND_FIRING: "TUs reserved for Kneeling and Firing"

bin/data/Language/en-US.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,8 @@ en-US:
11471147
STR_SNEAKYAI_DESC: "AI avoids exposing themselves to the player whenever possible."
11481148
STR_STRAFE: "Strafe setting"
11491149
STR_STRAFE_DESC: "Enable strafing, running, and independent tank turret movement. Hold CTRL to use alternate movement methods."
1150-
STR_BATTLESCROLLDRAGINVERT: "Inverted drag-scrolling"
1151-
STR_BATTLESCROLLDRAGINVERT_DESC: "Inverts drag-scrolling on the Battlescape."
1150+
STR_DRAGSCROLLINVERT: "Invert drag-scrolling"
1151+
STR_DRAGSCROLLINVERT_DESC: "Inverts the direction of drag-scrolling. When enabled you drag towards the target, when disabled you drag away instead."
11521152
STR_BATTLEEXPLOSIONHEIGHT: "Explosion height"
11531153
STR_BATTLEEXPLOSIONHEIGHT_DESC: "Change how far height-wise explosions may spread.{NEWLINE}(Flat: 0, Round: 3)"
11541154
STR_AUTOSAVE: "Autosave mode"
@@ -1164,6 +1164,12 @@ en-US:
11641164
STR_WEAPONSELFDESTRUCTION_DESC: "Weapons carried by aliens will self destruct if their owner is killed, like in XCOM 2012."
11651165
STR_SPENDRESEARCHEDITEMS: "Spend Researched items"
11661166
STR_SPENDRESEARCHEDITEMS_DESC: "Researched items are removed from your stores and will be disassembled, like in XCOM 2012. After \"researching\" living aliens, the body will be returned to the base stores."
1167+
STR_NEWSEEDONLOAD: "Save scumming"
1168+
STR_NEWSEEDONLOAD_DESC: "Loading a game will reset the random number seed, so taking the same action can yield different results."
1169+
STR_CHANGEVALUEBYMOUSEWHEEL: "Change values with mouse wheel"
1170+
STR_CHANGEVALUEBYMOUSEWHEEL_DESC: "Allows you to use the mouse wheel to increase/decrease values by this amount."
1171+
STR_BATTLEHAIRBLEACH: "Enhanced soldier sprites"
1172+
STR_BATTLEHAIRBLEACH_DESC: "Changes soldier Battlescape sprites to match their inventory look."
11671173
STR_SAVE_VOXEL_VIEW: "Save First-Person Screenshot"
11681174
STR_TIME_UNITS_RESERVED_FOR_KNEELING: "Time Units reserved for Kneeling"
11691175
STR_TIME_UNITS_RESERVED_FOR_KNEELING_AND_FIRING: "TUs reserved for Kneeling and Firing"

src/Battlescape/BattlescapeState.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -588,17 +588,17 @@ void BattlescapeState::mapOver(Action *action)
588588
// the mouse-release event is missed for any reason.
589589
// (checking: is the dragScroll-mouse-button still pressed?)
590590
// However if the SDL is also missed the release event, then it is to no avail :(
591-
if (0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton))) { // so we missed again the mouse-release :(
591+
if (0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton))) { // so we missed again the mouse-release :(
592592
// Check if we have to revoke the scrolling, because it was too short in time, so it was a click
593-
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::battleScrollDragTimeTolerance)))
593+
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::dragScrollTimeTolerance)))
594594
_map->getCamera()->setMapOffset(_mapOffsetBeforeMouseScrolling);
595595
_isMouseScrolled = _isMouseScrolling = false;
596596
return;
597597
}
598598

599599
_isMouseScrolled = true;
600600

601-
if (Options::battleScrollDragInvert)
601+
if (Options::dragScrollInvert)
602602
{
603603
// Set the mouse cursor back
604604
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
@@ -609,10 +609,10 @@ void BattlescapeState::mapOver(Action *action)
609609
_totalMouseMoveX += action->getDetails()->motion.xrel;
610610
_totalMouseMoveY += action->getDetails()->motion.yrel;
611611
if (!_mouseMovedOverThreshold)
612-
_mouseMovedOverThreshold = ((std::abs(_totalMouseMoveX) > Options::battleScrollDragPixelTolerance) || (std::abs(_totalMouseMoveY) > Options::battleScrollDragPixelTolerance));
612+
_mouseMovedOverThreshold = ((std::abs(_totalMouseMoveX) > Options::dragScrollPixelTolerance) || (std::abs(_totalMouseMoveY) > Options::dragScrollPixelTolerance));
613613

614614
// Scrolling
615-
if (Options::battleScrollDragInvert)
615+
if (Options::dragScrollInvert)
616616
{
617617
_map->getCamera()->scrollXY(
618618
-action->getDetails()->motion.xrel,
@@ -643,7 +643,7 @@ void BattlescapeState::mapPress(Action *action)
643643
int mx = int(action->getAbsoluteXMouse());
644644
if ( my > _icons->getY() && my < _icons->getY()+_icons->getHeight() && mx > _icons->getX() && mx < _icons->getX()+_icons->getWidth()) return;
645645

646-
if (action->getDetails()->button.button == Options::battleScrollDragButton)
646+
if (action->getDetails()->button.button == Options::battleDragScrollButton)
647647
{
648648
_isMouseScrolling = true;
649649
_isMouseScrolled = false;
@@ -667,10 +667,10 @@ void BattlescapeState::mapClick(Action *action)
667667
// However if the SDL is also missed the release event, then it is to no avail :(
668668
// (this part handles the release if it is missed and now an other button is used)
669669
if (_isMouseScrolling) {
670-
if (action->getDetails()->button.button != Options::battleScrollDragButton
671-
&& 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton))) { // so we missed again the mouse-release :(
670+
if (action->getDetails()->button.button != Options::battleDragScrollButton
671+
&& 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton))) { // so we missed again the mouse-release :(
672672
// Check if we have to revoke the scrolling, because it was too short in time, so it was a click
673-
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::battleScrollDragTimeTolerance)))
673+
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::dragScrollTimeTolerance)))
674674
_map->getCamera()->setMapOffset(_mapOffsetBeforeMouseScrolling);
675675
_isMouseScrolled = _isMouseScrolling = false;
676676
}
@@ -680,9 +680,9 @@ void BattlescapeState::mapClick(Action *action)
680680
if (_isMouseScrolling)
681681
{
682682
// While scrolling, other buttons are ineffective
683-
if (action->getDetails()->button.button == Options::battleScrollDragButton) _isMouseScrolling = false; else return;
683+
if (action->getDetails()->button.button == Options::battleDragScrollButton) _isMouseScrolling = false; else return;
684684
// Check if we have to revoke the scrolling, because it was too short in time, so it was a click
685-
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::battleScrollDragTimeTolerance)))
685+
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::dragScrollTimeTolerance)))
686686
{
687687
_isMouseScrolled = false;
688688
_map->getCamera()->setMapOffset(_mapOffsetBeforeMouseScrolling);

src/Battlescape/Camera.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void Camera::mouseOver(Action *action, State *)
226226
_scrollMouseY = 0;
227227
}
228228

229-
if ((_scrollMouseX || _scrollMouseY) && !_scrollMouseTimer->isRunning() && !_scrollKeyTimer->isRunning() && 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton)))
229+
if ((_scrollMouseX || _scrollMouseY) && !_scrollMouseTimer->isRunning() && !_scrollKeyTimer->isRunning() && 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton)))
230230
{
231231
_scrollMouseTimer->start();
232232
}
@@ -268,7 +268,7 @@ void Camera::keyboardPress(Action *action, State *)
268268
_scrollKeyY = -scrollSpeed;
269269
}
270270

271-
if ((_scrollKeyX || _scrollKeyY) && !_scrollKeyTimer->isRunning() && !_scrollMouseTimer->isRunning() && 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton)))
271+
if ((_scrollKeyX || _scrollKeyY) && !_scrollKeyTimer->isRunning() && !_scrollMouseTimer->isRunning() && 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton)))
272272
{
273273
_scrollKeyTimer->start();
274274
}
@@ -308,7 +308,7 @@ void Camera::keyboardRelease(Action *action, State *)
308308
_scrollKeyY = 0;
309309
}
310310

311-
if ((_scrollKeyX || _scrollKeyY) && !_scrollKeyTimer->isRunning() && !_scrollMouseTimer->isRunning() && 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton)))
311+
if ((_scrollKeyX || _scrollKeyY) && !_scrollKeyTimer->isRunning() && !_scrollMouseTimer->isRunning() && 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton)))
312312
{
313313
_scrollKeyTimer->start();
314314
}

src/Battlescape/MiniMapView.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void MiniMapView::mousePress(Action *action, State *state)
182182
{
183183
InteractiveSurface::mousePress(action, state);
184184

185-
if (action->getDetails()->button.button == Options::battleScrollDragButton)
185+
if (action->getDetails()->button.button == Options::battleDragScrollButton)
186186
{
187187
_isMouseScrolling = true;
188188
_isMouseScrolled = false;
@@ -209,10 +209,10 @@ void MiniMapView::mouseClick (Action *action, State *state)
209209
// However if the SDL is also missed the release event, then it is to no avail :(
210210
// (this part handles the release if it is missed and now an other button is used)
211211
if (_isMouseScrolling) {
212-
if (action->getDetails()->button.button != Options::battleScrollDragButton
213-
&& 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton))) { // so we missed again the mouse-release :(
212+
if (action->getDetails()->button.button != Options::battleDragScrollButton
213+
&& 0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton))) { // so we missed again the mouse-release :(
214214
// Check if we have to revoke the scrolling, because it was too short in time, so it was a click
215-
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::battleScrollDragTimeTolerance)))
215+
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::dragScrollTimeTolerance)))
216216
{ _camera->centerOnPosition(_posBeforeMouseScrolling); _redraw = true; }
217217
_isMouseScrolled = _isMouseScrolling = false;
218218
}
@@ -222,9 +222,9 @@ void MiniMapView::mouseClick (Action *action, State *state)
222222
if (_isMouseScrolling)
223223
{
224224
// While scrolling, other buttons are ineffective
225-
if (action->getDetails()->button.button == Options::battleScrollDragButton) _isMouseScrolling = false; else return;
225+
if (action->getDetails()->button.button == Options::battleDragScrollButton) _isMouseScrolling = false; else return;
226226
// Check if we have to revoke the scrolling, because it was too short in time, so it was a click
227-
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::battleScrollDragTimeTolerance)))
227+
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::dragScrollTimeTolerance)))
228228
{
229229
_isMouseScrolled = false;
230230
_camera->centerOnPosition(_posBeforeMouseScrolling);
@@ -269,17 +269,17 @@ void MiniMapView::mouseOver(Action *action, State *state)
269269
// the mouse-release event is missed for any reason.
270270
// However if the SDL is also missed the release event, then it is to no avail :(
271271
// (checking: is the dragScroll-mouse-button still pressed?)
272-
if (0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleScrollDragButton))) { // so we missed again the mouse-release :(
272+
if (0==(SDL_GetMouseState(0,0)&SDL_BUTTON(Options::battleDragScrollButton))) { // so we missed again the mouse-release :(
273273
// Check if we have to revoke the scrolling, because it was too short in time, so it was a click
274-
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::battleScrollDragTimeTolerance)))
274+
if ((!_mouseMovedOverThreshold) && (SDL_GetTicks() - _mouseScrollingStartTime <= (Options::dragScrollTimeTolerance)))
275275
{ _camera->centerOnPosition(_posBeforeMouseScrolling); _redraw = true; }
276276
_isMouseScrolled = _isMouseScrolling = false;
277277
return;
278278
}
279279

280280
_isMouseScrolled = true;
281281

282-
if (Options::battleScrollDragInvert)
282+
if (Options::dragScrollInvert)
283283
{
284284
// Set the mouse cursor back
285285
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
@@ -291,12 +291,12 @@ void MiniMapView::mouseOver(Action *action, State *state)
291291
_totalMouseMoveX += action->getDetails()->motion.xrel;
292292
_totalMouseMoveY += action->getDetails()->motion.yrel;
293293
if (!_mouseMovedOverThreshold)
294-
_mouseMovedOverThreshold = ((std::abs(_totalMouseMoveX) > Options::battleScrollDragPixelTolerance) || (std::abs(_totalMouseMoveY) > Options::battleScrollDragPixelTolerance));
294+
_mouseMovedOverThreshold = ((std::abs(_totalMouseMoveX) > Options::dragScrollPixelTolerance) || (std::abs(_totalMouseMoveY) > Options::dragScrollPixelTolerance));
295295

296296
// Calculate the move
297297
int newX;
298298
int newY;
299-
if (Options::battleScrollDragInvert)
299+
if (Options::dragScrollInvert)
300300
{
301301
_mouseScrollX += action->getDetails()->motion.xrel;
302302
_mouseScrollY += action->getDetails()->motion.yrel;
@@ -331,7 +331,7 @@ void MiniMapView::mouseOver(Action *action, State *state)
331331
_camera->centerOnPosition(Position(newX,newY,_camera->getViewLevel()));
332332
_redraw = true;
333333

334-
if (Options::battleScrollDragInvert)
334+
if (Options::dragScrollInvert)
335335
{
336336
// We don't want to look the mouse-cursor jumping :)
337337
action->getDetails()->motion.x=_xBeforeMouseScrolling; action->getDetails()->motion.y=_yBeforeMouseScrolling;

src/Engine/CrossPlatform.cpp

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919
#include "CrossPlatform.h"
20+
#include <set>
2021
#include <algorithm>
2122
#include <iostream>
2223
#include <sstream>
@@ -389,20 +390,16 @@ std::string getDataFile(const std::string &filename)
389390
#endif
390391

391392
// Check current data path
392-
std::string current = caseInsensitive(Options::getDataFolder(), name);
393-
if (current != "")
393+
std::string path = caseInsensitive(Options::getDataFolder(), name);
394+
if (path != "")
394395
{
395-
return current;
396+
return path;
396397
}
397398

398399
// Check every other path
399400
for (std::vector<std::string>::const_iterator i = Options::getDataList().begin(); i != Options::getDataList().end(); ++i)
400401
{
401402
std::string path = caseInsensitive(*i, name);
402-
if (path == current)
403-
{
404-
continue;
405-
}
406403
if (path != "")
407404
{
408405
Options::setDataFolder(*i);
@@ -429,20 +426,16 @@ std::string getDataFolder(const std::string &foldername)
429426
#endif
430427

431428
// Check current data path
432-
std::string current = caseInsensitiveFolder(Options::getDataFolder(), name);
433-
if (current != "")
429+
std::string path = caseInsensitiveFolder(Options::getDataFolder(), name);
430+
if (path != "")
434431
{
435-
return current;
432+
return path;
436433
}
437434

438435
// Check every other path
439436
for (std::vector<std::string>::const_iterator i = Options::getDataList().begin(); i != Options::getDataList().end(); ++i)
440437
{
441438
std::string path = caseInsensitiveFolder(*i, name);
442-
if (path == current)
443-
{
444-
continue;
445-
}
446439
if (path != "")
447440
{
448441
Options::setDataFolder(*i);
@@ -560,7 +553,7 @@ std::vector<std::string> getFolderContents(const std::string &path, const std::s
560553
*/
561554
std::vector<std::string> getDataContents(const std::string &folder, const std::string &ext)
562555
{
563-
std::map<std::string, bool> unique;
556+
std::set<std::string> unique;
564557
std::vector<std::string> files;
565558

566559
// Check current data path
@@ -570,7 +563,7 @@ std::vector<std::string> getDataContents(const std::string &folder, const std::s
570563
std::vector<std::string> contents = getFolderContents(current, ext);
571564
for (std::vector<std::string>::const_iterator file = contents.begin(); file != contents.end(); ++file)
572565
{
573-
unique[*file] = true;
566+
unique.insert(*file);
574567
}
575568
}
576569

@@ -587,16 +580,12 @@ std::vector<std::string> getDataContents(const std::string &folder, const std::s
587580
std::vector<std::string> contents = getFolderContents(path, ext);
588581
for (std::vector<std::string>::const_iterator file = contents.begin(); file != contents.end(); ++file)
589582
{
590-
unique[*file] = true;
583+
unique.insert(*file);
591584
}
592585
}
593586
}
594587

595-
for (std::map<std::string, bool>::const_iterator i = unique.begin(); i != unique.end(); ++i)
596-
{
597-
files.push_back(i->first);
598-
}
599-
588+
files = std::vector<std::string>(unique.begin(), unique.end());
600589
return files;
601590
}
602591

0 commit comments

Comments
 (0)