diff --git a/VERSION b/VERSION index 3eefcb9..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.0.1 diff --git a/changelog.txt b/changelog.txt index 90d585c..58ca26b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 1.0.1 + Bugfixes: + - fix crash when renaming a site without a name tag (e.g., new site) + Changes: + - create sites with an empty string as a name tag instead of nil +--------------------------------------------------------------------------------------------------- Version: 1.0.0 Date: 2024-12-18 Bugfixes: diff --git a/info.json b/info.json index a2e8a7b..7bef594 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "YARM", - "version": "1.0.0", + "version": "1.0.1", "factorio_version": "2.0", "title": "YARM - Resource Monitor", "author": "Mithaldu (current maintainer) and Narc", diff --git a/resmon/click.lua b/resmon/click.lua index 00f824a..0c6a640 100644 --- a/resmon/click.lua +++ b/resmon/click.lua @@ -121,7 +121,7 @@ function handlers.YARM_rename_site(event) caption = { "YARM-site-rename-title", resmon.locale.site_display_name(site, format) }, direction = "horizontal" } - root.add { type = "textfield", name = "new_name" }.text = site.name_tag + root.add { type = "textfield", name = "new_name" }.text = site.name_tag or "" root.add { type = "button", name = "YARM_rename_cancel", caption = { "YARM-site-rename-cancel" }, style = "back_button" } root.add { type = "button", name = "YARM_rename_confirm", caption = { "YARM-site-rename-confirm" }, style = "confirm_button" } diff --git a/resmon/types.lua b/resmon/types.lua index 355d6e3..87c9cf8 100644 --- a/resmon/types.lua +++ b/resmon/types.lua @@ -51,7 +51,7 @@ function types_module.new_site(player, entity) is_summary = false, -- true for summary sites generated by resmon.sites.generate_summaries site_count = 0, -- nonzero only for summaries (see above), where it contains the number of sites being summarized index = 0, - name_tag = nil, -- Player-set name tag added to the site display name + name_tag = "", -- Player-set name tag added to the site display name added_at = game.tick, surface = entity.surface, ---@type LuaSurface force = player.force,