Skip to content

Commit

Permalink
Factorio 0.16 update
Browse files Browse the repository at this point in the history
- simple stuff:
    - most styles named `XXX_style` now named `XXX`
    - `description_flow_style` seems to have disappeared, but I was just
    making my own, so...
        - replaced with `YARM_buttons_v` and `*_h`
            - for some reason, I can't just use a single `flow_style`,
            but have to specify `horizontal_*` or `vertical_*`?
    - table `colspan` now named `column_count`
    - key "icon_size" not found in property tree at
    ROOT.container.resource-monitor
        - so added icon_size = 32 to everyone that didn't have it

Easier than the EvoGUI update...
  • Loading branch information
narc0tiq committed Dec 14, 2017
1 parent 60f0b48 commit 1151c89
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.206
0.7.301
4 changes: 2 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "{{MOD_NAME}}",
"version": "{{VERSION}}",
"factorio_version": "0.15",
"factorio_version": "0.16",
"title": "YARM - Resource Monitor",
"author": "Octav 'narc' Sandulescu, based on work by drs, jorgenRe, and L0771",
"homepage": "https://github.com/narc0tiq/YARM",
"dependencies": ["base >= 0.15.0"],
"dependencies": ["base >= 0.16.1"],
"description": "This mod helps you to keep track of your mining sites."
}
22 changes: 16 additions & 6 deletions prototypes/prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ data:extend(
type = "item",
name = "resource-monitor",
icon = "__{{MOD_NAME}}__/graphics/resource-monitor.png",
icon_size = 32,
flags = {"goes-to-quickbar"},
damage_radius = 5,
subgroup = "tool",
Expand All @@ -16,6 +17,7 @@ data:extend(
type = "container",
name = "resource-monitor",
icon = "__{{MOD_NAME}}__/graphics/resource-monitor.png",
icon_size = 32,
flags = {"placeable-neutral", "player-creation"},
minable = {mining_time = 1, result = "resource-monitor"},
max_health = 100,
Expand Down Expand Up @@ -73,6 +75,7 @@ data:extend(
name = "rm_overlay",
flags = {"placeable-neutral", "player-creation", "not-repairable"},
icon = "__{{MOD_NAME}}__/graphics/rm_Overlay.png",
icon_size = 32,

max_health = 1,
order = 'z[resource-monitor]',
Expand Down Expand Up @@ -157,7 +160,7 @@ local default_gui = data.raw["gui-style"].default

local red_label = {
type = "label_style",
parent = "label_style",
parent = "label",
font_color = {r=1, g=0.2, b=0.2}
}
default_gui.YARM_err_label = red_label
Expand Down Expand Up @@ -185,7 +188,7 @@ end

default_gui.YARM_button_with_icon = {
type = "button_style",
parent = "slot_button_style",
parent = "slot_button",

scalable = true,

Expand Down Expand Up @@ -317,12 +320,19 @@ default_gui.YARM_site_table = {
vertical_spacing = 1,
}

default_gui.YARM_buttons = {
type = "flow_style",
parent = "description_flow_style",

default_gui.YARM_buttons_h = {
type = "horizontal_flow_style",
parent = "horizontal_flow",
horizontal_spacing = 1,
vertical_spacing = 5,
top_padding = 4,
}


default_gui.YARM_buttons_v = {
type = "vertical_flow_style",
parent = "vertical_flow",
horizontal_spacing = 1,
vertical_spacing = 5,
top_padding = 4,
}
8 changes: 4 additions & 4 deletions resmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -520,20 +520,20 @@ function resmon.update_ui(player)
root = player.gui.left.add{type="frame",
name="YARM_root",
direction="horizontal",
style="outer_frame_style"}
style="outer_frame"}

local buttons = root.add{type="flow",
name="buttons",
direction="vertical",
style="YARM_buttons"}
style="YARM_buttons_v"}

buttons.add{type="button", name="YARM_expando", style="YARM_expando_short"}
end

if root.sites and root.sites.valid then
root.sites.destroy()
end
local sites_gui = root.add{type="table", colspan=7, name="sites", style="YARM_site_table"}
local sites_gui = root.add{type="table", column_count=7, name="sites", style="YARM_site_table"}

if force_data and force_data.ore_sites then
for site in ascending_by_ratio(force_data.ore_sites) do
Expand Down Expand Up @@ -574,7 +574,7 @@ function resmon.update_ui(player)


local site_buttons = sites_gui.add{type="flow", name="YARM_site_buttons_"..site.name,
direction="horizontal", style="YARM_buttons"}
direction="horizontal", style="YARM_buttons_h"}

if site.deleting_since then
site_buttons.add{type="button",
Expand Down

0 comments on commit 1151c89

Please sign in to comment.