diff --git a/mods_2.0/014_notice-me-senpai/changelog.txt b/mods_2.0/014_notice-me-senpai/changelog.txt index e1f0453f..f1e42489 100644 --- a/mods_2.0/014_notice-me-senpai/changelog.txt +++ b/mods_2.0/014_notice-me-senpai/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.0.9 +Date: 2024. 12. 17 + Info: + - Make the colors configurable for colorblind people +--------------------------------------------------------------------------------------------------- Version: 1.0.8 Date: 2024. 11. 18 Info: diff --git a/mods_2.0/014_notice-me-senpai/control.lua b/mods_2.0/014_notice-me-senpai/control.lua index 86148a9e..0b258787 100644 --- a/mods_2.0/014_notice-me-senpai/control.lua +++ b/mods_2.0/014_notice-me-senpai/control.lua @@ -73,6 +73,12 @@ local function playerdata_create(player_index) redraw = false, alt_mode = player.game_view_settings.show_entity_info, + + colormap = { + green = settings.get_player_settings(player.index)["notice-me-senpai--green" ].value, + yellow = settings.get_player_settings(player.index)["notice-me-senpai--yellow"].value, + red = settings.get_player_settings(player.index)["notice-me-senpai--red" ].value, + } } end @@ -149,13 +155,20 @@ local function position_key(position) return string.format("[%g, %g]", position.x, position.y) end +-- kept as fallback for pre 1.0.9 +local colors = { + green = {0.0, 0.9, 0.0, 1}, + yellow = {0.9, 0.9, 0.0, 1}, + red = {0.9, 0.0, 0.0, 1}, +} + local function get_color_for_tile_key(playerdata, tile_key) if playerdata.green_positions[tile_key] then - return {0, 0.9, 0, 1} -- green + return playerdata.colormap["green"] or colors["green"] elseif playerdata.yellow_positions[tile_key] then - return {0.9, 0.9, 0, 1} -- yellow + return playerdata.colormap["yellow"] or colors["yellow"] else - return {0.9, 0, 0, 1} -- red + return playerdata.colormap["red"] or colors["red"] end end diff --git a/mods_2.0/014_notice-me-senpai/info.json b/mods_2.0/014_notice-me-senpai/info.json index 7863016c..75c4f2b5 100644 --- a/mods_2.0/014_notice-me-senpai/info.json +++ b/mods_2.0/014_notice-me-senpai/info.json @@ -3,7 +3,7 @@ "title": "Notice me senpai", "description": "Highlights resources with no drill on them yet when holding a miner.", - "version": "1.0.8", + "version": "1.0.9", "author": "Quezler", "factorio_version": "2.0", diff --git a/mods_2.0/014_notice-me-senpai/locale/en/strings.cfg b/mods_2.0/014_notice-me-senpai/locale/en/strings.cfg new file mode 100644 index 00000000..3fc1187c --- /dev/null +++ b/mods_2.0/014_notice-me-senpai/locale/en/strings.cfg @@ -0,0 +1,4 @@ +[mod-setting-name] +notice-me-senpai--green=Green +notice-me-senpai--yellow=Yellow +notice-me-senpai--red=Red diff --git a/mods_2.0/014_notice-me-senpai/settings.lua b/mods_2.0/014_notice-me-senpai/settings.lua new file mode 100644 index 00000000..0cde5260 --- /dev/null +++ b/mods_2.0/014_notice-me-senpai/settings.lua @@ -0,0 +1,22 @@ +local mod_prefix = "notice-me-senpai--" + +data:extend({ + { + type = "color-setting", + name = mod_prefix .. "green", + setting_type = "runtime-per-user", + default_value = {0.0, 0.9, 0.0, 1}, + }, + { + type = "color-setting", + name = mod_prefix .. "yellow", + setting_type = "runtime-per-user", + default_value = {0.9, 0.9, 0.0, 1}, + }, + { + type = "color-setting", + name = mod_prefix .. "red", + setting_type = "runtime-per-user", + default_value = {0.9, 0.0, 0.0, 1}, + }, +}) diff --git a/mods_2.0/028_agricultural-tower-placement-helper/changelog.txt b/mods_2.0/028_agricultural-tower-placement-helper/changelog.txt index b1a54bd5..37d9f35f 100644 --- a/mods_2.0/028_agricultural-tower-placement-helper/changelog.txt +++ b/mods_2.0/028_agricultural-tower-placement-helper/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.0.3 +Date: 2024. 12. 17 + Info: + - Make the colors configurable for colorblind people +--------------------------------------------------------------------------------------------------- Version: 1.0.2 Date: 2024. 11. 15 Info: diff --git a/mods_2.0/028_agricultural-tower-placement-helper/control.lua b/mods_2.0/028_agricultural-tower-placement-helper/control.lua index 542cd0f2..84e66ac7 100644 --- a/mods_2.0/028_agricultural-tower-placement-helper/control.lua +++ b/mods_2.0/028_agricultural-tower-placement-helper/control.lua @@ -91,6 +91,12 @@ script.on_event(defines.events.on_player_cursor_stack_changed, function(event) tile_render_objects = {}, alt_mode = player.game_view_settings.show_entity_info, + + colormap = { + green = settings.get_player_settings(player.index)["agricultural-tower-placement-helper--green" ].value, + yellow = settings.get_player_settings(player.index)["agricultural-tower-placement-helper--yellow"].value, + red = settings.get_player_settings(player.index)["agricultural-tower-placement-helper--red" ].value, + } } Handler.tick_player(event) @@ -122,8 +128,7 @@ script.on_event(defines.events.on_player_toggled_alt_mode, function(event) end end) --- - +-- kept as fallback for pre 1.0.3 local colors = { green = {0.0, 0.9, 0.0, 1}, yellow = {0.9, 0.9, 0.0, 1}, @@ -133,36 +138,36 @@ local colors = { -- todo: generate from prototypes. local tile_name_to_color = { -- currently plantable for yumako - ["natural-yumako-soil" ] = colors.green, - ["artificial-yumako-soil"] = colors.green, - ["overgrowth-yumako-soil"] = colors.green, + ["natural-yumako-soil" ] = "green", + ["artificial-yumako-soil"] = "green", + ["overgrowth-yumako-soil"] = "green", -- currently plantable for jellynut - ["natural-jellynut-soil" ] = colors.green, - ["artificial-jellynut-soil"] = colors.green, - ["overgrowth-jellynut-soil"] = colors.green, + ["natural-jellynut-soil" ] = "green", + ["artificial-jellynut-soil"] = "green", + ["overgrowth-jellynut-soil"] = "green", -- future plantable for yumako - ["wetland-light-green-slime"] = colors.red, - ["wetland-green-slime" ] = colors.red, - ["wetland-yumako" ] = colors.yellow, -- artificial soil - ["lowland-olive-blubber" ] = colors.red, - ["lowland-olive-blubber-2" ] = colors.red, - ["lowland-olive-blubber-3" ] = colors.red, - ["lowland-brown-blubber" ] = colors.red, - ["lowland-pale-green" ] = colors.red, + ["wetland-light-green-slime"] = "red", + ["wetland-green-slime" ] = "red", + ["wetland-yumako" ] = "yellow", -- artificial soil + ["lowland-olive-blubber" ] = "red", + ["lowland-olive-blubber-2" ] = "red", + ["lowland-olive-blubber-3" ] = "red", + ["lowland-brown-blubber" ] = "red", + ["lowland-pale-green" ] = "red", -- future plantable for jellynut - ["wetland-pink-tentacle"] = colors.red, - ["wetland-red-tentacle" ] = colors.red, - ["wetland-jellynut" ] = colors.yellow, -- artificial soil - ["lowland-red-vein" ] = colors.red, - ["lowland-red-vein-2" ] = colors.red, - ["lowland-red-vein-3" ] = colors.red, - ["lowland-red-vein-4" ] = colors.red, - ["lowland-red-vein-dead"] = colors.red, - ["lowland-red-infection"] = colors.red, - ["lowland-cream-red" ] = colors.red, + ["wetland-pink-tentacle"] = "red", + ["wetland-red-tentacle" ] = "red", + ["wetland-jellynut" ] = "yellow", -- artificial soil + ["lowland-red-vein" ] = "red", + ["lowland-red-vein-2" ] = "red", + ["lowland-red-vein-3" ] = "red", + ["lowland-red-vein-4" ] = "red", + ["lowland-red-vein-dead"] = "red", + ["lowland-red-infection"] = "red", + ["lowland-cream-red" ] = "red", } local tile_names = {} @@ -217,7 +222,7 @@ function Handler.tick_player(event) target = {tile.position.x + 0.5, tile.position.y + 0.5}, radius = playerdata.alt_mode and 0.2 or 0.1, - color = color, + color = playerdata.colormap[color] or colors[color], filled = true, players = {playerdata.player_index}, diff --git a/mods_2.0/028_agricultural-tower-placement-helper/info.json b/mods_2.0/028_agricultural-tower-placement-helper/info.json index 355f20b8..289bc091 100644 --- a/mods_2.0/028_agricultural-tower-placement-helper/info.json +++ b/mods_2.0/028_agricultural-tower-placement-helper/info.json @@ -3,7 +3,7 @@ "title": "Agricultural tower placement helper", "description": "Shows you the difference between tiles that require artificial soil vs (yet to unlock) overgrowth soil.", - "version": "1.0.2", + "version": "1.0.3", "author": "Quezler", "factorio_version": "2.0", diff --git a/mods_2.0/028_agricultural-tower-placement-helper/locale/en/strings.cfg b/mods_2.0/028_agricultural-tower-placement-helper/locale/en/strings.cfg new file mode 100644 index 00000000..4fb504b9 --- /dev/null +++ b/mods_2.0/028_agricultural-tower-placement-helper/locale/en/strings.cfg @@ -0,0 +1,4 @@ +[mod-setting-name] +agricultural-tower-placement-helper--green=Green +agricultural-tower-placement-helper--yellow=Yellow +agricultural-tower-placement-helper--red=Red diff --git a/mods_2.0/028_agricultural-tower-placement-helper/settings.lua b/mods_2.0/028_agricultural-tower-placement-helper/settings.lua new file mode 100644 index 00000000..61633b41 --- /dev/null +++ b/mods_2.0/028_agricultural-tower-placement-helper/settings.lua @@ -0,0 +1,22 @@ +local mod_prefix = "agricultural-tower-placement-helper--" + +data:extend({ + { + type = "color-setting", + name = mod_prefix .. "green", + setting_type = "runtime-per-user", + default_value = {0.0, 0.9, 0.0, 1}, + }, + { + type = "color-setting", + name = mod_prefix .. "yellow", + setting_type = "runtime-per-user", + default_value = {0.9, 0.9, 0.0, 1}, + }, + { + type = "color-setting", + name = mod_prefix .. "red", + setting_type = "runtime-per-user", + default_value = {0.9, 0.0, 0.0, 1}, + }, +})