Moved the execution of the save coroutine to JobNamePreferences' setter.

Juanjp pointed out that it would run the coroutine if you modified changes in the settings without yet pressing "Apply".

Also reworded the job descriptions.
This commit is contained in:
CommanderMark
2017-06-10 23:24:24 -04:00
parent ed5039c43c
commit cc6e220691
3 changed files with 14 additions and 13 deletions
+8 -7
View File
@@ -61,7 +61,14 @@ namespace Barotrauma
public List<string> JobNamePreferences
{
get { return jobNamePreferences; }
set { UnsavedSettings = true; jobNamePreferences = value; }
set
{
// Begin saving coroutine. Remove any existing save coroutines if one is running.
if (CoroutineManager.IsCoroutineRunning("saveCoroutine")) { CoroutineManager.StopCoroutines("saveCoroutine"); }
CoroutineManager.StartCoroutine(ApplyUnsavedChanges(), "saveCoroutine");
jobNamePreferences = value;
}
}
public string MasterServerUrl { get; set; }
@@ -81,12 +88,6 @@ namespace Barotrauma
private set
{
unsavedSettings = value;
// Beging saving coroutine. Remove any existing save coroutines if one is running.
if (CoroutineManager.IsCoroutineRunning("saveCoroutine")) { CoroutineManager.StopCoroutines("saveCoroutine"); }
if (unsavedSettings == true)
{
CoroutineManager.StartCoroutine(ApplyUnsavedChanges(), "saveCoroutine");
}
if (applyButton != null)
{
+1 -1
View File
@@ -546,7 +546,7 @@ namespace Barotrauma
if (job == null) { continue; }
GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name + " ",
"",Alignment.Left, Alignment.Right, jobList, false,
"", Alignment.Left, Alignment.Right, jobList, false,
GameMain.GraphicsWidth<1000 ? GUI.SmallFont : GUI.Font);
jobText.UserData = job;