-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzone-bindings.lua
More file actions
39 lines (34 loc) · 1.51 KB
/
zone-bindings.lua
File metadata and controls
39 lines (34 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local main_interface = df.global.game.main_interface
if main_interface.bottom_mode_selected ~= df.main_bottom_mode_type.ZONE then
qerror(('The script must be called in ZONE mode (%d), but the current mode is %d'):format(df.main_bottom_mode_type.ZONE, main_interface.bottom_mode_selected))
end
local zones = {
['meeting-area'] = df.civzone_type.MeetingHall,
['bedroom'] = df.civzone_type.Bedroom,
['dining-hall'] = df.civzone_type.DiningHall,
['pen-pasture'] = df.civzone_type.Pen,
['pit-pond'] = df.civzone_type.Pond,
['water-source'] = df.civzone_type.WaterSource,
['dungeon'] = df.civzone_type.Dungeon,
['fishing'] = df.civzone_type.FishingArea,
['sand'] = df.civzone_type.SandCollection,
['office'] = df.civzone_type.Office,
['dormitory'] = df.civzone_type.Dormitory,
['barracks'] = df.civzone_type.Barracks,
['archery-range'] = df.civzone_type.ArcheryRange,
['garbage-dump'] = df.civzone_type.Dump,
['animal-training'] = df.civzone_type.AnimalTraining,
['tomb'] = df.civzone_type.Tomb,
['gather-fruit'] = df.civzone_type.PlantGathering,
['clay'] = df.civzone_type.ClayCollection,
}
local args = {...}
if #args ~= 1 then
qerror(('Single argument expected but %d arguments provided'):format(#args))
end
local current_zone_type = zones[args[1]]
if not current_zone_type then
qerror(('Unknown zone type %s'):format(args[1]))
end
main_interface.civzone.adding_new_type = current_zone_type
main_interface.bottom_mode_selected = df.main_bottom_mode_type.ZONE_PAINT