z_mirror/Tapeline

git clone https://git.raiguard.me/z_mirror/Tapeline

Caleb HeuerSilence erroneous LuaLS warning58e4899

revert-47-freeze-fix
4.6 KiB183 linesraw
1local data_util = require("__flib__.data-util")
2
3data:extend({
4  {
5    type = "custom-input",
6    name = "tl-get-tool",
7    key_sequence = "ALT + M",
8    action = "spawn-item",
9    item_to_spawn = "tl-tool",
10    order = "a",
11  },
12  {
13    type = "custom-input",
14    name = "tl-edit-tape",
15    key_sequence = "mouse-button-2",
16    order = "b",
17  },
18  {
19    type = "custom-input",
20    name = "tl-delete-tape",
21    key_sequence = "SHIFT + mouse-button-2",
22    order = "c",
23  },
24  {
25    type = "custom-input",
26    name = "tl-increase-divisor",
27    key_sequence = "ALT + mouse-wheel-up",
28    order = "d",
29  },
30  {
31    type = "custom-input",
32    name = "tl-decrease-divisor",
33    key_sequence = "ALT + mouse-wheel-down",
34    order = "e",
35  },
36  {
37    type = "custom-input",
38    name = "tl-next-mode",
39    key_sequence = "CONTROL + mouse-wheel-up",
40    order = "f",
41  },
42  {
43    type = "custom-input",
44    name = "tl-previous-mode",
45    key_sequence = "CONTROL + mouse-wheel-down",
46    order = "g",
47  },
48  {
49    type = "custom-input",
50    name = "tl-linked-clear-cursor",
51    key_sequence = "",
52    linked_game_control = "clear-cursor",
53  },
54  {
55    type = "collision-layer",
56    name = "tapeline",
57  },
58  {
59    type = "simple-entity-with-force",
60    name = "tl-dummy-entity",
61    flags = { "not-on-map", "player-creation" },
62    hidden = true,
63    collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
64    collision_mask = { layers = { tapeline = true } },
65    selectable_in_game = false,
66    build_sound = { filename = "__core__/sound/silence-1sec.ogg" },
67    created_smoke = { smoke_name = "tl-empty-smoke" }, --- @diagnostic disable-line
68    alert_when_damaged = false,
69  },
70  {
71    type = "highlight-box",
72    name = "tl-highlight-box",
73  },
74  {
75    type = "selection-tool",
76    name = "tl-tool",
77    localised_name = { "item-name.tl-tool" },
78    icons = {
79      { icon = data_util.black_image, icon_size = 1, scale = 64 },
80      { icon = "__Tapeline__/graphics/item/tapeline-tool.png", icon_size = 32, icon_mipmaps = 2 },
81    },
82    subgroup = "tool",
83    order = "c[automated-construction]-x",
84    select = {
85      mode = "nothing",
86      border_color = { a = 0 },
87      cursor_box_type = "not-allowed",
88    },
89    alt_select = {
90      mode = "nothing",
91      border_color = { a = 0 },
92      cursor_box_type = "not-allowed",
93    },
94    place_result = "tl-dummy-entity",
95    stack_size = 10,
96    flags = { "only-in-cursor", "spawnable" },
97    hidden = true,
98    draw_label_for_cursor_render = true,
99    mouse_cursor = "tl-tool-cursor",
100  },
101  {
102    type = "mouse-cursor",
103    name = "tl-tool-cursor",
104    filename = "__Tapeline__/graphics/cursor/draw-cursor.png",
105    hot_pixel_x = 1,
106    hot_pixel_y = 1,
107  },
108  {
109    type = "shortcut",
110    name = "tl-get-tool",
111    order = "a[alt-mode]-b[copy]",
112    associated_control_input = "tl-get-tool",
113    action = "spawn-item",
114    item_to_spawn = "tl-tool",
115    icon = "__Tapeline__/graphics/shortcut/shortcut-x56.png",
116    icon_size = 56,
117    small_icon = "__Tapeline__/graphics/shortcut/shortcut-x24.png",
118    small_icon_size = 24,
119  },
120  {
121    type = "tips-and-tricks-item-category",
122    name = "tapeline",
123    order = "l-[tapeline]",
124  },
125  {
126    type = "tips-and-tricks-item",
127    name = "tl-introduction",
128    category = "tapeline",
129    order = "a",
130    is_title = true,
131    image = "__Tapeline__/graphics/tips-and-tricks/introduction.png",
132  },
133  {
134    type = "tips-and-tricks-item",
135    name = "tl-persistent",
136    category = "tapeline",
137    order = "b",
138    indent = 1,
139    dependencies = { "tl-introduction" },
140    trigger = { type = "dependencies-met" },
141    image = "__Tapeline__/graphics/tips-and-tricks/persistent.png",
142  },
143  {
144    type = "tips-and-tricks-item",
145    name = "tl-modes",
146    category = "tapeline",
147    order = "c",
148    indent = 1,
149    dependencies = { "tl-introduction" },
150    trigger = { type = "dependencies-met" },
151    image = "__Tapeline__/graphics/tips-and-tricks/modes.png",
152  },
153  {
154    type = "tips-and-tricks-item",
155    name = "tl-divisors",
156    category = "tapeline",
157    order = "d",
158    indent = 1,
159    dependencies = { "tl-introduction" },
160    trigger = { type = "dependencies-met" },
161    image = "__Tapeline__/graphics/tips-and-tricks/divisors.png",
162  },
163  {
164    type = "tips-and-tricks-item",
165    name = "tl-edit",
166    category = "tapeline",
167    order = "e",
168    indent = 1,
169    dependencies = { "tl-introduction" },
170    trigger = { type = "dependencies-met" },
171    image = "__Tapeline__/graphics/tips-and-tricks/edit.png",
172  },
173  {
174    type = "trivial-smoke",
175    name = "tl-empty-smoke",
176    animation = {
177      filename = data_util.empty_image,
178      size = { 1, 1 },
179      frame_count = 8,
180    },
181    duration = 1,
182  },
183})