summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-11 19:17:24 +0400
committerAlexander Gavrilov2012-09-11 19:17:24 +0400
commit3a075f4bc716550e0a621a2db40cfa578db1d0fa (patch)
treef325fdaf7c01fc8dd94684cd1336b74944fa2e16 /scripts
parent8ab615f6d0dce167a1952c4684922a7e48263c23 (diff)
downloaddfhack-3a075f4bc716550e0a621a2db40cfa578db1d0fa.tar.gz
dfhack-3a075f4bc716550e0a621a2db40cfa578db1d0fa.tar.bz2
dfhack-3a075f4bc716550e0a621a2db40cfa578db1d0fa.tar.xz
Trivial siege engine aiming at units, with logic in lua.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gui/siege-engine.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/gui/siege-engine.lua b/scripts/gui/siege-engine.lua
index bba6bce8..7ad828c9 100644
--- a/scripts/gui/siege-engine.lua
+++ b/scripts/gui/siege-engine.lua
@@ -45,7 +45,9 @@ function SiegeEngine:onShow()
end
function SiegeEngine:onDestroy()
- self:selectBuilding(self.building, self.old_cursor, self.old_viewport, 10)
+ if self.building then
+ self:selectBuilding(self.building, self.old_cursor, self.old_viewport, 10)
+ end
end
function SiegeEngine:showCursor(enable)
@@ -213,6 +215,7 @@ local status_table = {
ok = { pen = COLOR_GREEN, msg = "Target accessible" },
out_of_range = { pen = COLOR_CYAN, msg = "Target out of range" },
blocked = { pen = COLOR_RED, msg = "Target obstructed" },
+ semi_blocked = { pen = COLOR_BROWN, msg = "Partially obstructed" },
}
function SiegeEngine:onRenderBody_aim(dc)
@@ -291,6 +294,12 @@ function SiegeEngine:onInput(keys)
self:centerViewOn(self.center)
elseif keys.LEAVESCREEN then
self:dismiss()
+ elseif keys.LEAVESCREEN_ALL then
+ self:dismiss()
+ self.building = nil
+ guidm.clearCursorPos()
+ df.global.ui.main.mode = df.ui_sidebar_mode.Default
+ df.global.world.selected_building = nil
end
end