diff options
| author | Alexander Gavrilov | 2012-09-11 19:17:24 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-09-11 19:17:24 +0400 |
| commit | 3a075f4bc716550e0a621a2db40cfa578db1d0fa (patch) | |
| tree | f325fdaf7c01fc8dd94684cd1336b74944fa2e16 /scripts | |
| parent | 8ab615f6d0dce167a1952c4684922a7e48263c23 (diff) | |
| download | dfhack-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.lua | 11 |
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 |
