Skip to content

Add list of save files to save window#822

Open
ianleeder wants to merge 3 commits intorwmt:devfrom
ianleeder:new-save-window
Open

Add list of save files to save window#822
ianleeder wants to merge 3 commits intorwmt:devfrom
ianleeder:new-save-window

Conversation

@ianleeder
Copy link

@ianleeder ianleeder commented Feb 25, 2026

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

image

Existing MP Save window

image

New MP Save window

image image

@ianleeder
Copy link
Author

Hmm, just realised I need to check the button layouts when dev isn't enabled. I suspect the OK button will be off-centre 🤢

@maxsupermanhd
Copy link

Yes, we NEED IT! Thanks!

@SaberShip
Copy link
Contributor

Well done! I had considered doing this as well but never found the time! Glad to see this nice QOL improvement.

@ianleeder
Copy link
Author

Ok I've adjusted very slightly.

  • Made the window a little narrower, it didn't need to be that wide.
  • Fixed bug where the dev replay button wasn't conditional
  • Centered the Save button if no dev button is shown

Ready for review/merge

image

@ianleeder ianleeder marked this pull request as ready for review February 27, 2026 23:47
Copy link

@mibac138 mibac138 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable textSize

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't this be a instance field? None of the other added fields are static

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ianleeder
Copy link
Author

Looks good overall, just a few minor comments

Thanks @mibac138. I've fixed those issues.

@notfood
Copy link
Member

notfood commented Mar 2, 2026

Looks fine

@notfood notfood added enhancement New feature or request. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels Mar 2, 2026
@notfood notfood moved this to In review in 1.6 and Odyssey Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). enhancement New feature or request.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants