diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c6951bb7..880470360 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required ( VERSION 3.1 )
+cmake_minimum_required ( VERSION 3.25 )
project ( OpenXcom )
@@ -47,7 +47,10 @@ if ( APPLE )
endif ()
# C++ version check
-if ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
+# Both flag checks fail on clang-cl, no idea why.
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
+elseif ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
CHECK_CXX_COMPILER_FLAG("-std=c++1z" COMPILER_SUPPORTS_CXX1Z)
diff --git a/bin/common/Language/OXCE/en-GB.yml b/bin/common/Language/OXCE/en-GB.yml
index 05e2e7414..8e517ea52 100644
--- a/bin/common/Language/OXCE/en-GB.yml
+++ b/bin/common/Language/OXCE/en-GB.yml
@@ -286,6 +286,9 @@ en-GB:
STR_LOAD_PERSONAL_EQUIPMENT: "Load Personal Equipment"
STR_PERSONAL_EQUIPMENT_SAVED: "Personal equipment saved."
STR_SLOT: "Slot>{ALT}{0}"
+ #=== Kaizoku ====================
+ STR_SOLDIER_NOT_ALLOWED_IN_MISSION: "Soldier not allowed in mission>{ALT} {0}{ALT}"
+ STR_ITEMS_NOT_ALLOWED_IN_MISSION: "Items not allowed in {0}>{ALT} {1}{ALT}"
#Map.cpp
STR_THINKING: "Thinking..."
#NextTurnState.cpp
@@ -382,6 +385,19 @@ en-GB:
STR_AUTOMATICPROMOTIONS_DESC: "If enabled, soldiers are automatically promoted after a mission."
STR_OFF_CENTRE_SHOOTING: "Off-centre shooting"
STR_OFF_CENTRE_SHOOTING_DESC: "Soldiers will automatically try to adjust the firing angle slightly in case there is no line of fire."
+#=== Kaizoku ====================
+ STR_NEW_BASE_HOVER_AREA_INFO: "Display area when placing new base"
+ STR_NEW_BASE_HOVER_AREA_INFO_DESC: "Show the country and region under the cursor when placing a new base. 0: Off 1: Top 2: Bottom"
+ STR_LISTS_SCREEN_HEIGHT_PERCENTAGE: "Lists screen height percentage"
+ STR_LISTS_SCREEN_HEIGHT_PERCENTAGE_DESC: "Changes the height of most list screens to a percentage of the game's vertical resolution. Set to 0 to disable."
+ STR_SYSTEM_CURSOR: "Show system cursor"
+ STR_SYSTEM_CURSOR_DESC: "Jank double cursor mode (hiding game cursor breaks battlescape)"
+ STR_STRICT_INVENTORY_WEAPON_CATEGORY_SEARCH: "Strict weapon category matching"
+ STR_STRICT_INVENTORY_WEAPON_CATEGORY_SEARCH_DESC: "Ignores ammo categories for weapons in inventory search (useful for X-Piratez infiltration and similar missions)"
+ STR_INVENTORY_SEARCH_IGNORE_RESEARCHED: "Inventory search ignore researched"
+ STR_INVENTORY_SEARCH_IGNORE_RESEARCHED_DESC: "Ignore researched status when matching categories"
+ STR_INVENTORY_FORBIDDEN_ITEMS: "Show forbidden items in inventory"
+ STR_INVENTORY_FORBIDDEN_ITEMS_DESC: "Shows items, armors and soldiers not allowed in certain geoscape missions on the inventory screen. Might not display correctly on low resolutions."
#===================
STR_GRAPHS_ZOOM_IN: "Zoom In (Graphs)"
STR_GRAPHS_ZOOM_OUT: "Zoom Out (Graphs)"
@@ -511,7 +527,7 @@ en-GB:
#OptionsAdvancedState.cpp
STR_ENGINE_OXC: "OXC"
STR_ENGINE_OXCE: "OXCE"
- STR_ENGINE_OTHER: "OTHER"
+ STR_ENGINE_OTHER: "Kaizoku"
STR_BASESCAPE: "Basescape"
STR_AI: "AI"
#OptionsBattlescapeState.cpp
diff --git a/bin/common/Language/OXCE/en-US.yml b/bin/common/Language/OXCE/en-US.yml
index 60db1a0aa..f51558d30 100644
--- a/bin/common/Language/OXCE/en-US.yml
+++ b/bin/common/Language/OXCE/en-US.yml
@@ -286,6 +286,9 @@ en-US:
STR_LOAD_PERSONAL_EQUIPMENT: "Load Personal Equipment"
STR_PERSONAL_EQUIPMENT_SAVED: "Personal equipment saved."
STR_SLOT: "Slot>{ALT}{0}"
+ #=== Kaizoku ====================
+ STR_SOLDIER_NOT_ALLOWED_IN_MISSION: "Soldier not allowed in mission>{ALT} {0}{ALT}"
+ STR_ITEMS_NOT_ALLOWED_IN_MISSION: "Items not allowed in {0}>{ALT} {1}{ALT}"
#Map.cpp
STR_THINKING: "Thinking..."
#NextTurnState.cpp
@@ -382,6 +385,19 @@ en-US:
STR_AUTOMATICPROMOTIONS_DESC: "If enabled, soldiers are automatically promoted after a mission."
STR_OFF_CENTRE_SHOOTING: "Off-center shooting"
STR_OFF_CENTRE_SHOOTING_DESC: "Soldiers will automatically try to adjust the firing angle slightly in case there is no line of fire."
+#=== Kaizoku ====================
+ STR_NEW_BASE_HOVER_AREA_INFO: "Display area when placing new base"
+ STR_NEW_BASE_HOVER_AREA_INFO_DESC: "Show the country and region under the cursor when placing a new base. 0: Off 1: Top 2: Bottom"
+ STR_LISTS_SCREEN_HEIGHT_PERCENTAGE: "Lists screen height percentage"
+ STR_LISTS_SCREEN_HEIGHT_PERCENTAGE_DESC: "Changes the height of most list screens to a percentage of the game's vertical resolution. Set to 0 to disable."
+ STR_SYSTEM_CURSOR: "Show system cursor"
+ STR_SYSTEM_CURSOR_DESC: "Jank double cursor mode (hiding game cursor breaks battlescape)"
+ STR_STRICT_INVENTORY_WEAPON_CATEGORY_SEARCH: "Strict weapon category matching"
+ STR_STRICT_INVENTORY_WEAPON_CATEGORY_SEARCH_DESC: "Ignores ammo categories for weapons in inventory search (useful for X-Piratez infiltration and similar missions)"
+ STR_INVENTORY_SEARCH_IGNORE_RESEARCHED: "Inventory search ignore researched"
+ STR_INVENTORY_SEARCH_IGNORE_RESEARCHED_DESC: "Ignore researched status when matching categories"
+ STR_INVENTORY_FORBIDDEN_ITEMS: "Show forbidden items in inventory"
+ STR_INVENTORY_FORBIDDEN_ITEMS_DESC: "Shows items, armors and soldiers not allowed in certain geoscape missions on the inventory screen. Might not display correctly on low resolutions."
#===================
STR_GRAPHS_ZOOM_IN: "Zoom In (Graphs)"
STR_GRAPHS_ZOOM_OUT: "Zoom Out (Graphs)"
@@ -511,7 +527,7 @@ en-US:
#OptionsAdvancedState.cpp
STR_ENGINE_OXC: "OXC"
STR_ENGINE_OXCE: "OXCE"
- STR_ENGINE_OTHER: "OTHER"
+ STR_ENGINE_OTHER: "Kaizoku"
STR_BASESCAPE: "Basescape"
STR_AI: "AI"
#OptionsBattlescapeState.cpp
diff --git a/src/Basescape/CraftArmorState.h b/src/Basescape/CraftArmorState.h
index dcb2d6c2e..6637f06a2 100644
--- a/src/Basescape/CraftArmorState.h
+++ b/src/Basescape/CraftArmorState.h
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see .
*/
-#include "../Engine/State.h"
+#include "../Engine/ListState.h"
#include
#include "SoldierSortUtil.h"
@@ -37,7 +37,7 @@ struct SortFunctor;
* Select Armor screen that lets the player
* pick armor for the soldiers on the craft.
*/
-class CraftArmorState : public State
+class CraftArmorState : public ListState
{
private:
TextButton *_btnOk;
diff --git a/src/Basescape/CraftEquipmentLoadState.h b/src/Basescape/CraftEquipmentLoadState.h
index 921159ed9..e6b7fcf2e 100644
--- a/src/Basescape/CraftEquipmentLoadState.h
+++ b/src/Basescape/CraftEquipmentLoadState.h
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see .
*/
-#include "../Engine/State.h"
+#include "../Engine/ListState.h"
namespace OpenXcom
{
@@ -32,7 +32,7 @@ class CraftEquipmentState;
/**
* Craft Loadout Load window that allows changing of the equipment onboard.
*/
-class CraftEquipmentLoadState : public State
+class CraftEquipmentLoadState : public ListState
{
private:
CraftEquipmentState *_parent;
diff --git a/src/Basescape/CraftEquipmentSaveState.h b/src/Basescape/CraftEquipmentSaveState.h
index 13784d215..970621132 100644
--- a/src/Basescape/CraftEquipmentSaveState.h
+++ b/src/Basescape/CraftEquipmentSaveState.h
@@ -18,7 +18,7 @@
* along with OpenXcom. If not, see .
*/
#include
-#include "../Engine/State.h"
+#include "../Engine/ListState.h"
namespace OpenXcom
{
@@ -33,7 +33,7 @@ class CraftEquipmentState;
/**
* Craft Loadout Save window that allows saving of the equipment onboard to a global template.
*/
-class CraftEquipmentSaveState : public State
+class CraftEquipmentSaveState : public ListState
{
private:
CraftEquipmentState *_parent;
diff --git a/src/Basescape/CraftEquipmentState.cpp b/src/Basescape/CraftEquipmentState.cpp
index b3635f8d4..03f1e33e0 100644
--- a/src/Basescape/CraftEquipmentState.cpp
+++ b/src/Basescape/CraftEquipmentState.cpp
@@ -43,6 +43,7 @@
#include "../Savegame/Craft.h"
#include "../Mod/RuleCraft.h"
#include "../Savegame/ItemContainer.h"
+#include "../Savegame/Soldier.h"
#include "../Mod/RuleItemCategory.h"
#include "../Mod/RuleItem.h"
#include "../Savegame/Vehicle.h"
@@ -78,7 +79,9 @@ CraftEquipmentState::CraftEquipmentState(Base *base, size_t craft) :
_btnQuickSearch = new TextEdit(this, 48, 9, 264, 12);
_btnOk = new TextButton((craftHasACrew || _isNewBattle)?30:140, 16, (craftHasACrew || _isNewBattle)?274:164, 176);
_btnClear = new TextButton(102, 16, 164, 176);
- _btnInventory = new TextButton(102, 16, 164, 176);
+ _btnInventory = new TextButton(70, 16, 196, 176);
+ _btnInventoryPlus = new TextButton(16, 16, 164, 176);
+ _btnInventoryMinus = new TextButton(16, 16, 180, 176);
_txtTitle = new Text(300, 17, 16, 7);
_txtItem = new Text(144, 9, 16, 32);
_txtStores = new Text(150, 9, 160, 32);
@@ -98,6 +101,8 @@ CraftEquipmentState::CraftEquipmentState(Base *base, size_t craft) :
add(_btnOk, "button", "craftEquipment");
add(_btnClear, "button", "craftEquipment");
add(_btnInventory, "button", "craftEquipment");
+ add(_btnInventoryPlus, "button", "craftEquipment");
+ add(_btnInventoryMinus, "button", "craftEquipment");
add(_txtTitle, "text", "craftEquipment");
add(_txtItem, "text", "craftEquipment");
add(_txtStores, "text", "craftEquipment");
@@ -128,6 +133,14 @@ CraftEquipmentState::CraftEquipmentState(Base *base, size_t craft) :
_btnInventory->setVisible(craftHasACrew && !_isNewBattle);
_btnInventory->onKeyboardPress((ActionHandler)&CraftEquipmentState::btnInventoryClick, Options::keyBattleInventory);
+ _btnInventoryPlus->setText("+");
+ _btnInventoryPlus->onMouseClick((ActionHandler)&CraftEquipmentState::btnInventoryClick);
+ _btnInventoryPlus->setVisible(craftHasACrew && !_isNewBattle);
+
+ _btnInventoryMinus->setText("-");
+ _btnInventoryMinus->onMouseClick((ActionHandler)&CraftEquipmentState::btnInventoryClick);
+ _btnInventoryMinus->setVisible(craftHasACrew && !_isNewBattle);
+
_txtTitle->setBig();
_txtTitle->setText(tr("STR_EQUIPMENT_FOR_CRAFT").arg(c->getName(_game->getLanguage())));
@@ -268,6 +281,7 @@ void CraftEquipmentState::init()
}
initList();
}
+
_reload = true;
_returningFromGlobalTemplates = false;
_returningFromInventory = false;
@@ -942,13 +956,50 @@ void CraftEquipmentState::btnClearClick(Action *)
* inside the craft.
* @param action Pointer to an action.
*/
-void CraftEquipmentState::btnInventoryClick(Action *)
+void CraftEquipmentState::btnInventoryClick(Action *action)
{
Craft *craft = _base->getCrafts()->at(_craft);
if (craft->getNumTotalSoldiers() > 0)
{
- if (Options::oxceAlternateCraftEquipmentManagement && !_isNewBattle)
+ bool apocInventory = (action->getSender() == _btnInventoryMinus) || (Options::oxceAlternateCraftEquipmentManagement && !action->isMouseAction()) || _game->isAltPressed();
+ bool fullInventory = (action->getSender() == _btnInventoryPlus) || _game->isCtrlPressed();
+ if ((apocInventory || fullInventory) && !_isNewBattle)
{
+ // Find all equipped items in the base so that we can filter these "reserved" items out when using Apocalypse style inventory management. Adapted from Craft::calculateTotalSoldierEquipment()
+ ItemContainer tempBaseSoldierEquipmentItems;
+ if (apocInventory && !fullInventory)
+ {
+ for (auto *soldier : *_base->getSoldiers())
+ {
+ Craft *soldier_craft = soldier->getCraft();
+ if (soldier_craft != 0)
+ {
+ if (soldier_craft->getStatus() == "STR_OUT")
+ continue;
+ }
+ if (soldier_craft != craft)
+ {
+ for (auto *invItem : *soldier->getEquipmentLayout())
+ {
+ // ignore fixed weapons...
+ if (!invItem->isFixed())
+ {
+ tempBaseSoldierEquipmentItems.addItem(invItem->getItemType());
+ }
+ // ...but not their ammo
+ for (int slot = 0; slot < RuleItem::AmmoSlotMax; ++slot)
+ {
+ const RuleItem* invItemAmmo = invItem->getAmmoItemForSlot(slot);
+ if (invItemAmmo != nullptr)
+ {
+ tempBaseSoldierEquipmentItems.addItem(invItemAmmo);
+ }
+ }
+ }
+ }
+ }
+ }
+
// This is a bit tricky... here's what we're doing:
// * Remember the extra craft items (i.e. items that are on the craft, but not equipped by soldiers)
// * Move all equipment from the base into the craft.
@@ -970,7 +1021,14 @@ void CraftEquipmentState::btnInventoryClick(Action *)
}
if (!rule->getVehicleUnit() && rule->canBeEquippedBeforeBaseDefense())
{
- moveRightByValue(INT_MAX, true);
+ if (apocInventory && !fullInventory)
+ {
+ moveRightByValue(_base->getStorageItems()->getItem(rule) - tempBaseSoldierEquipmentItems.getItem(rule), true);
+ }
+ else
+ {
+ moveRightByValue(INT_MAX, true);
+ }
}
}
}
diff --git a/src/Basescape/CraftEquipmentState.h b/src/Basescape/CraftEquipmentState.h
index a6066676c..c4d47997e 100644
--- a/src/Basescape/CraftEquipmentState.h
+++ b/src/Basescape/CraftEquipmentState.h
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see .
*/
-#include "../Engine/State.h"
+#include "../Engine/ListState.h"
#include
#include