Skip to content

Commit 892ba44

Browse files
committed
Improve stl-string definition
1 parent a502458 commit 892ba44

35 files changed

+868
-864
lines changed

dist/library/base.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ function dfbase:_displace(index, step) end
8686
---@field insert fun(self: self, index: "#ref"|"#"|integer, item: any)
8787
---@field erase fun(self: self, index: integer)
8888

89+
---@class df.string: string
90+
---@field value string
91+
8992
---@param object table
9093
---@return integer
9194
function df.sizeof(object) end

dist/library/df.advmode.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ df.ui_advmode_menu = {}
211211
---@field PartyTacticalSettings boolean
212212

213213
---@class conversation: df.class
214-
---@field conv_title string
214+
---@field conv_title df.string
215215
---@field state conversation_state
216216
---@field talk_choices df.container
217217
---@field unk_30 integer References: unit
@@ -261,7 +261,7 @@ df.conversation.T_state = {}
261261

262262

263263
---@class conversation_speech: df.class
264-
---@field text string[] wordwrap
264+
---@field text df.string[] wordwrap
265265
---@field speaker integer References: unit
266266
---@field unk_14 integer
267267
---@field unk_18 integer
@@ -1224,7 +1224,7 @@ df.talk_choice.T_unk = {}
12241224
---@field travel_clouds boolean
12251225
---@field travel_right_map adventurest_travel_right_map
12261226
---@field show_menu adventurest_show_menu bottom menu in travel mode
1227-
---@field message string you must move from surrounding obstacles
1227+
---@field message df.string you must move from surrounding obstacles
12281228
---@field message_color integer
12291229
---@field message_brightness integer
12301230
---@field travel_not_moved boolean
@@ -1330,7 +1330,7 @@ df.talk_choice.T_unk = {}
13301330
---@field companions adventurest_companions
13311331
---@field unk_1 integer
13321332
---@field interactions adventurest_interactions
1333-
---@field unk_87 string
1333+
---@field unk_87 df.string
13341334
---@field unk_220 integer
13351335
---@field unk_224 integer
13361336
---@field unk_v40_2 adventurest_unk_v40_2
@@ -1351,7 +1351,7 @@ df.talk_choice.T_unk = {}
13511351
---@field move_carefully integer Is set when the player prepares to move carefully (via the Alt + movement key combo)
13521352
---@field careful_direction_x integer x-axis direction for the last attempted careful player unit movement: -1 = west, 0 = none, 1 = east
13531353
---@field careful_direction_y integer y-axis direction for the last attempted careful player unit movement: -1 = north, 0 = none, 1 = south
1354-
---@field interrupt_performance_warning string the message displayed when the player attempts to move while their unit is performing
1354+
---@field interrupt_performance_warning df.string the message displayed when the player attempts to move while their unit is performing
13551355
---@field unk_2 integer
13561356
---@field unk_2a integer
13571357
---@field name_item language_name used when naming items
@@ -1494,7 +1494,7 @@ df.adventurest.T_unk_3170.T_unk_2 = {}
14941494
---@field unk_43 df.container
14951495
---@field unk_44 df.container
14961496
---@field unk_45 integer
1497-
---@field unk_46 string
1497+
---@field unk_46 df.string
14981498
---@field unk_47 integer
14991499
---@field unk_48 integer
15001500
---@field unk_49 integer
@@ -1606,16 +1606,16 @@ df.adventurest.T_charge_forbidden = {}
16061606
---@field page_top_choices df.container
16071607
---@field page_bottom_choices df.container
16081608
---@field choices adventurest.T_conversation_choices[]
1609-
---@field filter string
1609+
---@field filter df.string
16101610
---@field unk_1 integer
16111611
---@field targets adventurest.T_conversation_targets[]
16121612
---@field cursor_target integer
16131613
df.adventurest.T_conversation = {}
16141614

16151615
---@class adventurest.T_conversation_choices: df.class
16161616
---@field choice talk_choice
1617-
---@field keywords string[]
1618-
---@field title string[]
1617+
---@field keywords df.string[]
1618+
---@field title df.string[]
16191619
---@field orig_index integer
16201620
---@field ranking integer
16211621
df.adventurest.T_conversation.T_choices = {}
@@ -1739,7 +1739,7 @@ df.adventurest.T_unk_v40_5 = {}
17391739
---@field unk_s1 integer
17401740
---@field unk_s2 df.container
17411741
---@field unk_s3 df.container
1742-
---@field unk_s4 string
1742+
---@field unk_s4 df.string
17431743
---@field unk_s5 integer
17441744
---@field unk_s6 integer
17451745
---@field unk_s7 integer
@@ -1757,15 +1757,15 @@ df.adventurest.T_unk_v42_1 = {}
17571757
---@field origin integer References: historical_entity
17581758
---@field unk_1 df.container
17591759
---@field unk_2 df.container
1760-
---@field filter string
1760+
---@field filter df.string
17611761
---@field unk_3 integer
17621762
---@field unk_4 integer
17631763
df.adventurest.T_assume_identity = {}
17641764

17651765
---@class text_info_elementst: df.class
17661766
df.text_info_elementst = {}
17671767

1768-
---@param val string
1768+
---@param val df.string
17691769
function df.text_info_elementst.getString(val) end
17701770

17711771
---@return integer
@@ -1776,14 +1776,14 @@ function df.text_info_elementst.getLong() end
17761776
df.text_info_element_longst = {}
17771777

17781778
---@class text_info_element_stringst: text_info_elementst
1779-
---@field val string
1779+
---@field val df.string
17801780
df.text_info_element_stringst = {}
17811781

17821782
---<br> for "pick up vermin":<br><br> the first argument is set to the vermin index if an item was allocated and this was the last vermin of its type<br> the second argument is set to true if an item was allocated, false otherwise<br> the third argument is set to true if the second argument is false<br> the first and third arguments are not changed in all other cases<br> returns an item_verminst pointer<br><br> for all other types (as of 0.47.04):<br><br> does not modify arguments 1 and 2<br> argument 3 is set to true if a fire was started<br> returns nullptr<br>
17831783
---@class adventure_optionst: df.class
17841784
df.adventure_optionst = {}
17851785

1786-
---@param unk_0 string
1786+
---@param unk_0 df.string
17871787
function df.adventure_optionst.getDescription(unk_0) end
17881788

17891789
---@param unk_0 item
@@ -1947,7 +1947,7 @@ df.adventure_movement_item_interact_pushst = {}
19471947
---@class adventure_item_interact_choicest: df.class
19481948
df.adventure_item_interact_choicest = {}
19491949

1950-
---@param unk_0 string
1950+
---@param unk_0 df.string
19511951
function df.adventure_item_interact_choicest.getDescription(unk_0) end
19521952

19531953
function df.adventure_item_interact_choicest.performAction() end

dist/library/df.announcements.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ df.announcements = {}
14461446

14471447
---@class report: df.instance
14481448
---@field type announcement_type valid only if coordinates are
1449-
---@field text string
1449+
---@field text df.string
14501450
---@field color integer
14511451
---@field bright boolean
14521452
---@field duration integer remaining graphical frames to display this report in announcement bar
@@ -1503,7 +1503,7 @@ df.report_zoom_type = {}
15031503
---@field Unit boolean
15041504

15051505
---@class popup_message: df.class
1506-
---@field text string
1506+
---@field text df.string
15071507
---@field color integer
15081508
---@field bright boolean
15091509
df.popup_message = {}

dist/library/df.art.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ function df.art_image_element.clone(unk_0) end
5151
---@param unk_1 integer
5252
function df.art_image_element.getSymbol(sym, unk_1) end
5353

54-
---@param name string
54+
---@param name df.string
5555
---@param useThe boolean
5656
---@param useName boolean
5757
function df.art_image_element.getName1(name, useThe, useName) end
5858

59-
---@param name string
59+
---@param name df.string
6060
---@param unk_1 boolean
6161
function df.art_image_element.getName2(name, unk_1) end
6262

@@ -125,7 +125,7 @@ function df.art_image_property.getType() end
125125
---@return art_image_element
126126
function df.art_image_property.clone(unk_0) end
127127

128-
---@param unk_0 string
128+
---@param unk_0 df.string
129129
---@param unk_1 art_image
130130
---@param useName boolean
131131
function df.art_image_property.getName(unk_0, unk_1, useName) end
@@ -2290,7 +2290,7 @@ df.dance_form_move_group_type = {}
22902290
---@field DanceMove boolean
22912291

22922292
---@class dance_form_move: df.class
2293-
---@field name string
2293+
---@field name df.string
22942294
---@field type dance_form_move_type[]
22952295
---@field modifier dance_form_move_modifier[]
22962296
---@field parameter df.container Depends on type (turns are in signed angles, steps are in number of steps, etc.)
@@ -2351,7 +2351,7 @@ df.scale_type = {}
23512351
---@field PerfectFourth boolean
23522352

23532353
---@class chord: df.class
2354-
---@field name string
2354+
---@field name df.string
23552355
---@field notes integer[] chord_size entries used. Refers to the notes indices
23562356
---@field chord_size integer
23572357
---@field unk_3 integer 0 and 1 seen
@@ -2360,7 +2360,7 @@ df.chord = {}
23602360
---Seems odd with a 'scale' consisting of two chords, but that's what the exported XML calls it.
23612361
---@class named_scale: df.class
23622362
---@field unk_1 integer 0-4 seen. 0: nothing, for when degrees are used, 1: joined chords, 2/3: disjoined chords (varying kinds of chords seen for both), 4: as always, disjoined chords
2363-
---@field name string
2363+
---@field name df.string
23642364
---@field degrees integer[] indices into the (not necessarily named) notes of the scale
23652365
---@field degrees_used integer elements used in array above
23662366
---@field first_chord integer this pair seems to be used when degrees_used = 0. Refers to indices in the chords vector
@@ -2395,8 +2395,8 @@ df.scale.T_flags = {}
23952395
---Curiously, the named notes do not have to match the number of defined notes
23962396
---@class scale_notes: df.class
23972397
---@field unk_1 integer Frequently looks like garbage for all values of type. Suspect it's actually a filler
2398-
---@field name string[]
2399-
---@field abreviation string[]
2398+
---@field name df.string[]
2399+
---@field abreviation df.string[]
24002400
---@field number integer[]
24012401
---@field length integer number of elements of the arrays above used
24022402
df.scale.T_notes = {}
@@ -2466,10 +2466,10 @@ df.beat_type = {}
24662466
---@field AccentedSyncopated boolean
24672467

24682468
---@class rhythm_pattern: df.class
2469-
---@field name string
2469+
---@field name df.string
24702470
---@field bars rhythm_pattern_bars[]
2471-
---@field beat_name string length as per length field
2472-
---@field beat_abbreviation string length as per length field
2471+
---@field beat_name df.string length as per length field
2472+
---@field beat_abbreviation df.string length as per length field
24732473
---@field length integer
24742474
df.rhythm_pattern = {}
24752475

@@ -2479,7 +2479,7 @@ df.rhythm_pattern = {}
24792479
df.rhythm_pattern.T_bars = {}
24802480

24812481
---@class sub_rhythm: df.class
2482-
---@field name string
2482+
---@field name df.string
24832483
---@field patterns df.container indices into patterns
24842484
---@field unk_2 df.container Same length as patterns, but with unknown purpose
24852485
---@field unk_3 integer

dist/library/df.building-raws.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
---@meta df.building-raws
33

44
---@class building_def: df.instance
5-
---@field code string
5+
---@field code df.string
66
---@field id integer
7-
---@field name string
7+
---@field name df.string
88
---@field building_type building_type
99
---@field building_subtype integer
1010
---@field name_color integer[]
@@ -21,7 +21,7 @@
2121
---@field workloc_x integer
2222
---@field workloc_y integer
2323
---@field build_labors unit_labor[]
24-
---@field labor_description string
24+
---@field labor_description df.string
2525
---@field build_stages integer
2626
df.building_def = {}
2727

@@ -45,8 +45,8 @@ function df.building_def.finalize() end
4545
---@field item_subtype integer
4646
---@field mat_type integer References: material
4747
---@field mat_index integer
48-
---@field reaction_class string
49-
---@field has_material_reaction_product string
48+
---@field reaction_class df.string
49+
---@field has_material_reaction_product df.string
5050
---@field flags1 job_item_flags1
5151
---@field flags2 job_item_flags2
5252
---@field flags3 job_item_flags3
@@ -56,9 +56,9 @@ function df.building_def.finalize() end
5656
---@field min_dimension integer
5757
---@field quantity integer
5858
---@field has_tool_use tool_uses
59-
---@field item_str string[]
60-
---@field material_str string[]
61-
---@field metal_ore_str string
59+
---@field item_str df.string[]
60+
---@field material_str df.string[]
61+
---@field metal_ore_str df.string
6262
df.building_def_item = {}
6363

6464
---@class building_def_workshopst: building_def

dist/library/df.buildings.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ df.building_drawbuffer = {}
395395
---@field general_refs general_ref[]
396396
---@field relations building_civzonest[] zone(s) this building is in
397397
---@field job_claim_suppress building_job_claim_suppress[] after Remv Cre, prevents unit from taking jobs at building
398-
---@field name string
398+
---@field name df.string
399399
---@field activities building_activities[]
400400
---@field world_data_id integer References: world_object_data
401401
---@field world_data_subid integer
@@ -573,7 +573,7 @@ function df.building.getFreeCapacity(subtract_pending_jobs) end
573573
---@return boolean
574574
function df.building.canStoreItem(unk_0, subtract_pending_jobs) end
575575

576-
---@param name string
576+
---@param name df.string
577577
function df.building.getName(name) end
578578

579579
function df.building.getNameColor() end

0 commit comments

Comments
 (0)