From a54c4310d8d2feae0712ed6a5d2c3b9cbf5e903a Mon Sep 17 00:00:00 2001 From: jacks0n Date: Sun, 20 Nov 2016 00:20:04 +0100 Subject: [PATCH] Resolves #82 Add hotkey for 'Create Pin'(#117) --- UI/WorldInput.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UI/WorldInput.lua b/UI/WorldInput.lua index d8cd227..e122255 100644 --- a/UI/WorldInput.lua +++ b/UI/WorldInput.lua @@ -1054,8 +1054,13 @@ function DefaultKeyUpHandler( uiKey:number ) CQUI_BuildImprovement(UI.GetHeadSelectedUnit(), 168372657); --Farm end if( uiKey == Keys.P ) then - CQUI_BuildImprovement(UI.GetHeadSelectedUnit(), 154488225); --Pasture - CQUI_BuildImprovement(UI.GetHeadSelectedUnit(), 1523996587); --Plantation + local selectedUnit = UI.GetHeadSelectedUnit(); + if (selectedUnit) then + CQUI_BuildImprovement(UI.GetHeadSelectedUnit(), 154488225); --Pasture + CQUI_BuildImprovement(UI.GetHeadSelectedUnit(), 1523996587); --Plantation + else + PlaceMapPin(); + end end if( uiKey == Keys.N ) then CQUI_BuildImprovement(UI.GetHeadSelectedUnit(), 1001859687); --Mine