From 4cf1762bdb8a0e7511486e0657fae3a9222579b4 Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Tue, 14 Apr 2026 20:07:19 +0300 Subject: [PATCH 1/2] Update copyright to use dynamic year - Extract current year from buildNum instead of hardcoding - Fix start year from 2020 to 2009 to match original Corona SDK release year (same as in the Console copyright message) --- main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 5a8f41d..a4cd4c1 100644 --- a/main.lua +++ b/main.lua @@ -824,8 +824,10 @@ addProjectButtons() -- Copyright Notice ------------------- +-- For debug builds, currentYear will show up as 2100 +local currentYear = buildNum:sub(1,4) -local copyright1 = newRetinaText("© 2020-2021 Solar2D ", 34, 675, fontSizeCopyright) +local copyright1 = newRetinaText("© 2009-" .. currentYear .. " Solar2D ", 34, 675, fontSizeCopyright) copyright1:translate( copyright1.contentWidth*0.5, 0 ) copyright1:setFillColor( unpack(textColorCopyright) ) From 00cb96e1a36346ca95d767abedc890515fd7f3ec Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Wed, 15 Apr 2026 18:16:15 +0300 Subject: [PATCH 2/2] simulator: add optional listName to config.lua Simulator only: Users can now define listName property inside config.lua's application table. Handles missing and malformed config.lua gracefully. If listName property is not defined, then Simulator falls back to default behaviour. --- main.lua | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index a4cd4c1..5953fa3 100644 --- a/main.lua +++ b/main.lua @@ -105,6 +105,43 @@ local function limitDisplayLength(len, str, font, fontSize, isPath) return str .. (str ~= origStr and "…" or "") end +-- Load and parse config.lua for optional listName property +local function getProjectNameFromConfig(projectDir) + -- Strip and replace "main.lua" from the end of projectDir + local configPath = projectDir:sub(1,-9) .. "config.lua" + + -- Handle missing or malformed config.lua gracefully + + if lfs.attributes(configPath) == nil then + return nil + end + + local success, listName = pcall(function() + -- Isolated write scope so config.lua's globals don't leak into ours + local configEnv = {} + setmetatable(configEnv, {__index = _G}) + + local configChunk = loadfile(configPath) + if not configChunk then + return nil + end + + setfenv(configChunk, configEnv) + configChunk() + + if type(configEnv.application) == "table" and type(configEnv.application.listName) == "string" then + return configEnv.application.listName + end + + return nil + end) + + if success then + return listName + else + return nil + end +end -- Functions to enable and remove pointers @@ -1109,12 +1146,18 @@ function showRecents() if projects[i] then local projectgroup = display.newGroup() - local projectName = projects[i].formattedString local projectDir = projects[i].fullURLString + local projectName = getProjectNameFromConfig(projectDir) if platform == "Win" then projectDir = projectDir .. "\\..\\." end + + -- Fall back to default projectName if config.lua doesn't have application.listName + if not projectName then + projectName = projects[i].formattedString + end + local icon = nil if projectName == nil or projectName == "" then