bugfix for inability to have engineers build structures

This commit is contained in:
devZoGok
2023-11-26 11:55:11 +02:00
parent ed932b7ac9
commit ba65842421
2 changed files with 51 additions and 3 deletions
+44 -3
View File
@@ -1,15 +1,56 @@
numGui = 1
numGui = 5
res = graphics.resolution
Size = {x = 100, y = 100}
gui = {
{
pos = {x = res.x - 200, y = res.y - 200},
size = Size,
name = 'Land factory',
imagePath = '',
guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD,
trigger = 75,
structureId = 8
},
{
pos = {x = res.x - Size.x - 200, y = res.y - 200},
size = Size,
name = 'Naval factory',
imagePath = '',
guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD,
trigger = 78,
structureId = 9
},
{
pos = {x = res.x - 2 * Size.x - 200, y = res.y - 200},
size = {x = 100, y = 100},
name = 'Market',
imagePath = '',
guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD,
trigger = 75,
structureId = 10
},
{
pos = {x = res.x - 3 * Size.x - 200, y = res.y - 200},
size = Size,
name = 'Lab',
imagePath = '',
guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD,
trigger = 84,
structureId = 11
},
{
pos = {x = res.x - 4 * Size.x - 200, y = res.y - 200},
size = Size,
name = 'Point defense',
imagePath = '',
guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD,
trigger = 66,
structureId = 8
trigger = 80,
structureId = 12
}
}
+7
View File
@@ -22,6 +22,7 @@
#include "util.h"
#include "tooltip.h"
#include "gameObjectFrameController.h"
#include "gameObjectFactory.h"
#include "cameraController.h"
#include "concreteGuiManager.h"
@@ -350,6 +351,12 @@ namespace battleship{
}
else if(ufCtr->isPlacingFrames() && !selectingDestOrient){
castRayToTerrain();
GameObjectFrame gmObjFr = ufCtr->getGameObjectFrame(0);
Unit *buildStruct = GameObjectFactory::createUnit(mainPlayer, gmObjFr.getId(), gmObjFr.getPos(), gmObjFr.getRot());
mainPlayer->addUnit(buildStruct);
targets[0].unit = buildStruct;
issueOrder(Order::TYPE::BUILD, targets, shiftPressed);
}
else if(canSelect){