Skip to content

Commit

Permalink
Fix failing test and update formatting
Browse files Browse the repository at this point in the history
Tests were failing due to udpates to (downloaded) factorio linter file.

Formatting changed due to update of Lua Language Server
  • Loading branch information
veger committed Jul 2, 2022
1 parent e596644 commit 9061327
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 291 deletions.
10 changes: 5 additions & 5 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ local function on_init()

for index, player in pairs(game.players) do
-- initialize player(s) when mod is loaded into existing game
TLBE.Config.reload({player_index = index})
TLBE.Config.reload({ player_index = index })

player.print({"mod-loaded"}, {r = 1, g = 0.5, b = 0})
player.print({"mod-loaded2"})
player.print({ "mod-loaded" }, { r = 1, g = 0.5, b = 0 })
player.print({ "mod-loaded2" })
end

local baseBBox = TLBE.Main.get_base_bbox()
Expand All @@ -33,7 +33,7 @@ local function on_player_created(event)
-- Initialize playerSettings
TLBE.Config.reload(event)

game.players[event.player_index].print({"mod-loaded2"}, {r = 1, g = 0.5, b = 0})
game.players[event.player_index].print({ "mod-loaded2" }, { r = 1, g = 0.5, b = 0 })
end

local function on_tick()
Expand All @@ -56,7 +56,7 @@ script.on_event(defines.events.on_surface_created, TLBE.GUI.onSurfacesUpdated)
script.on_event(defines.events.on_surface_imported, TLBE.GUI.onSurfacesUpdated)
script.on_event(defines.events.on_surface_renamed, TLBE.GUI.onSurfaceChanged)
script.on_event(defines.events.on_built_entity, TLBE.Main.entity_built,
{{filter = "vehicle", invert = true}})
{ { filter = "vehicle", invert = true } })
script.on_event(defines.events.on_rocket_launch_ordered, TLBE.Main.rocket_launch)
script.on_event(defines.events.on_rocket_launched, TLBE.Main.rocket_launched)

Expand Down
28 changes: 14 additions & 14 deletions prototypes/shortcuts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ data:extend(
toggleable = true,
order = "a[mod]-tlbe",
action = "lua",
localised_name = {"shortcut.tlbe"},
localised_name = { "shortcut.tlbe" },
associated_control_input = "tlbe-main-window-toggle",
icon = {
-- tlbe-logo
filename = "__TLBE__/graphics/logo.png",
priority = "extra-high-no-scale",
width = 64,
height = 50,
position = {0, 0},
position = { 0, 0 },
scale = 1,
flags = {"icon"}
flags = { "icon" }
},
small_icon = {
-- tlbe-logo
filename = "__TLBE__/graphics/logo.png",
priority = "extra-high-no-scale",
width = 64,
height = 50,
position = {0, 0},
position = { 0, 0 },
scale = 1,
flags = {"icon"}
flags = { "icon" }
},
disabled_small_icon = {
-- tlbe-logo-white
filename = "__TLBE__/graphics/logo.png",
priority = "extra-high-no-scale",
width = 64,
height = 50,
position = {65, 0},
position = { 65, 0 },
scale = 1,
flags = {"icon"}
flags = { "icon" }
}
},
{
Expand All @@ -58,37 +58,37 @@ data:extend(
toggleable = true,
order = "a[mod]-tlbe",
action = "lua",
localised_name = {"shortcut.tlbe-pause"},
localised_name = { "shortcut.tlbe-pause" },
associated_control_input = "tlbe-pause-cameras",
icon = {
-- tlbe-logo
filename = "__TLBE__/graphics/pause-camera.png",
priority = "extra-high-no-scale",
width = 64,
height = 64,
position = {0, 0},
position = { 0, 0 },
scale = 1,
flags = {"icon"}
flags = { "icon" }
},
small_icon = {
-- tlbe-logo
filename = "__TLBE__/graphics/pause-camera.png",
priority = "extra-high-no-scale",
width = 64,
height = 64,
position = {0, 0},
position = { 0, 0 },
scale = 1,
flags = {"icon"}
flags = { "icon" }
},
disabled_small_icon = {
-- tlbe-logo-white
filename = "__TLBE__/graphics/pause-camera.png",
priority = "extra-high-no-scale",
width = 64,
height = 50,
position = {65, 0},
position = { 65, 0 },
scale = 1,
flags = {"icon"}
flags = { "icon" }
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions prototypes/sprites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ data:extend(
priority = "extra-high-no-scale",
width = 64,
height = 50,
position = {0, 0},
position = { 0, 0 },
scale = 0.5,
flags = {"gui-icon"}
flags = { "gui-icon" }
},
{
type = "sprite",
Expand All @@ -19,9 +19,9 @@ data:extend(
priority = "extra-high-no-scale",
width = 64,
height = 50,
position = {65, 0},
position = { 65, 0 },
scale = 0.5,
flags = {"gui-icon"}
flags = { "gui-icon" }
},
{
type = "sprite",
Expand All @@ -30,9 +30,9 @@ data:extend(
priority = "extra-high-no-scale",
width = 64,
height = 64,
position = {0, 0},
position = { 0, 0 },
scale = 0.5,
flags = {"gui-icon"}
flags = { "gui-icon" }
},
{
type = "sprite",
Expand All @@ -43,7 +43,7 @@ data:extend(
height = 32,
mipmap_count = 2,
scale = 0.5,
flags = {"gui-icon"}
flags = { "gui-icon" }
},
{
type = "sprite",
Expand All @@ -53,7 +53,7 @@ data:extend(
width = 32,
height = 32,
mipmap_count = 2,
flags = {"gui-icon"}
flags = { "gui-icon" }
}
}
)
66 changes: 33 additions & 33 deletions prototypes/styles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local tab_width = 560
-- 'borrowed' from core
local function default_glow(tint_value, scale_value)
return {
position = {200, 128},
position = { 200, 128 },
corner_size = 8,
tint = tint_value,
scale = scale_value,
Expand All @@ -20,7 +20,7 @@ end

local function rounded_corners_glow(tint_value)
return {
position = {240, 783},
position = { 240, 783 },
corner_size = 16,
tint = tint_value,
top_outer_border_shift = 4,
Expand All @@ -31,8 +31,8 @@ local function rounded_corners_glow(tint_value)
}
end

local red_button_glow_color = {254, 90, 90, 128}
local default_dirt_color = {15, 7, 3, 100}
local red_button_glow_color = { 254, 90, 90, 128 }
local default_dirt_color = { 15, 7, 3, 100 }
local default_dirt = default_glow(default_dirt_color, 0.5)
local textbox_dirt = rounded_corners_glow(default_dirt_color)

Expand All @@ -57,7 +57,7 @@ default_gui["tlbe_fancy_list_box_item_selected"] = {
type = "frame_style",
parent = "tlbe_fancy_list_box_item",
graphical_set = {
base = {position = {34, 17}, corner_size = 8}
base = { position = { 34, 17 }, corner_size = 8 }
}
}

Expand Down Expand Up @@ -110,13 +110,13 @@ default_gui["tlbe_frame_action_button_selected"] = {
parent = "frame_action_button",
-- From frame_action_button.selected_graphical_set
default_graphical_set = {
base = {position = {272, 169}, corner_size = 8},
shadow = {position = {440, 24}, corner_size = 8, draw_type = "outer"}
base = { position = { 272, 169 }, corner_size = 8 },
shadow = { position = { 440, 24 }, corner_size = 8, draw_type = "outer" }
},
-- From frame_action_button.selected_hovered_graphical_set
hovered_graphical_set = {
base = {position = {369, 17}, corner_size = 8},
shadow = {position = {440, 24}, corner_size = 8, draw_type = "outer"}
base = { position = { 369, 17 }, corner_size = 8 },
shadow = { position = { 440, 24 }, corner_size = 8, draw_type = "outer" }
}
}

Expand All @@ -125,12 +125,12 @@ default_gui["tlbe_tool_button_selected"] = {
parent = "tool_button",
-- From button.selected_graphical_set
default_graphical_set = {
base = {position = {225, 17}, corner_size = 8},
base = { position = { 225, 17 }, corner_size = 8 },
shadow = default_dirt
},
-- From button.selected_hovered_graphical_set
hovered_graphical_set = {
base = {position = {369, 17}, corner_size = 8},
base = { position = { 369, 17 }, corner_size = 8 },
shadow = default_dirt
}
}
Expand Down Expand Up @@ -162,16 +162,16 @@ default_gui["tble_tracker_add_dropdown"] = {
-- Default button that glows red on hover/select
default_gui["tlbe_tracker_remove_button"] = {
type = "button_style",
size = {15, 28}, -- extra height to align (more) nicely with order buttons
size = { 15, 28 }, -- extra height to align (more) nicely with order buttons
parent = "tlbe_fancy_list_box_button",
-- from red_button
hovered_graphical_set = {
base = {position = {170, 17}, corner_size = 8},
base = { position = { 170, 17 }, corner_size = 8 },
shadow = default_dirt,
glow = default_glow(red_button_glow_color, 0.5)
},
clicked_graphical_set = {
base = {position = {187, 17}, corner_size = 8},
base = { position = { 187, 17 }, corner_size = 8 },
shadow = default_dirt
}
}
Expand All @@ -186,12 +186,12 @@ default_gui["tlbe_tracker_button_selected"] = {
parent = "tlbe_fancy_list_box_button",
-- From button.selected_graphical_set
default_graphical_set = {
base = {position = {225, 17}, corner_size = 8},
base = { position = { 225, 17 }, corner_size = 8 },
shadow = default_dirt
},
-- From button.selected_hovered_graphical_set
hovered_graphical_set = {
base = {position = {369, 17}, corner_size = 8},
base = { position = { 369, 17 }, corner_size = 8 },
shadow = default_dirt
}
}
Expand All @@ -201,72 +201,72 @@ default_gui["tlbe_tracker_button_red"] = {
parent = "tlbe_fancy_list_box_button",
-- From red_button
default_graphical_set = {
base = {position = {136, 17}, corner_size = 8},
base = { position = { 136, 17 }, corner_size = 8 },
shadow = default_dirt
},
hovered_graphical_set = {
base = {position = {170, 17}, corner_size = 8},
base = { position = { 170, 17 }, corner_size = 8 },
shadow = default_dirt,
glow = default_glow(red_button_glow_color, 0.5)
},
clicked_graphical_set = {
base = {position = {187, 17}, corner_size = 8},
base = { position = { 187, 17 }, corner_size = 8 },
shadow = default_dirt
},
disabled_graphical_set = {
base = {position = {153, 17}, corner_size = 8},
base = { position = { 153, 17 }, corner_size = 8 },
shadow = default_dirt
}
}

default_gui["tlbe_order_up_button"] = {
type = "button_style",
size = {12, 12},
size = { 12, 12 },
-- from column_ordering_ascending_button_style
default_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-active.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
},
hovered_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-hover.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
},
clicked_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-active.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
},
disabled_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-white.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
}
}

default_gui["tlbe_order_down_button"] = {
type = "button_style",
size = {12, 12},
size = { 12, 12 },
-- from column_ordering_descending_button_style
default_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-active.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
},
hovered_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-hover.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
},
clicked_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-active.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
},
disabled_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-white.png",
size = {16, 16},
size = { 16, 16 },
scale = 0.5
}
}
Expand Down Expand Up @@ -303,19 +303,19 @@ default_gui["tlbe_config_half_width_textfield_invalid"] = {
parent = "tlbe_config_half_width_textfield",
-- from invalid_value_textfield
default_background = {
base = {position = {0, 913}, corner_size = 8},
base = { position = { 0, 913 }, corner_size = 8 },
shadow = textbox_dirt
},
active_background = {
base = {position = {0, 913}, corner_size = 8},
base = { position = { 0, 913 }, corner_size = 8 },
shadow = textbox_dirt
}
}

-- aligns 2 tlbe_config_half_width_textfield styles textfields with a single tlbe_config_textfield
default_gui["tlbe_config_half_width_label"] = {
type = "label_style",
size = {12, 28}, -- textbox height
size = { 12, 28 }, -- textbox height
horizontal_align = "center",
vertical_align = "center"
}
Loading

0 comments on commit 9061327

Please sign in to comment.