Conversation
|
|
||
| ReadSettingsFile(); | ||
|
|
||
| string lastRead_Formed = ""; |
There was a problem hiding this comment.
I can't really encourage the use of this form of parser. Seems pretty brittle and hack-ish
| if (FullscreenStatus) | ||
| { | ||
| _retreivedSettings = _retreivedSettings + Environment.NewLine + FullscreenPreset + " = " + SettingsFileTrueTerm + ";"; | ||
| }else |
There was a problem hiding this comment.
else statements go on their own line, but that's mostly formatting nitpicking
| _writtenSettingsValue = _retreivedSettings; | ||
| } | ||
|
|
||
| File.WriteAllText(_dataPath, _writtenSettingsValue); |
There was a problem hiding this comment.
The perfect settings setup (see: whatever I posted on Discord) would do this asynchronously instead of potentially blocking things.
| { | ||
| if (!_optionsMenuActive) | ||
| { | ||
| FullscreenButton.IsActive = true; |
There was a problem hiding this comment.
Wouldn't it be easier to put all those buttons into a panel and enable/disable that panel?
| @@ -0,0 +1,10 @@ | |||
| using FlaxEngine; | |||
|
|
|||
| @@ -0,0 +1,105 @@ | |||
| using FlaxEngine; | |||
|
|
|||
| namespace BasicTemplate | |||
There was a problem hiding this comment.
Wrong namespace, I'm guessing it's a typical "copy pasta" mistake.
At least pasta is tasty 🍝
| if (lastRead_Formed.Contains(GFX_Preset + " = " + SettingsFileTrueTerm + ";")) | ||
| { | ||
| gfxBool = true; | ||
| }else | ||
| { | ||
| gfxBool = false; | ||
| } | ||
|
|
||
| bool fullscreenBool; | ||
| if (lastRead_Formed.Contains(FullscreenPreset + " = " + SettingsFileTrueTerm + ";")) | ||
| { | ||
| fullscreenBool = true; | ||
| }else | ||
| { | ||
| fullscreenBool = false; | ||
| } | ||
|
|
||
| bool sfxBool; | ||
| if (lastRead_Formed.Contains(SFX_Preset + " = " + SettingsFileTrueTerm + ";")) | ||
| { | ||
| sfxBool = true; | ||
| }else | ||
| { | ||
| sfxBool = false; | ||
| } |
There was a problem hiding this comment.
Personally I find that overall there are too many string concatenations and if statements like these throughout the source, this has the potential to be simplified perhaps atleast via ternary operator or use a different implementation entirely.
There was a problem hiding this comment.
You're right, I should've gotten something like: bool sfxBool = lastRead_Formed.Contains(SFX_Preset + " = " + SettingsFileTrueTerm + ";") and to have them be only 3 lines instead of 20 or so. Probably too late to change it.
No description provided.