z_mirror/TaskList

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

Caleb HeuerUse slash requires2b94de0

fix/blueprint-sandboxes-force
3.2 KiB104 linesraw
1local data_util = require("__flib__/data-util")
2
3data:extend({
4  { type = "custom-input", name = "tlst-toggle-gui", key_sequence = "CONTROL + T", action = "lua" },
5  { type = "custom-input", name = "tlst-new-task", key_sequence = "", action = "lua" },
6  { type = "custom-input", name = "tlst-linked-confirm-gui", key_sequence = "", linked_game_control = "confirm-gui" },
7  {
8    type = "shortcut",
9    name = "tlst-toggle-gui",
10    icon = { filename = "__TaskList__/graphics/tasks-dark-x32.png", size = 32, mipmap_count = 2 },
11    small_icon = { filename = "__TaskList__/graphics/tasks-dark-x24.png", size = 24, mipmap_count = 2 },
12    disabled_icon = { filename = "__TaskList__/graphics/tasks-light-x32.png", size = 32, mipmap_count = 2 },
13    disabled_small_icon = { filename = "__TaskList__/graphics/tasks-light-x24.png", size = 24, mipmap_count = 2 },
14    toggleable = true,
15    associated_control_input = "tlst-toggle-gui",
16    action = "lua",
17  },
18  {
19    type = "shortcut",
20    name = "tlst-new-task",
21    icon = { filename = "__TaskList__/graphics/new-task-dark-x32.png", size = 32, mipmap_count = 2 },
22    small_icon = { filename = "__TaskList__/graphics/new-task-dark-x24.png", size = 24, mipmap_count = 2 },
23    disabled_icon = { filename = "__TaskList__/graphics/new-task-light-x32.png", size = 32, mipmap_count = 2 },
24    disabled_small_icon = { filename = "__TaskList__/graphics/new-task-light-x24.png", size = 24, mipmap_count = 2 },
25    toggleable = true,
26    associated_control_input = "tlst-new-task",
27    action = "lua",
28  },
29  {
30    type = "sprite",
31    name = "tlst_arrow_up",
32    filename = "__TaskList__/graphics/tool-icons.png",
33    position = { 0, 0 },
34    size = 32,
35    mipmap_count = 2,
36    flags = { "icon" },
37  },
38  {
39    type = "sprite",
40    name = "tlst_arrow_down",
41    filename = "__TaskList__/graphics/tool-icons.png",
42    position = { 0, 32 },
43    size = 32,
44    mipmap_count = 2,
45    flags = { "icon" },
46  },
47  {
48    type = "sprite",
49    name = "tlst_arrow_right",
50    filename = "__TaskList__/graphics/tool-icons.png",
51    position = { 0, 64 },
52    size = 32,
53    mipmap_count = 2,
54    flags = { "icon" },
55  },
56})
57
58local styles = data.raw["gui-style"]["default"]
59
60styles.tlst_description_frame = {
61  type = "frame_style",
62  padding = 6,
63  top_padding = 4,
64  graphical_set = {
65    base = {
66      position = { 85, 0 },
67      corner_size = 8,
68      center = { position = { 42, 8 }, width = 1, height = 1 },
69      draw_type = "outer",
70    },
71    shadow = default_inner_shadow,
72  },
73}
74
75styles.tlst_red_dialog_button = {
76  type = "button_style",
77  parent = "dialog_button",
78  default_graphical_set = styles.red_button.default_graphical_set,
79  hovered_graphical_set = styles.red_button.hovered_graphical_set,
80  clicked_graphical_set = styles.red_button.clicked_graphical_set,
81}
82
83styles.tlst_tasks_scroll_pane = {
84  type = "scroll_pane_style",
85  parent = "flib_naked_scroll_pane",
86  top_padding = 8,
87  bottom_padding = 8,
88  vertical_flow_style = {
89    type = "vertical_flow_style",
90  },
91}
92
93styles.tlst_task_item_flow = {
94  type = "horizontal_flow_style",
95  height = 24,
96  vertical_align = "center",
97}
98
99styles.tlst_new_task_label = {
100  type = "label_style",
101  font = "default-semibold",
102  font_color = { 128, 206, 240 },
103  hovered_font_color = { 154, 250, 255 },
104}