mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
key mapping to eject units
This commit is contained in:
@@ -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
@@ -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:
|
||||
|
||||
@@ -49,7 +49,8 @@ namespace battleship{
|
||||
ENABLE_Z_AXIS,
|
||||
CREATE_WATERBODY,
|
||||
GENERATE_WEIGHTS,
|
||||
TOGGLE_CELL_MARKERS
|
||||
TOGGLE_CELL_MARKERS,
|
||||
EJECT_GARRISON
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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/";
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user