z_mirror/Tapeline

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

Caleb Heuerfix: Update to new selection tool live-dragging APIe8fa7ab

trunk
4.1 KiB167 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 = "highlight-box",
56    name = "tl-highlight-box",
57  },
58  {
59    type = "selection-tool",
60    name = "tl-tool",
61    localised_name = { "item-name.tl-tool" },
62    icons = {
63      { icon = data_util.black_image, icon_size = 1, scale = 64 },
64      { icon = "__Tapeline__/graphics/item/tapeline-tool.png", icon_size = 32, icon_mipmaps = 2 },
65    },
66    subgroup = "tool",
67    order = "c[automated-construction]-x",
68    select = {
69      mode = "nothing",
70      border_color = { a = 0 },
71      cursor_box_type = "not-allowed",
72    },
73    alt_select = {
74      mode = "nothing",
75      border_color = { a = 0 },
76      cursor_box_type = "not-allowed",
77    },
78    stack_size = 1,
79    flags = { "only-in-cursor", "spawnable", "not-stackable" },
80    hidden = true,
81    draw_label_for_cursor_render = true,
82    mouse_cursor = "tl-tool-cursor",
83    send_pre_selection_events = true,
84  },
85  {
86    type = "mouse-cursor",
87    name = "tl-tool-cursor",
88    filename = "__Tapeline__/graphics/cursor/draw-cursor.png",
89    hot_pixel_x = 1,
90    hot_pixel_y = 1,
91  },
92  {
93    type = "shortcut",
94    name = "tl-get-tool",
95    order = "a[alt-mode]-b[copy]",
96    associated_control_input = "tl-get-tool",
97    action = "spawn-item",
98    item_to_spawn = "tl-tool",
99    icon = "__Tapeline__/graphics/shortcut/shortcut-x56.png",
100    icon_size = 56,
101    small_icon = "__Tapeline__/graphics/shortcut/shortcut-x24.png",
102    small_icon_size = 24,
103  },
104  {
105    type = "tips-and-tricks-item-category",
106    name = "tapeline",
107    order = "l-[tapeline]",
108  },
109  {
110    type = "tips-and-tricks-item",
111    name = "tl-introduction",
112    category = "tapeline",
113    order = "a",
114    is_title = true,
115    image = "__Tapeline__/graphics/tips-and-tricks/introduction.png",
116  },
117  {
118    type = "tips-and-tricks-item",
119    name = "tl-persistent",
120    category = "tapeline",
121    order = "b",
122    indent = 1,
123    dependencies = { "tl-introduction" },
124    trigger = { type = "dependencies-met" },
125    image = "__Tapeline__/graphics/tips-and-tricks/persistent.png",
126  },
127  {
128    type = "tips-and-tricks-item",
129    name = "tl-modes",
130    category = "tapeline",
131    order = "c",
132    indent = 1,
133    dependencies = { "tl-introduction" },
134    trigger = { type = "dependencies-met" },
135    image = "__Tapeline__/graphics/tips-and-tricks/modes.png",
136  },
137  {
138    type = "tips-and-tricks-item",
139    name = "tl-divisors",
140    category = "tapeline",
141    order = "d",
142    indent = 1,
143    dependencies = { "tl-introduction" },
144    trigger = { type = "dependencies-met" },
145    image = "__Tapeline__/graphics/tips-and-tricks/divisors.png",
146  },
147  {
148    type = "tips-and-tricks-item",
149    name = "tl-edit",
150    category = "tapeline",
151    order = "e",
152    indent = 1,
153    dependencies = { "tl-introduction" },
154    trigger = { type = "dependencies-met" },
155    image = "__Tapeline__/graphics/tips-and-tricks/edit.png",
156  },
157  {
158    type = "trivial-smoke",
159    name = "tl-empty-smoke",
160    animation = {
161      filename = data_util.empty_image,
162      size = { 1, 1 },
163      frame_count = 8,
164    },
165    duration = 1,
166  },
167})