protected virtual void OnGuiSetupCloudAppId()
{
GUILayout.Label(CurrentLang.AppIdLabel);
GUILayout.BeginHorizontal();
this.cloudAppId = EditorGUILayout.TextField(this.cloudAppId);
open = GUILayout.Toggle(open, HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (open)
{
GUILayout.Label(CurrentLang.AppIdInfoLabel);
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.CloudRegionLabel);
int selectedRegion = ServerSettings.FindRegionForServerAddress(this.photonAddress);
GUILayout.BeginHorizontal();
int toolbarValue = GUILayout.Toolbar(selectedRegion, cloudServerRegionNames); // the enum CloudServerRegion is converted into a string[] in init (toolbar can't use enum)
helpRegion = GUILayout.Toggle(helpRegion, HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (helpRegion)
{
GUILayout.Label(CurrentLang.RegionalServersInfo);
}
if (selectedRegion != toolbarValue)
{
//Debug.Log("Replacing region: " + selectedRegion + " with: " + toolbarValue);
this.photonAddress = ServerSettings.FindServerAddressForRegion(toolbarValue);
}
EditorGUILayout.Separator();
GUILayout.BeginHorizontal();
if (GUILayout.Button(CurrentLang.CancelButton))
{
GUIUtility.keyboardControl = 0;
this.ReApplySettingsToWindow();
}
if (GUILayout.Button(CurrentLang.SaveButton))
{
GUIUtility.keyboardControl = 0;
this.cloudAppId = this.cloudAppId.Trim();
PhotonEditor.Current.UseCloud(this.cloudAppId, selectedRegion);
PhotonEditor.Save();
EditorUtility.DisplayDialog(CurrentLang.SettingsSavedTitle, CurrentLang.SettingsSavedMessage, CurrentLang.OkButton);
}
GUILayout.EndHorizontal();
GUILayout.Space(20);
GUILayout.Label(CurrentLang.SetupOwnServerLabel);
if (GUILayout.Button(CurrentLang.SelfHostSettingsButton))
{
this.photonAddress = ServerSettings.DefaultServerAddress;
this.photonPort = ServerSettings.DefaultMasterPort;
this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.OwnHostCloudCompareLabel);
if (GUILayout.Button(CurrentLang.ComparisonPageButton))
{
Application.OpenURL(UrlCompare);
}
}