Actually save when pressing "save and close" (#523)
This commit is contained in:
committed by
Pieter-Jan Briers
parent
511741d11a
commit
1bd17f73b1
@@ -354,12 +354,7 @@ namespace Content.Client.UserInterface
|
||||
Text = localization.GetString("Save"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
};
|
||||
_saveButton.OnPressed += args =>
|
||||
{
|
||||
IsDirty = false;
|
||||
_preferencesManager.UpdateCharacter(Profile, CharacterSlot);
|
||||
OnProfileChanged?.Invoke(Profile);
|
||||
};
|
||||
_saveButton.OnPressed += args => { Save(); };
|
||||
panel.AddChild(_saveButton);
|
||||
rightColumn.AddChild(panel);
|
||||
}
|
||||
@@ -371,6 +366,13 @@ namespace Content.Client.UserInterface
|
||||
IsDirty = false;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
IsDirty = false;
|
||||
_preferencesManager.UpdateCharacter(Profile, CharacterSlot);
|
||||
OnProfileChanged?.Invoke(Profile);
|
||||
}
|
||||
|
||||
private bool IsDirty
|
||||
{
|
||||
get => _isDirty;
|
||||
|
||||
Reference in New Issue
Block a user