(fc5c8644d) Automatically enable user statistics if the "do you want to send statistics" prompt cannot be shown on the selected language
This commit is contained in:
@@ -287,29 +287,38 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (GameSettings.ShowUserStatisticsPrompt)
|
if (GameSettings.ShowUserStatisticsPrompt)
|
||||||
{
|
{
|
||||||
//TODO: translate
|
if (TextManager.ContainsTag("statisticspromptheader") && TextManager.ContainsTag("statisticsprompttext"))
|
||||||
var userStatsPrompt = new GUIMessageBox(
|
|
||||||
"Do you want to help us make Barotrauma better?",
|
|
||||||
"Do you allow Barotrauma to send usage statistics and error reports to the developers? The data is anonymous, " +
|
|
||||||
"does not contain any personal information and is only used to help us diagnose issues and improve Barotrauma.",
|
|
||||||
new string[] { "Yes", "No" });
|
|
||||||
userStatsPrompt.Buttons[0].OnClicked += (btn, userdata) =>
|
|
||||||
{
|
{
|
||||||
|
var userStatsPrompt = new GUIMessageBox(
|
||||||
|
TextManager.Get("statisticspromptheader"),
|
||||||
|
TextManager.Get("statisticsprompttext"),
|
||||||
|
new string[] { TextManager.Get("Yes"), TextManager.Get("No") });
|
||||||
|
userStatsPrompt.Buttons[0].OnClicked += (btn, userdata) =>
|
||||||
|
{
|
||||||
|
GameSettings.ShowUserStatisticsPrompt = false;
|
||||||
|
GameSettings.SendUserStatistics = true;
|
||||||
|
GameAnalyticsManager.Init();
|
||||||
|
Config.SaveNewPlayerConfig();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
userStatsPrompt.Buttons[0].OnClicked += userStatsPrompt.Close;
|
||||||
|
userStatsPrompt.Buttons[1].OnClicked += (btn, userdata) =>
|
||||||
|
{
|
||||||
|
GameSettings.ShowUserStatisticsPrompt = false;
|
||||||
|
GameSettings.SendUserStatistics = false;
|
||||||
|
Config.SaveNewPlayerConfig();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
userStatsPrompt.Buttons[1].OnClicked += userStatsPrompt.Close;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//user statistics enabled by default if the prompt cannot be shown in the user's language
|
||||||
GameSettings.ShowUserStatisticsPrompt = false;
|
GameSettings.ShowUserStatisticsPrompt = false;
|
||||||
GameSettings.SendUserStatistics = true;
|
GameSettings.SendUserStatistics = true;
|
||||||
GameAnalyticsManager.Init();
|
GameAnalyticsManager.Init();
|
||||||
Config.SaveNewPlayerConfig();
|
Config.SaveNewPlayerConfig();
|
||||||
return true;
|
}
|
||||||
};
|
|
||||||
userStatsPrompt.Buttons[0].OnClicked += userStatsPrompt.Close;
|
|
||||||
userStatsPrompt.Buttons[1].OnClicked += (btn, userdata) =>
|
|
||||||
{
|
|
||||||
GameSettings.ShowUserStatisticsPrompt = false;
|
|
||||||
GameSettings.SendUserStatistics = false;
|
|
||||||
Config.SaveNewPlayerConfig();
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
userStatsPrompt.Buttons[1].OnClicked += userStatsPrompt.Close;
|
|
||||||
}
|
}
|
||||||
else if (GameSettings.SendUserStatistics)
|
else if (GameSettings.SendUserStatistics)
|
||||||
{
|
{
|
||||||
@@ -374,10 +383,10 @@ namespace Barotrauma
|
|||||||
DebugConsole.Log("Selected content packages: " + string.Join(", ", SelectedPackages.Select(cp => cp.Name)));
|
DebugConsole.Log("Selected content packages: " + string.Join(", ", SelectedPackages.Select(cp => cp.Name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
/*#if DEBUG
|
||||||
GameSettings.ShowUserStatisticsPrompt = false;
|
GameSettings.ShowUserStatisticsPrompt = false;
|
||||||
GameSettings.SendUserStatistics = false;
|
GameSettings.SendUserStatistics = false;
|
||||||
#endif
|
#endif*/
|
||||||
|
|
||||||
InitUserStats();
|
InitUserStats();
|
||||||
|
|
||||||
|
|||||||
@@ -218,22 +218,6 @@ namespace Barotrauma
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool RefreshJoinButtonState(GUIComponent component, object obj)
|
|
||||||
{
|
|
||||||
if (obj == null || waitingForRefresh) { return false; }
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(clientNameBox.Text) && !string.IsNullOrWhiteSpace(ipBox.Text))
|
|
||||||
{
|
|
||||||
joinButton.Enabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
joinButton.Enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool SelectServer(GUIComponent component, object obj)
|
private bool SelectServer(GUIComponent component, object obj)
|
||||||
{
|
{
|
||||||
if (obj == null || waitingForRefresh) { return false; }
|
if (obj == null || waitingForRefresh) { return false; }
|
||||||
|
|||||||
@@ -750,6 +750,7 @@ namespace Barotrauma
|
|||||||
if (!fileFound)
|
if (!fileFound)
|
||||||
{
|
{
|
||||||
ShowLanguageSelectionPrompt = true;
|
ShowLanguageSelectionPrompt = true;
|
||||||
|
ShowUserStatisticsPrompt = true;
|
||||||
SaveNewPlayerConfig();
|
SaveNewPlayerConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user