-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Core / Settings: Improved settings loading / saving and the integration #190
Conversation
- Fixed settings not updating in certain stages - Improved settings handling - Added a main setting change event - Fixed dropdown auto select bug - Default settings will be overwritten without dialog when loading settings from a file
public int MinPlayers { get; set; } = 2; // The minimum players required to start. | ||
|
||
public int PreRoundTime { get; set; } = 20; // The amount of time allowed for preparation. | ||
|
||
public int RoundTime { get; set; } = 300; // The amount of time allowed for the main round. | ||
|
||
public int PostRoundTime { get; set; } = 10; // The amount of time before the next round starts. | ||
|
||
public int KillTimeReward { get; set; } = 30; // The amount of extra time given to traitors for killing an innocent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know someone suggested this, but imo these comments are not needed. If the variable name is that bad that someone can't understand it, it should be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept this for e.g. upcoming attribute property support. Anyways, these comments doesn't hurt imo.
DefaultWalkController.SetSprintEnabled(value); | ||
} | ||
|
||
namespace Topics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this namespace a few times, what is the goal of describing what should be underneath it? Topics
seems pretty vague to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While TTTReborn.Settings
stores the settings stuff, TTTReborn.Settings.Topic
holds the setting topics, so you don't have just json structure stuff inside the defeault settings namespace.
|
||
settings.JsonType = settingsName; | ||
|
||
FileSystem.Data.WriteAllText(path + fileName + SETTINGS_FILE_EXTENSION, GetJSON<T>(settings)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use ${}
@@ -163,7 +169,7 @@ public void OnConfirm(FileSelectionEntry fileSelectionEntry) | |||
} | |||
else | |||
{ | |||
CreateTreeView(_currentFolderPath + fileSelectionEntry.FileNameLabel.Text); | |||
CreateTreeView(CurrentFolderPath + fileSelectionEntry.FileNameLabel.Text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use ${}
}); | ||
} | ||
|
||
private void OnAgreeSaveAs(FileSelection fileSelection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably can just be SaveAs
dialogBox.Display(); | ||
} | ||
|
||
private void OnAgreeLoadFrom(FileSelection fileSelection, PanelContent menuContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoadFrom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
FileSelection
handlingAdded

Tooltip
basic UI component:TODO
Updated json structure (e.g. serversettings):
Fixed dropdown cut off as well (caused by overflow):
