z_mirror/Tapeline

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

Caleb HeuerUse slash requires37bb3aa

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