z_mirror/Tapeline

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

Caleb HeuerGet loading2411920

3.0
4.9 KiB191 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 = "SHIFT + mouse-wheel-up",
28    order = "d",
29  },
30  {
31    type = "custom-input",
32    name = "tl-decrease-divisor",
33    key_sequence = "SHIFT + 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    picture = {
67      filename = data_util.empty_image,
68      width = 8,
69      height = 8,
70    },
71    build_sound = {
72      filename = "__core__/sound/silence-1sec.ogg",
73    },
74    created_smoke = { smoke_name = "tl-empty-smoke" },
75    alert_when_damaged = false,
76  },
77  {
78    type = "highlight-box",
79    name = "tl-highlight-box",
80  },
81  {
82    type = "selection-tool",
83    name = "tl-tool",
84    localised_name = { "item-name.tl-tool" },
85    icons = {
86      { icon = data_util.black_image, icon_size = 1, scale = 64 },
87      { icon = "__Tapeline__/graphics/item/tapeline-tool.png", icon_size = 32, icon_mipmaps = 2 },
88    },
89    subgroup = "tool",
90    order = "c[automated-construction]-x",
91    select = {
92      mode = "nothing",
93      border_color = { a = 0 },
94      cursor_box_type = "not-allowed",
95    },
96    alt_select = {
97      mode = "nothing",
98      border_color = { a = 0 },
99      cursor_box_type = "not-allowed",
100    },
101    place_result = "tl-dummy-entity",
102    stack_size = 10,
103    flags = { "only-in-cursor", "spawnable" },
104    hidden = true,
105    draw_label_for_cursor_render = true,
106    mouse_cursor = "tl-tool-cursor",
107  },
108  {
109    type = "mouse-cursor",
110    name = "tl-tool-cursor",
111    filename = "__Tapeline__/graphics/cursor/draw-cursor.png",
112    hot_pixel_x = 1,
113    hot_pixel_y = 1,
114  },
115  {
116    type = "shortcut",
117    name = "tl-get-tool",
118    order = "a[alt-mode]-b[copy]",
119    associated_control_input = "tl-get-tool",
120    action = "spawn-item",
121    item_to_spawn = "tl-tool",
122    icon = "__Tapeline__/graphics/shortcut/shortcut-x32.png",
123    icon_size = 32,
124    small_icon = "__Tapeline__/graphics/shortcut/shortcut-x24.png",
125    small_icon_size = 24,
126  },
127  -- {
128  --   type = "tips-and-tricks-item-category",
129  --   name = "tapeline",
130  --   order = "l-[tapeline]",
131  -- },
132  -- {
133  --   type = "tips-and-tricks-item",
134  --   name = "tl-introduction",
135  --   category = "tapeline",
136  --   order = "a",
137  --   is_title = true,
138  --   trigger = { type = "dependencies-met" },
139  --   image = "__Tapeline__/graphics/tips-and-tricks/introduction.png",
140  -- },
141  -- {
142  --   type = "tips-and-tricks-item",
143  --   name = "tl-persistent",
144  --   category = "tapeline",
145  --   order = "b",
146  --   indent = 1,
147  --   dependencies = { "tl-introduction" },
148  --   trigger = { type = "dependencies-met" },
149  --   image = "__Tapeline__/graphics/tips-and-tricks/persistent.png",
150  -- },
151  -- {
152  --   type = "tips-and-tricks-item",
153  --   name = "tl-modes",
154  --   category = "tapeline",
155  --   order = "c",
156  --   indent = 1,
157  --   dependencies = { "tl-introduction" },
158  --   trigger = { type = "dependencies-met" },
159  --   image = "__Tapeline__/graphics/tips-and-tricks/modes.png",
160  -- },
161  -- {
162  --   type = "tips-and-tricks-item",
163  --   name = "tl-divisors",
164  --   category = "tapeline",
165  --   order = "d",
166  --   indent = 1,
167  --   dependencies = { "tl-introduction" },
168  --   trigger = { type = "dependencies-met" },
169  --   image = "__Tapeline__/graphics/tips-and-tricks/divisors.png",
170  -- },
171  -- {
172  --   type = "tips-and-tricks-item",
173  --   name = "tl-edit",
174  --   category = "tapeline",
175  --   order = "e",
176  --   indent = 1,
177  --   dependencies = { "tl-introduction" },
178  --   trigger = { type = "dependencies-met" },
179  --   image = "__Tapeline__/graphics/tips-and-tricks/edit.png",
180  -- },
181  {
182    type = "trivial-smoke",
183    name = "tl-empty-smoke",
184    animation = {
185      filename = data_util.empty_image,
186      size = { 1, 1 },
187      frame_count = 8,
188    },
189    duration = 1,
190  },
191})