mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
new mappings
This commit is contained in:
@@ -33,6 +33,8 @@ mappings = {
|
||||
{bind = 29, trigger = 55, action = true, bindType = 0, inOptions = true},
|
||||
{bind = 30, trigger = 56, action = true, bindType = 0, inOptions = true},
|
||||
{bind = 31, trigger = 57, action = true, bindType = 0, inOptions = true},
|
||||
{bind = 32, trigger = 66, action = true, bindType = 0, inOptions = true},
|
||||
{bind = 32, trigger = 256, action = true, bindType = 0, inOptions = true},
|
||||
}
|
||||
graphics = {
|
||||
resolution = {x = 1366, y = 768}
|
||||
|
||||
@@ -23,11 +23,7 @@ unitType = {
|
||||
}
|
||||
|
||||
health = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}
|
||||
speed = {.025, .025, .05, .05, .1, .1, .1, .1, .1, .1, .15}
|
||||
destinationOffset = {.75, .75, 1, 1, .1, .1, .1, .1, .1, .5, .5}
|
||||
anglePrecision = {.1, .1, .1, .1, .1, .1, .1, .1, .1, 3, 3}
|
||||
cost = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}
|
||||
maxTurnAngle = {.1, .1, .5, .5, 1, 1, .5, .5, 1, 2, 2}
|
||||
range = {15, 15, 14, 14, 13, 13, 12, 12, 15, 25}
|
||||
|
||||
unitCornerPoints = {
|
||||
@@ -255,7 +251,7 @@ unitCuboidDimensions = {
|
||||
}
|
||||
};
|
||||
|
||||
unitAxisLength = {8, 8,6,6,5, 5,8, 8, 7,2,2}
|
||||
unitAxisLength = {8, 8, 6, 6, 5, 5, 8, 8, 7, 2, 2}
|
||||
lineOfSight = {5, 8, 4, 4, 3, 3, 6, 6, 3, 3, 8}
|
||||
name = {
|
||||
"Battleship", "Battleship",
|
||||
|
||||
@@ -22,13 +22,10 @@ unitType = {
|
||||
UnitType.AIR, UnitType.AIR
|
||||
}
|
||||
|
||||
health = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}
|
||||
speed = {.025, .025, .05, .05, .1, .1, .1, .1, .1, .1, .15}
|
||||
destinationOffset = {.75, .75, 1, 1, .1, .1, .1, .1, .1, .5, .5}
|
||||
anglePrecision = {.1, .1, .1, .1, .1, .1, .1, .1, .1, 3, 3}
|
||||
cost = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}
|
||||
maxTurnAngle = {.1, .1, .5, .5, 1, 1, .5, .5, 1, 2, 2}
|
||||
range = {15, 15, 14, 14, 13, 13, 12, 12, 15, 25}
|
||||
|
||||
unitCornerPoints = {
|
||||
{
|
||||
|
||||
+10
-2
@@ -221,12 +221,13 @@ namespace battleship{
|
||||
color = Vector3::VEC_J;
|
||||
break;
|
||||
case Order::TYPE::ATTACK:
|
||||
case Order::TYPE::LAUNCH:
|
||||
color = Vector3::VEC_I;
|
||||
break;
|
||||
case Order::TYPE::PATROL:
|
||||
color = Vector3::VEC_K;
|
||||
break;
|
||||
case Order::TYPE::LAUNCH:
|
||||
case Order::TYPE::BUILD:
|
||||
color = Vector3(1, 1, 0);
|
||||
break;
|
||||
}
|
||||
@@ -345,7 +346,8 @@ namespace battleship{
|
||||
}
|
||||
break;
|
||||
case Bind::LOOK_AROUND:
|
||||
lookingAround = isPressed;
|
||||
if(!placingStructure)
|
||||
lookingAround = isPressed;
|
||||
break;
|
||||
case Bind::HALT:
|
||||
for (Unit *u : selectedUnits)
|
||||
@@ -401,6 +403,12 @@ namespace battleship{
|
||||
}
|
||||
|
||||
break;
|
||||
case Bind::SELECT_STRUCTURE:
|
||||
placingStructure = true;
|
||||
break;
|
||||
case Bind::DESELECT_STRUCTURE:
|
||||
placingStructure = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ namespace battleship{
|
||||
void update();
|
||||
void onAction(int, bool);
|
||||
void onAnalog(int, float);
|
||||
inline bool isPlacingStructure(){return placingStructure;}
|
||||
inline void setSelectingLaunchPoint(bool s){this->selectingGuidedMissileTarget=s;}
|
||||
inline Player* getPlayer(){return mainPlayer;}
|
||||
inline std::vector<Unit*>& getSelectedUnits(){return selectedUnits;}
|
||||
@@ -47,7 +48,7 @@ namespace battleship{
|
||||
std::vector<vb01::Node*> unitLightNodes;
|
||||
std::vector<Unit*> unitGroups[9], selectedUnits;
|
||||
std::vector<Order::Target> targets;
|
||||
bool isSelectionBox = false, shiftPressed = false, controlPressed = false, selectingPatrolPoints = false, selectingGuidedMissileTarget = false, lookingAround = false;
|
||||
bool isSelectionBox = false, shiftPressed = false, controlPressed = false, selectingPatrolPoints = false, selectingGuidedMissileTarget = false, lookingAround = false, placingStructure = false;
|
||||
int playerId, zooms = 0;
|
||||
const int NUM_MAX_ZOOMS = 10;
|
||||
float depth = 1;
|
||||
|
||||
@@ -34,7 +34,9 @@ namespace battleship{
|
||||
GROUP_6,
|
||||
GROUP_7,
|
||||
GROUP_8,
|
||||
GROUP_9
|
||||
GROUP_9,
|
||||
SELECT_STRUCTURE,
|
||||
DESELECT_STRUCTURE
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+10
-6
@@ -19,9 +19,9 @@ namespace battleship{
|
||||
|
||||
const static int numAppStates = 3;
|
||||
const static int numStaticBinds[numAppStates]{6, 0, 5};
|
||||
const static int numConfBinds[numAppStates]{0, 1, 20};
|
||||
const static int numConfBinds[numAppStates]{0, 1, 22};
|
||||
const static int maxStaticBinds = 6;
|
||||
const static int maxConfBinds = 20;
|
||||
const static int maxConfBinds = 22;
|
||||
|
||||
const static Bind staticBinds[numAppStates][maxStaticBinds]{
|
||||
{
|
||||
@@ -66,7 +66,9 @@ namespace battleship{
|
||||
Bind::GROUP_6,
|
||||
Bind::GROUP_7,
|
||||
Bind::GROUP_8,
|
||||
Bind::GROUP_9
|
||||
Bind::GROUP_9,
|
||||
Bind::SELECT_STRUCTURE,
|
||||
Bind::DESELECT_STRUCTURE
|
||||
}
|
||||
};
|
||||
|
||||
@@ -113,7 +115,9 @@ namespace battleship{
|
||||
GLFW_KEY_6,
|
||||
GLFW_KEY_7,
|
||||
GLFW_KEY_8,
|
||||
GLFW_KEY_9
|
||||
GLFW_KEY_9,
|
||||
GLFW_KEY_B,
|
||||
GLFW_KEY_ESCAPE
|
||||
}
|
||||
};
|
||||
|
||||
@@ -125,7 +129,7 @@ namespace battleship{
|
||||
const static bool isConfKey[numAppStates][maxConfBinds]{
|
||||
{},
|
||||
{1},
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
|
||||
};
|
||||
|
||||
const static bool isStaticAction[numAppStates][maxStaticBinds]{
|
||||
@@ -136,7 +140,7 @@ namespace battleship{
|
||||
const static bool isConfAction[numAppStates][maxConfBinds]{
|
||||
{},
|
||||
{1},
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
|
||||
};
|
||||
|
||||
int calcSumStaticBinds(int, bool);
|
||||
|
||||
+4
-3
@@ -317,9 +317,10 @@ namespace battleship{
|
||||
|
||||
void InGameAppState::onAction(int bind, bool isPressed) {
|
||||
switch((Bind)bind){
|
||||
case Bind::TOGGLE_MAIN_MENU:
|
||||
if(isPressed)toggleMainMenu();
|
||||
break;
|
||||
case Bind::TOGGLE_MAIN_MENU:
|
||||
if(isPressed && !activeState->isPlacingStructure())
|
||||
toggleMainMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user