From b6de18ed5309304399a64393ff5b7d774ed6ab7a Mon Sep 17 00:00:00 2001 From: aka kautinkazu <81628831+chris1384@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:59:55 +0300 Subject: [PATCH 1/3] [editor] Fix editor_gui test panel Fixes: After testing a certain map with a gamemode, you are unable to test that map with the option anymore. --- [editor]/editor_gui/client/test.lua | 2 +- [editor]/editor_main/server/saveloadtest_server.lua | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[editor]/editor_gui/client/test.lua b/[editor]/editor_gui/client/test.lua index 07dc8f86c..8db53fe82 100644 --- a/[editor]/editor_gui/client/test.lua +++ b/[editor]/editor_gui/client/test.lua @@ -32,7 +32,7 @@ function quickTest() if tutorialVars.blockQuickTest then return end if lastTestGamemode == "" then lastTestGamemode = false end editor_main.dropElement() - triggerServerEvent ( "testResource",localPlayer, text ) + triggerServerEvent ( "testResource",localPlayer, lastTestGamemode ) unbindControl ( "toggle_test", "down", quickTest ) if tutorialVars.test then tutorialNext() end end diff --git a/[editor]/editor_main/server/saveloadtest_server.lua b/[editor]/editor_main/server/saveloadtest_server.lua index 2e4cc7b19..0a1582380 100644 --- a/[editor]/editor_main/server/saveloadtest_server.lua +++ b/[editor]/editor_main/server/saveloadtest_server.lua @@ -753,7 +753,11 @@ function beginTest(client,gamemodeName) resetMapInfo() setupMapSettings() disablePickups(false) - gamemodeName = gamemodeName or lastTestGamemodeName + + if gamemodeName == nil then + gamemodeName = lastTestGamemodeName + end + if ( gamemodeName ) then lastTestGamemodeName = gamemodeName set ( "*freeroam.spawnmapondeath", "false" ) @@ -785,6 +789,9 @@ function beginTest(client,gamemodeName) end g_in_test = "gamemode" else + if gamemodeName == false then + lastTestGamemodeName = gamemodeName + end if getResourceState(freeroamRes) ~= "running" and not startResource ( freeroamRes, true ) then restoreSettings() triggerClientEvent ( root, "saveloadtest_return", client, "test", false, false, From 38862c18b950281e9a35b977daf50597c590ebd5 Mon Sep 17 00:00:00 2001 From: aka kautinkazu <81628831+chris1384@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:19:59 +0300 Subject: [PATCH 2/3] reset lastGamemode on map open / new map --- [editor]/editor_main/server/saveloadtest_server.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/[editor]/editor_main/server/saveloadtest_server.lua b/[editor]/editor_main/server/saveloadtest_server.lua index 0a1582380..1013984cb 100644 --- a/[editor]/editor_main/server/saveloadtest_server.lua +++ b/[editor]/editor_main/server/saveloadtest_server.lua @@ -120,6 +120,8 @@ addEventHandler("newResource", root, actionList = {} currentActionIndex = 0 + + lastTestGamemodeName = nil end ) @@ -154,6 +156,8 @@ function handleOpenResource() actionList = {} currentActionIndex = 0 + lastTestGamemodeName = nil + triggerEvent("onMapOpened", mapContainer, openingResource) flattenTreeRuns = 0 triggerClientEvent(root, "saveLoadProgressBar", root, true) From 89c890d94739ccc57fc9ce2f0bdd2bd35274896e Mon Sep 17 00:00:00 2001 From: aka kautinkazu <81628831+chris1384@users.noreply.github.com> Date: Wed, 28 Aug 2024 22:03:07 +0300 Subject: [PATCH 3/3] reset gui lastGamemode on map open / new map felt like it needed --- [editor]/editor_gui/client/test.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/[editor]/editor_gui/client/test.lua b/[editor]/editor_gui/client/test.lua index 8db53fe82..136795caf 100644 --- a/[editor]/editor_gui/client/test.lua +++ b/[editor]/editor_gui/client/test.lua @@ -251,3 +251,11 @@ end function noDamageInBasicTest() cancelEvent() end + +addEventHandler ( "saveloadtest_return", root, + function ( command ) + if command == "new" or command == "open" then + lastTestGamemode = nil + end + end +)