Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max Save File Count exposed via SGBSaveManager #43

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Runtime/Scripts/SGBSaveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public static class SGBSaveManager
/// </summary>
public static LoadDataDelegate LoadDataOverrideFunc { get; set; } = null;

/// <summary>
/// How many save files should SGB be allowed to display and store?
/// </summary>
public static int MaxSaveFileCount { get; set; } = 40;

//
// Constructor
//
Expand Down
11 changes: 8 additions & 3 deletions Runtime/src/engine/MapScene/CommonWindow/SaveWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Custom overrides description
// Resolution overrides, Margin corrections for the Save window selection options and message
using BobboNet.SGB.IMod;
using Microsoft.Xna.Framework;
using Yukar.Common;

Expand All @@ -16,7 +17,11 @@ internal SaveFileList()
{
columnNum = 1;
itemNumPerPage = 5;
#if IMOD
maxItems = SGBSaveManager.MaxSaveFileCount;
#else
maxItems = 40;
#endif
itemHeight = 68;
//pageMarkOffsetY = 22;
marginRow = 1;
Expand Down Expand Up @@ -125,9 +130,9 @@ internal void decideByTouch(bool isMute = false)
var touchPos = InputCore.getTouchPos(0);
var offsetX = (int)windowPos.X - innerWidth / 2;
var offsetY = (int)windowPos.Y - innerHeight / 2;
if (offsetX + maxWindowSize.X < touchPos.x
&& touchPos.x < Graphics.ScreenWidth - offsetX
&& offsetY < touchPos.y
if (offsetX + maxWindowSize.X < touchPos.x
&& touchPos.x < Graphics.ScreenWidth - offsetX
&& offsetY < touchPos.y
&& touchPos.y < maxWindowSize.Y)
{
if (returnSelected == 0) result = selected;
Expand Down