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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user