Skip to content

Commit

Permalink
make alarm setting and clearing functions public
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Dec 6, 2024
1 parent 9fd678d commit 24994be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gui/civ-alert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ local function get_civ_alert()
return list[1]
end

local function can_sound_alarm()
-- public API section
function can_sound_alarm()
return df.global.plotinfo.alerts.civ_alert_idx == 0 and
#get_civ_alert().burrows > 0
end

local function sound_alarm()
function sound_alarm()
if not can_sound_alarm() then return end
df.global.plotinfo.alerts.civ_alert_idx = 1
end

local function can_clear_alarm()
function can_clear_alarm()
return df.global.plotinfo.alerts.civ_alert_idx ~= 0
end

local function clear_alarm()
function clear_alarm()
df.global.plotinfo.alerts.civ_alert_idx = 0
end

Expand Down

0 comments on commit 24994be

Please sign in to comment.