File tree 5 files changed +12
-31
lines changed
5 files changed +12
-31
lines changed Original file line number Diff line number Diff line change 1
- -- Embark underground.
2
- -- author: Atomic Chicken
3
-
4
1
-- @ module = true
5
2
6
3
local utils = require ' utils'
@@ -50,8 +47,8 @@ function getFeatureBlocks(featureID)
50
47
end
51
48
52
49
function isValidTiletype (tiletype )
53
- local tiletype = df .tiletype [tiletype ]
54
- local tiletypeAttrs = df .tiletype .attrs [tiletype ]
50
+ local tt = df .tiletype [tiletype ]
51
+ local tiletypeAttrs = df .tiletype .attrs [tt ]
55
52
local material = tiletypeAttrs .material
56
53
local forbiddenMaterials = {
57
54
df .tiletype_material .TREE , -- so as not to embark stranded on top of a tree
@@ -95,7 +92,7 @@ function blockGlowingBarrierAnnouncements(recenter)
95
92
dfhack .timeout (1 ,' ticks' , function () -- barrier disappears after 1 tick
96
93
announcementFlags :assign (oldFlags ) -- restore announcement settings
97
94
if recenter then
98
- -- Remove glowing barrier notifications:
95
+ -- Remove glowing barrier notifications:
99
96
local status = df .global .world .status
100
97
local announcements = status .announcements
101
98
for i = # announcements - 1 , 0 , - 1 do
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ function LegendsManager:onDestroy()
75
75
dfhack .run_script (' devel/pop-screen' )
76
76
77
77
-- disable autosaves for the remainder of this session
78
- df .global .d_init .autosave = df .d_init_autosave .NONE
78
+ df .global .d_init .feature . autosave = df .d_init_autosave .NONE
79
79
end
80
80
end
81
81
Original file line number Diff line number Diff line change @@ -22,18 +22,9 @@ if not dfhack.world.isFortressMode() then
22
22
qerror (' This script can only be used in fortress mode' )
23
23
end
24
24
25
- local ui_main = df .global .plotinfo .main
26
- local flags4 = df .global .d_init .flags4
27
-
28
- local function restore_autobackup ()
29
- if ui_main .autosave_request and dfhack .isMapLoaded () then
30
- dfhack .timeout (10 , ' frames' , restore_autobackup )
31
- else
32
- flags4 .AUTOBACKUP = true
33
- end
34
- end
35
-
36
25
function save ()
26
+ local ui_main = df .global .plotinfo .main
27
+
37
28
-- Request auto-save (preparation steps below discovered from rev eng)
38
29
ui_main .autosave_request = true
39
30
ui_main .autosave_timer = 5
@@ -45,13 +36,6 @@ function save()
45
36
ui_main .save_progress .info .cur_unit_chunk = nil
46
37
ui_main .save_progress .info .cur_unit_chunk_num = - 1
47
38
ui_main .save_progress .info .units_offloaded = - 1
48
-
49
- -- And since it will overwrite the backup, disable it temporarily
50
- if flags4 .AUTOBACKUP then
51
- flags4 .AUTOBACKUP = false
52
- restore_autobackup ()
53
- end
54
-
55
39
print ' The game should autosave now.'
56
40
end
57
41
Original file line number Diff line number Diff line change 1
1
local guidm = require (' gui.dwarfmode' )
2
2
3
- local flags4 = df .global .d_init .flags4
3
+ local flags = df .global .d_init .feature . flags
4
4
5
- if flags4 .KEYBOARD_CURSOR then
6
- flags4 .KEYBOARD_CURSOR = false
5
+ if flags .KEYBOARD_CURSOR then
6
+ flags .KEYBOARD_CURSOR = false
7
7
guidm .setCursorPos (xyz2pos (- 30000 , - 30000 , - 30000 ))
8
8
print (' Keyboard cursor disabled.' )
9
9
else
10
10
guidm .setCursorPos (guidm .Viewport .get ():getCenter ())
11
- flags4 .KEYBOARD_CURSOR = true
11
+ flags .KEYBOARD_CURSOR = true
12
12
print (' Keyboard cursor enabled.' )
13
13
end
Original file line number Diff line number Diff line change 1
-
2
- df . global . d_init . flags1 . SHOW_FLOW_AMOUNTS = not df . global . d_init . flags1 .SHOW_FLOW_AMOUNTS
1
+ local flags = df . global . d_init . display . flags
2
+ flags . SHOW_FLOW_AMOUNTS = not flags .SHOW_FLOW_AMOUNTS
3
3
print (' Water level display toggled.' )
You can’t perform that action at this time.
0 commit comments