mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
bugfix for inability to have engineers build structures
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user