FAForever / fa

Lua code for FAF
221 stars 228 forks source link

Improve details of warnings when map files are missing #6245

Closed lL1l1 closed 2 weeks ago

lL1l1 commented 3 weeks ago

Description of the proposed changes

Makes the warning that you get when a map's scenario file has incorrect map/save/script files defined more clear. Also fixes the error when that part of the code runs and tries to call non-existent methods with mapplayers and mappsize, which aren't used anywhere in the file.

Testing done on the proposed changes

Message before:

warning: No scenario map file defined
warning: Error running OnRelease script in <deleted object>: ...\fa\lua\ui\dialogs\mapselect.lua(429): attempt to call method `SetText' (a nil value)
         stack traceback:
            ...\fa\lua\ui\dialogs\mapselect.lua(429): in function `PreloadMap'
            ...\fa\lua\ui\dialogs\mapselect.lua(438): in function `OnClick'
            ...\fa\lua\ui\dialogs\mapselect.lua(491): in function `OnClick'
            ...\fa\lua\maui\button.lua(118): in function <...\fa\lua\maui\button.lua:112>

New message:

warning: Scenario file "/maps/adaptive_project_albus.v0001/project_albus_scenario.lua" expected map file "/maps/Project_Albus.v0002/Project_Albus.scmap" but it could not be found.
warning: Scenario file "/maps/adaptive_project_albus.v0001/project_albus_scenario.lua" expected save file "/maps/Project_Albus.v0002/Project_Albus_save.lua" but it could not be found.
warning: Scenario file "/maps/adaptive_project_albus.v0001/project_albus_scenario.lua" expected script file "/maps/Project_Albus.v0002/Project_Albus_script.lua" but it could not be found.

Checklist