added comments

This commit is contained in:
Chr1Z93 2023-04-16 23:19:51 +02:00
parent 1e641968a2
commit 4fe52a4856

View File

@ -1040,17 +1040,15 @@ function titleSplash(scenarioName)
end end
--------------------------------------------------------- ---------------------------------------------------------
-- Update Notification related functionality -- Update notification related functionality
--------------------------------------------------------- ---------------------------------------------------------
-- grabs the latest mod version and release notes from GitHub -- grabs the latest mod version and release notes from GitHub (called onLoad())
-- this is called onLoad()
function getModVersion() function getModVersion()
WebRequest.get(SOURCE_REPO .. '/modversion.json', compareVersion) WebRequest.get(SOURCE_REPO .. '/modversion.json', compareVersion)
end end
-- compares the modversion with GitHub and reports if a new version is available -- compares the modversion with GitHub and possibly shows the update notification
-- this is called as callback_function from getModVersion()
function compareVersion(request) function compareVersion(request)
if request.is_error then if request.is_error then
log(request.error) log(request.error)
@ -1106,6 +1104,7 @@ end
-- close / don't show again buttons on the XML use this -- close / don't show again buttons on the XML use this
function onClick_notification(_, parameter) function onClick_notification(_, parameter)
if parameter == "dontNotify" then if parameter == "dontNotify" then
-- this variable tracks if "don't show again" was pressed for a version before
dontNotify[modMeta["latestVersion"]] = true dontNotify[modMeta["latestVersion"]] = true
elseif parameter == "details" then elseif parameter == "details" then
UI.show("releaseNotes") UI.show("releaseNotes")