key mapping to eject units

This commit is contained in:
devZoGok
2023-12-09 12:21:18 +02:00
parent 68a083172a
commit 1bbf4dc40e
5 changed files with 10 additions and 5 deletions
+1
View File
@@ -35,6 +35,7 @@ mappings = {
{bind = 31, trigger = 57, action = true, bindType = 0, inOptions = true},
{bind = 32, trigger = 66, action = true, bindType = 0, inOptions = true},
{bind = 33, trigger = 256, action = true, bindType = 0, inOptions = true},
{bind = 47, trigger = 69, action = true, bindType = 0, inOptions = false},
{bind = 7, trigger = 312, action = false, bindType = 2, inOptions = false},
{bind = 8, trigger = 313, action = false, bindType = 2, inOptions = false},
+3 -2
View File
@@ -273,8 +273,6 @@ namespace battleship{
//TODO fix ejectable unit selection with multiple transports selected
void ActiveGameState::issueOrder(Order::TYPE type, vector<Order::Target> targets, bool addOrder) {
if(targets.empty()) return;
Vector3 destDir = (selectingDestOrient ? GameObjectFrameController::getSingleton()->getGameObjectFrame(0).getDirVec() : Vector3::VEC_ZERO);
mainPlayer->issueOrder(type, destDir, targets, addOrder);
this->targets.clear();
@@ -397,6 +395,9 @@ namespace battleship{
if(ufCtr->isPlacingFrames()) ufCtr->setRotatingFrames(isPressed);
if (!isPressed) deselectUnits();
break;
case Bind::EJECT_GARRISON:
if(isPressed) issueOrder(Order::TYPE::EJECT, vector<Order::Target>{}, shiftPressed);
break;
case Bind::TOGGLE_SUB:
break;
case Bind::ZOOM_IN:
+2 -1
View File
@@ -49,7 +49,8 @@ namespace battleship{
ENABLE_Z_AXIS,
CREATE_WATERBODY,
GENERATE_WEIGHTS,
TOGGLE_CELL_MARKERS
TOGGLE_CELL_MARKERS,
EJECT_GARRISON
};
}
+2 -2
View File
@@ -26,9 +26,9 @@ namespace battleship{
const static int numAppStates = 4;
const static int numStaticBinds[numAppStates]{6, 0, 5, 19};
const static int numConfBinds[numAppStates]{0, 1, 22, 0};
const static int numConfBinds[numAppStates]{0, 1, 23, 0};
const static int maxStaticBinds = 19;
const static int maxConfBinds = 22;
const static int maxConfBinds = 23;
const static int numScripts = 5;
const static std::string scriptPathBase = "Scripts/";
+2
View File
@@ -56,6 +56,8 @@ namespace battleship{
}
void Player::issueOrder(Order::TYPE type, Vector3 destDir, vector<Order::Target> targets, bool append){
if(type != Order::TYPE::EJECT && targets.empty()) return;
vector<Unit*> selectedUnits = getSelectedUnits();
if(type == Order::TYPE::EJECT){