Skip to content

Commit f1491ff

Browse files
committed
Improve parsing of plugins
1 parent b0fc7a9 commit f1491ff

33 files changed

+329
-25
lines changed

dist/library/lua/dfhack.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-- THIS FILE WAS GENERATED AUTOMATICALLY. DO NOT EDIT.
22
---@meta
33

4+
45
---@class dfhack
56
---@field BASE_G _G Original Lua global environment
67
---@field is_core_context boolean

dist/library/lua/dfhack/workshops.lua

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,67 @@ input_filter_defaults = {
2626
quantity = 1
2727
}
2828

29+
jobs_furnace={
30+
[df.furnace_type.Smelter]={
31+
{
32+
name="Melt metal object",
33+
items={fuel,{flags2={allow_melt_dump=true}}},--also maybe melt_designated
34+
job_fields={job_type=df.job_type.MeltMetalObject}
35+
}
36+
},
37+
[df.furnace_type.MagmaSmelter]={
38+
{
39+
name="Melt metal object",
40+
items={{flags2={allow_melt_dump=true}}},--also maybe melt_designated
41+
job_fields={job_type=df.job_type.MeltMetalObject}
42+
}
43+
},
44+
--[[ [df.furnace_type.MetalsmithsForge]={
45+
unpack(concat(furnaces,mechanism,anvil,crafts,coins,flask))
46+
47+
},
48+
]]
49+
--MetalsmithsForge,
50+
--MagmaForge
51+
--[[
52+
forges:
53+
weapons and ammo-> from raws...
54+
armor -> raws
55+
furniture -> builtins?
56+
siege eq-> builtin (only balista head)
57+
trap eq -> from raws+ mechanisms
58+
other object-> anvil, crafts, goblets,toys,instruments,nestbox... (raws?) flask, coins,stud with iron
59+
metal clothing-> raws???
60+
]]
61+
[df.furnace_type.GlassFurnace]={
62+
{
63+
name="collect sand",
64+
items={},
65+
job_fields={job_type=df.job_type.CollectSand}
66+
},
67+
--glass crafts x3
68+
},
69+
[df.furnace_type.WoodFurnace]={
70+
defaults={item_type=df.item_type.WOOD,vector_id=df.job_item_vector_id.WOOD},
71+
{
72+
name="make charcoal",
73+
items={{}},
74+
job_fields={job_type=df.job_type.MakeCharcoal}
75+
},
76+
{
77+
name="make ash",
78+
items={{}},
79+
job_fields={job_type=df.job_type.MakeAsh}
80+
}
81+
},
82+
[df.furnace_type.Kiln]={
83+
{
84+
name="collect clay",
85+
items={},
86+
job_fields={job_type=df.job_type.CollectClay}
87+
}
88+
},
89+
}
2990
jobs_workshop={
3091

3192
[df.workshop_type.Jewelers]={

dist/library/lua/gui/dialogs.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ local dialogs
1111

1212
---------------------------------
1313

14+
local DialogWindow
15+
1416
function DialogWindow:init(info) end
1517

1618
function DialogWindow:accept() end
@@ -28,9 +30,15 @@ function DialogScreen:init() end
2830
function DialogScreen:onDismiss() end
2931

3032
------------------------
33+
34+
function dialogs.showMessage(title, text, tcolor, on_close) end
35+
3136
function dialogs.showYesNoPrompt(title, text, tcolor, on_accept, on_cancel) end
3237

3338
------------------------
39+
40+
local MessageBox
41+
3442
MessageBox.focus_path = 'MessageBox'
3543

3644
function MessageBox:init(info) end

dist/library/lua/gui/widgets.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
---@field Pages widgets.Pages
1111
---@field EditField widgets.EditField
1212
---@field Scrollbar widgets.Scrollbar
13+
---@field Label widgets.Label
1314
---@field WrappedLabel widgets.WrappedLabel
1415
---@field TooltipLabel widgets.TooltipLabel
1516
---@field HotkeyLabel widgets.HotkeyLabel
@@ -163,6 +164,22 @@ function Scrollbar:init() end
163164
-- Scrollbar:update() are used.
164165
function Scrollbar:update(top_elem, elems_per_page, num_elems) end
165166

167+
function Scrollbar:onRenderBody(dc) end
168+
169+
function Scrollbar:onInput(keys) end
170+
171+
-----------
172+
-- Label --
173+
-----------
174+
175+
function widgets.parse_label_text(obj) end
176+
177+
function widgets.render_text(obj,dc,x0,y0,pen,dpen,disabled,hpen,hovered) end
178+
179+
function widgets.check_text_keys(self, keys) end
180+
181+
local Label
182+
166183
function Label:init(args) end
167184

168185
function Label:setText(text) end
@@ -387,6 +404,8 @@ function TabBar:onInput(keys) end
387404

388405
--------------------------------
389406

407+
local RangeSlider
408+
390409
function RangeSlider:preinit(init_table) end
391410

392411
function RangeSlider:init() end

dist/library/lua/plugins/buildingplan/filterselection.lua

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
---@class filterselection
55
---@field QualityAndMaterialsPage filterselection.QualityAndMaterialsPage
6+
---@field GlobalSettingsPage filterselection.GlobalSettingsPage
67
---@field FilterSelection filterselection.FilterSelection
78
---@field FilterSelectionScreen filterselection.FilterSelectionScreen
89
local filterselection
@@ -12,8 +13,32 @@ hide_unavailable = hide_unavailable or false
1213

1314
--------------------------------
1415

16+
local QualityAndMaterialsPage
17+
1518
function QualityAndMaterialsPage:init() end
1619

20+
function QualityAndMaterialsPage:refresh() end
21+
22+
function QualityAndMaterialsPage:toggle_category(_, choice) end
23+
24+
function QualityAndMaterialsPage:toggle_material(_, choice) end
25+
26+
function QualityAndMaterialsPage:invert_materials() end
27+
28+
function QualityAndMaterialsPage:clear_filter() end
29+
30+
function QualityAndMaterialsPage:set_decorated(decorated) end
31+
32+
function QualityAndMaterialsPage:set_min_quality(idx) end
33+
34+
function QualityAndMaterialsPage:set_max_quality(idx) end
35+
36+
function QualityAndMaterialsPage:onRenderFrame(dc, rect) end
37+
38+
--------------------------------
39+
40+
local GlobalSettingsPage
41+
1742
function GlobalSettingsPage:init() end
1843

1944
function GlobalSettingsPage:init_settings() end
@@ -22,6 +47,8 @@ function GlobalSettingsPage:update_setting(setting, val) end
2247

2348
--------------------------------
2449

50+
local FilterSelection
51+
2552
function FilterSelection:init() end
2653

2754
local FilterSelectionScreen

dist/library/lua/plugins/buildingplan/inspectoroverlay.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ reset_inspector_flag = false
1010

1111
--------------------------------
1212

13+
local InspectorLine
14+
1315
function InspectorLine:init() end
1416

1517
function InspectorLine:get_desc_string() end
@@ -20,6 +22,8 @@ function InspectorLine:reset() end
2022

2123
--------------------------------
2224

25+
local InspectorOverlay
26+
2327
function InspectorOverlay:init() end
2428

2529
function InspectorOverlay:reset() end

dist/library/lua/plugins/buildingplan/itemselection.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22
---@meta plugins.buildingplan.itemselection
33

44
---@class itemselection
5+
---@field ItemSelection itemselection.ItemSelection
56
---@field ItemSelectionScreen itemselection.ItemSelectionScreen
67
local itemselection
78

9+
function itemselection.get_automaterial_selection(building_type) end
10+
11+
function itemselection.get_item_description(item_id, item, safety_label) end
12+
13+
local ItemSelection
14+
815
function ItemSelection:init() end
916

1017
-- resort and restore selection

dist/library/lua/plugins/buildingplan/mechanisms.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ local mechanisms
77

88
--------------------------------
99

10+
local MechanismOverlay
11+
1012
function MechanismOverlay:init() end
1113

1214
function MechanismOverlay:save_id(which, item_id) end

dist/library/lua/plugins/buildingplan/planneroverlay.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
---@meta plugins.buildingplan.planneroverlay
33

44
---@class planneroverlay
5+
---@field ItemLine planneroverlay.ItemLine
56
---@field QuickFilter planneroverlay.QuickFilter
67
---@field PlannerOverlay planneroverlay.PlannerOverlay
78
local planneroverlay
@@ -13,6 +14,10 @@ config = config or json.open('dfhack-config/buildingplan.json')
1314
reset_counts_flag = false
1415
editing_filters_flag = false
1516

17+
--------------------------------
18+
19+
local ItemLine
20+
1621
function ItemLine:init() end
1722

1823
function ItemLine:reset() end
@@ -31,8 +36,6 @@ function ItemLine:is_impossible() end
3136
function ItemLine:reduce_quantity(used_quantity) end
3237

3338
--------------------------------
34-
-- QuickFilter
35-
--
3639

3740
-- Used to store a table of the following format:
3841
-- table<integer, { label: string, mats: string[] }>
@@ -58,6 +61,8 @@ function QuickFilter:get_label_text() end
5861
function QuickFilter:submit_name(text) end
5962
--------------------------------
6063

64+
local PlannerOverlay
65+
6166
function PlannerOverlay:init() end
6267

6368
function PlannerOverlay:show_favorites() end

dist/library/lua/plugins/buildingplan/unlink_mechanisms.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ saved_mode = saved_mode or 0
3030
}
3131

3232
------------------------
33+
3334
local ConfirmWindow
3435

3536
function ConfirmWindow:init() end
@@ -42,6 +43,8 @@ local ConfirmScreen
4243

4344
function ConfirmScreen:init() end
4445

46+
local MechLinkOverlay
47+
4548
function MechLinkOverlay:init() end
4649

4750
function MechLinkOverlay:do_scroll(spec) end
@@ -66,6 +69,8 @@ function MechLinkOverlay:preUpdateLayout(parent_rect) end
6669

6770
function MechLinkOverlay:onRenderFrame(dc, rect) end
6871

72+
local MechItemOverlay
73+
6974
valid_build = nil
7075

7176
function MechItemOverlay:init() end

0 commit comments

Comments
 (0)