z_mirror/TaskList

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

raiguardStart adding task details GUIbbcaa7a

task-details-gui
3.0 KiB93 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  bottom_padding = 6,
63  left_padding = 8,
64  right_padding = 8,
65  top_padding = 4,
66  graphical_set = {
67    base = {
68      position = { 85, 0 },
69      corner_size = 8,
70      center = { position = { 42, 8 }, width = 1, height = 1 },
71      draw_type = "outer",
72    },
73    shadow = default_inner_shadow,
74  },
75}
76
77styles.tlst_red_dialog_button = {
78  type = "button_style",
79  parent = "dialog_button",
80  default_graphical_set = styles.red_button.default_graphical_set,
81  hovered_graphical_set = styles.red_button.hovered_graphical_set,
82  clicked_graphical_set = styles.red_button.clicked_graphical_set,
83}
84
85styles.tlst_tasks_scroll_pane = {
86  type = "scroll_pane_style",
87  parent = "flib_naked_scroll_pane",
88  top_padding = 2,
89  vertical_flow_style = {
90    type = "vertical_flow_style",
91    vertical_spacing = 0,
92  },
93}