Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions Assets/Rivet/Editor/UI/Dock/Tabs/DevelopController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,18 @@ void InitUI()

_environmentTypeDropdown.RegisterValueChangedCallback(ev =>
{
plugin.EnvironmentType = (EnvironmentType)_environmentTypeDropdown.index;
_dock.OnSelectedEnvironmentChange();
if (!plugin.IsAuthenticated && _environmentTypeDropdown.index == 1)
{
// Force sign in
_environmentTypeDropdown.index = 0;
_ = Dock.Singleton?.StartSignIn();
}
else
{
// Change environment
plugin.EnvironmentType = (EnvironmentType)_environmentTypeDropdown.index;
_dock.OnSelectedEnvironmentChange();
}
});
_remoteEnvironmentDropdown.RegisterValueChangedCallback(ev =>
{
Expand All @@ -107,7 +117,6 @@ void InitUI()

_buildDeployButton.RegisterCallback<ClickEvent>(ev => OnBuildAndDeploy());


// Initial visibility update
UpdatePlayerCountVisibility();
}
Expand All @@ -116,6 +125,10 @@ public void OnBootstrap()
{
var plugin = RivetGlobal.Singleton;

// Toggle remote environment
_environmentTypeDropdown.choices[1] = plugin.IsAuthenticated ? "Remote (Live Servers)" : "Remote (Live Servers) (Requires Sign In)";

// Add environment list
if (plugin.CloudData is { } cloudData)
{
// Add environments
Expand All @@ -127,8 +140,11 @@ public void OnBootstrap()
environments.Add("+ New Environment");
_remoteEnvironmentDropdown.choices = environments;
}

OnSelectedEnvironmentChange();

// Disable sign in button
_buildDeployButton.SetEnabled(plugin.IsAuthenticated);
_buildDeployButton.Q<Label>(name: "Label").text = plugin.IsAuthenticated ? "Build & Deploy" : "Build & Deploy (Requires Sign In)";
}

/// <summary>
Expand Down