feat: display time until pop is possible

This commit is contained in:
insects 2025-03-11 15:38:53 +01:00
parent 3ddbc2d4b1
commit fb9ed4546a
3 changed files with 39 additions and 1 deletions

View file

@ -1,2 +1,22 @@
module InstanceHelper
def is_day?
et = Clock.get_current_eorzea_time
et.between?(et.change(hour: 6), et.change(hour: 18))
end
def has_missing_reqs?(nm, forecast)
et = Clock.get_current_eorzea_time
if nm[:weather] && nm[:weather] != forecast[0][:curr_weather]
return true
end
if nm[:spawned_by][:weather] && nm[:spawned_by][:weather] != forecast[0][:curr_weather]
return true
end
if nm[:night_only] && is_day?
return true
end
if nm[:spawned_by][:night_only] && is_day?
return true
end
false
end
end