(4df232b6e) Show the campaign disclaimer also if the player goes directly to the multiplayer tabs. Closes #1468
This commit is contained in:
@@ -440,9 +440,21 @@ namespace Barotrauma
|
|||||||
GameMain.Config.SettingsFrame.RectTransform.RelativeSize = Vector2.One;
|
GameMain.Config.SettingsFrame.RectTransform.RelativeSize = Vector2.One;
|
||||||
break;
|
break;
|
||||||
case Tab.JoinServer:
|
case Tab.JoinServer:
|
||||||
|
if (!GameMain.Config.CampaignDisclaimerShown)
|
||||||
|
{
|
||||||
|
selectedTab = 0;
|
||||||
|
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.JoinServer); });
|
||||||
|
return true;
|
||||||
|
}
|
||||||
GameMain.ServerListScreen.Select();
|
GameMain.ServerListScreen.Select();
|
||||||
break;
|
break;
|
||||||
case Tab.HostServer:
|
case Tab.HostServer:
|
||||||
|
if (!GameMain.Config.CampaignDisclaimerShown)
|
||||||
|
{
|
||||||
|
selectedTab = 0;
|
||||||
|
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.HostServer); });
|
||||||
|
return true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Tab.Tutorials:
|
case Tab.Tutorials:
|
||||||
if (!GameMain.Config.CampaignDisclaimerShown)
|
if (!GameMain.Config.CampaignDisclaimerShown)
|
||||||
|
|||||||
@@ -424,79 +424,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Language = doc.Root.GetAttributeString("language", "English");
|
Language = doc.Root.GetAttributeString("language", "English");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void CheckBindings(bool useDefaults)
|
|
||||||
{
|
|
||||||
foreach (InputType inputType in Enum.GetValues(typeof(InputType)))
|
|
||||||
{
|
|
||||||
var binding = keyMapping[(int)inputType];
|
|
||||||
if (binding == null)
|
|
||||||
{
|
|
||||||
switch (inputType)
|
|
||||||
{
|
|
||||||
case InputType.Deselect:
|
|
||||||
if (useDefaults)
|
|
||||||
{
|
|
||||||
binding = new KeyOrMouse(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Legacy support
|
|
||||||
var selectKey = keyMapping[(int)InputType.Select];
|
|
||||||
if (selectKey != null && selectKey.Key != Keys.None)
|
|
||||||
{
|
|
||||||
binding = new KeyOrMouse(selectKey.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case InputType.Shoot:
|
|
||||||
if (useDefaults)
|
|
||||||
{
|
|
||||||
binding = new KeyOrMouse(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Legacy support
|
|
||||||
var useKey = keyMapping[(int)InputType.Use];
|
|
||||||
if (useKey != null && useKey.MouseButton.HasValue)
|
|
||||||
{
|
|
||||||
binding = new KeyOrMouse(useKey.MouseButton.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (binding == null)
|
|
||||||
{
|
|
||||||
DebugConsole.ThrowError("Key binding for the input type \"" + inputType + " not set!");
|
|
||||||
binding = new KeyOrMouse(Keys.D1);
|
|
||||||
}
|
|
||||||
keyMapping[(int)inputType] = binding;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Load DefaultConfig
|
|
||||||
private void LoadDefaultConfig(bool setLanguage = true)
|
|
||||||
{
|
|
||||||
XDocument doc = XMLExtensions.TryLoadXml(savePath);
|
|
||||||
|
|
||||||
if (setLanguage || string.IsNullOrEmpty(Language))
|
|
||||||
{
|
|
||||||
Language = doc.Root.GetAttributeString("language", "English");
|
|
||||||
}
|
|
||||||
|
|
||||||
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
|
|
||||||
|
|
||||||
AutoCheckUpdates = doc.Root.GetAttributeBool("autocheckupdates", true);
|
|
||||||
WasGameUpdated = doc.Root.GetAttributeBool("wasgameupdated", false);
|
|
||||||
|
|
||||||
VerboseLogging = doc.Root.GetAttributeBool("verboselogging", false);
|
|
||||||
SaveDebugConsoleLogs = doc.Root.GetAttributeBool("savedebugconsolelogs", false);
|
|
||||||
|
|
||||||
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
|
|
||||||
|
|
||||||
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
|
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
|
||||||
|
|
||||||
@@ -959,6 +886,55 @@ namespace Barotrauma
|
|||||||
|
|
||||||
selectedContentPackagePaths = new HashSet<string>();
|
selectedContentPackagePaths = new HashSet<string>();
|
||||||
|
|
||||||
|
foreach (XElement subElement in doc.Root.Elements())
|
||||||
|
{
|
||||||
|
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||||
|
{
|
||||||
|
case "keymapping":
|
||||||
|
LoadKeyBinds(subElement);
|
||||||
|
break;
|
||||||
|
case "gameplay":
|
||||||
|
jobPreferences = new List<string>();
|
||||||
|
foreach (XElement ele in subElement.Element("jobpreferences").Elements("job"))
|
||||||
|
{
|
||||||
|
string jobIdentifier = ele.GetAttributeString("identifier", "");
|
||||||
|
if (string.IsNullOrEmpty(jobIdentifier)) continue;
|
||||||
|
jobPreferences.Add(jobIdentifier);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "player":
|
||||||
|
defaultPlayerName = subElement.GetAttributeString("name", defaultPlayerName);
|
||||||
|
CharacterHeadIndex = subElement.GetAttributeInt("headindex", CharacterHeadIndex);
|
||||||
|
if (Enum.TryParse(subElement.GetAttributeString("gender", "none"), true, out Gender g))
|
||||||
|
{
|
||||||
|
CharacterGender = g;
|
||||||
|
}
|
||||||
|
if (Enum.TryParse(subElement.GetAttributeString("race", "white"), true, out Race r))
|
||||||
|
{
|
||||||
|
CharacterRace = r;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CharacterRace = Race.White;
|
||||||
|
}
|
||||||
|
CharacterHairIndex = subElement.GetAttributeInt("hairindex", CharacterHairIndex);
|
||||||
|
CharacterBeardIndex = subElement.GetAttributeInt("beardindex", CharacterBeardIndex);
|
||||||
|
CharacterMoustacheIndex = subElement.GetAttributeInt("moustacheindex", CharacterMoustacheIndex);
|
||||||
|
CharacterFaceAttachmentIndex = subElement.GetAttributeInt("faceattachmentindex", CharacterFaceAttachmentIndex);
|
||||||
|
break;
|
||||||
|
case "tutorials":
|
||||||
|
foreach (XElement tutorialElement in subElement.Elements())
|
||||||
|
{
|
||||||
|
CompletedTutorialNames.Add(tutorialElement.GetAttributeString("name", ""));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UnsavedSettings = false;
|
||||||
|
|
||||||
|
selectedContentPackagePaths = new HashSet<string>();
|
||||||
|
|
||||||
foreach (XElement subElement in doc.Root.Elements())
|
foreach (XElement subElement in doc.Root.Elements())
|
||||||
{
|
{
|
||||||
gSettings = new XElement("graphicssettings");
|
gSettings = new XElement("graphicssettings");
|
||||||
|
|||||||
Reference in New Issue
Block a user