Skip to content

Commit e3a39f1

Browse files
Merge pull request #1230 from EOS-Contrib/eosu-883-Fix-multi-deployment-selection
Bug: Fix deployment selection when multiple deployments exist (EOSU-883)
2 parents 3de98e6 + d0e173d commit e3a39f1

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Assets/Plugins/Source/Editor/EditorWindows/EOSSettingsWindow.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,10 @@ private void Save()
254254
_productConfigEditor.Save();
255255

256256
//Update deployment in current platform
257-
if (ProductConfig.Get<ProductConfig>().Environments.TryGetFirstDefinedNamedDeployment(out var namedDep))
258-
{
259-
_platformConfigEditors[_selectedTab].SetDeployment(namedDep.Value);
260-
}
261-
else
257+
if(!ProductConfig.Get<ProductConfig>().Environments.TryGetFirstDefinedNamedDeployment(out var namedDep))
262258
{
263259
Debug.LogError($"{nameof(EOSSettingsWindow)} {nameof(Save)}: No named deployment found for current platform tab: {_platformConfigEditors[_selectedTab].GetPlatform()}");
260+
return;
264261
}
265262
// Save each of the platform config editors.
266263
foreach (IConfigEditor editor in _platformConfigEditors)
@@ -269,6 +266,8 @@ private void Save()
269266
}
270267
AssetDatabase.SaveAssets();
271268
AssetDatabase.Refresh();
269+
_platformTabs = BuildPlatformTabsDynamic();
270+
Repaint();
272271
}
273272

274273
/// <summary>

Assets/Plugins/Source/Editor/Utility/GUIEditorUtility.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ private static void RenderDeploymentInputs(ref ProductionEnvironments value)
868868
nameRect,
869869
string.IsNullOrEmpty,
870870
item.Name,
871-
"Sandbox Name");
871+
"Deployment Name");
872872

873873
if (!item.TrySetName(newItemName))
874874
{
@@ -926,6 +926,10 @@ private static void RenderDeploymentInputs(ref ProductionEnvironments value)
926926
break;
927927
}
928928
}
929+
else
930+
{
931+
item.Value.SandboxId = productionEnvironmentsCopy.Sandboxes[0].Value;
932+
}
929933
},
930934
() => productionEnvironmentsCopy.Deployments.Add(),
931935
(item) =>
@@ -934,6 +938,7 @@ private static void RenderDeploymentInputs(ref ProductionEnvironments value)
934938
{
935939
// TODO: Tell user why deployment could not be removed
936940
// from the Production Environments.
941+
Debug.LogError($"{nameof(GUIEditorUtility)} {nameof(RenderDeploymentInputs)}: Failed to find deployment with name {item.Name} when trying to remove it.");
937942
}
938943
});
939944
}

0 commit comments

Comments
 (0)