Conversation
|
Hmm, just realised I need to check the button layouts when dev isn't enabled. I suspect the OK button will be off-centre 🤢 |
|
Yes, we NEED IT! Thanks! |
|
Well done! I had considered doing this as well but never found the time! Glad to see this nice QOL improvement. |
mibac138
left a comment
There was a problem hiding this comment.
Looks good overall, just a few minor comments
| // Draw text and input box at the top of the window | ||
| using (MpStyle.Set(GameFont.Small)) | ||
| { | ||
| Vector2 textSize = Text.CalcSize("MpSaveGameAs".Translate()); |
There was a problem hiding this comment.
Removed. I was trialling rendering the text directly without GuiLayout and forgot to remove it.
| private bool filesRead; | ||
| private SaveFileReader reader; | ||
| private FileInfo selectedFile; | ||
| private static Vector2 saveListScroll; |
There was a problem hiding this comment.
couldn't this be a instance field? None of the other added fields are static
There was a problem hiding this comment.
Yeah no idea why that is static. It's that way in ServerBrowser.cs. I've made it an instance variable.
| filesRead = true; | ||
| } | ||
|
|
||
| GUILayout.BeginArea(windowRect.AtZero()); |
There was a problem hiding this comment.
| GUILayout.BeginArea(windowRect.AtZero()); | |
| GUILayout.BeginArea(windowRect); |
nit: this is a pre-existing issue, but the .AtZero() is redundant, as the windowRect is already zeroed when called by the Window parent class
There was a problem hiding this comment.
Removed. I was curious what the purpose of that was, but I've never used Unity so figured it was safer to leave than remove.
| GUILayout.EndArea(); | ||
| } | ||
|
|
||
| private void DrawSaveList(List<FileInfo> saves, float width, ref float y) |
There was a problem hiding this comment.
This is almost the same as in ServerBrowser, except one small change. While I'm not a fan of this code duplication, I think it's fine for an intial version, and I wouldn't want to block this PR on it
There was a problem hiding this comment.
Yeah I thought the exact same thing. But the function had a few too many references to instance variables/methods to easily make it static/common, so I cheated and copied it.
Thanks @mibac138. I've fixed those issues. |
|
Looks fine |

Reasoning
When playing multiple sessions, I forget the name of the existing save file. I figured it might be nice to copy the list of save files like on the Host window, and use that on the Save window.
I copied just about everything from ServerBrowser.cs
DrawHost().Example Host window
Existing MP Save window
New MP Save window