Skip to content

Commit f0432d0

Browse files
Date (#1)
* yy * fixed invisible menus
1 parent d089257 commit f0432d0

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

Framework/NewSaveGameMenuV2.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ public NewSaveGameMenuV2() {
3636

3737
public event EventHandler SaveComplete;
3838

39-
public virtual void receiveRightClick(int x, int y, bool playSound = true) { }
39+
public override void receiveRightClick(int x, int y, bool playSound = true) { }
4040

4141
public void complete() {
42+
Game1.dayOfMonth = Game1.dayOfMonth - 1;
4243
Game1.playSound("money");
4344
completePause = 1500;
4445
loader = null;
@@ -49,11 +50,11 @@ public void complete() {
4950
SaveComplete(this, EventArgs.Empty);
5051
}
5152

52-
public virtual bool readyToClose() {
53+
public override bool readyToClose() {
5354
return false;
5455
}
5556

56-
public virtual void update(GameTime time) {
57+
public override void update(GameTime time) {
5758
if (quit) {
5859
if (!Game1.activeClickableMenu.Equals(this) || !Game1.PollForEndOfNewDaySync())
5960
return;
@@ -92,13 +93,17 @@ public virtual void update(GameTime time) {
9293
if (Game1.newDaySync.readyForSave()) {
9394
multiplayer.saveFarmhands();
9495
Game1.game1.IsSaving = true;
96+
Game1.dayOfMonth = Game1.dayOfMonth + 2;
9597
loader = SaveGame.Save();
98+
9699
}
97100
}
98101
else {
99102
multiplayer.saveFarmhands();
100103
Game1.game1.IsSaving = true;
104+
Game1.dayOfMonth = Game1.dayOfMonth + 2;
101105
loader = SaveGame.Save();
106+
Game1.dayOfMonth = Game1.dayOfMonth - 1;
102107
}
103108
}
104109
else {
@@ -154,7 +159,7 @@ public static void saveClientOptions() {
154159
startupPreferences.savePreferences(false);
155160
}
156161

157-
public virtual void draw(SpriteBatch b) {
162+
public override void draw(SpriteBatch b) {
158163
base.draw(b);
159164
var vector2 = Utility.makeSafe(new Vector2(64f, Game1.viewport.Height - 64), new Vector2(64f, 64f));
160165
var flag = false;

Framework/NewShippingMenuV2.cs

+14-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Microsoft.Xna.Framework;
44
using Microsoft.Xna.Framework.Graphics;
55
using Microsoft.Xna.Framework.Input;
6+
using StardewModdingAPI;
67
using StardewValley;
78
using StardewValley.BellsAndWhistles;
89
using StardewValley.Menus;
@@ -151,14 +152,14 @@ public void RepositionItems() {
151152
currentTab = Utility.Clamp(currentTab, 0, (categoryItems[currentPage].Count - 1) / itemsPerCategoryPage);
152153
}
153154

154-
protected virtual void customSnapBehavior(int direction, int oldRegion, int oldID) {
155+
protected override void customSnapBehavior(int direction, int oldRegion, int oldID) {
155156
if (oldID != 103 || direction != 1 || !showForwardButton())
156157
return;
157158
currentlySnappedComponent = getComponentWithID(102);
158159
snapCursorToCurrentSnappedComponent();
159160
}
160161

161-
public virtual void snapToDefaultClickableComponent() {
162+
public override void snapToDefaultClickableComponent() {
162163
if (currentPage != -1)
163164
currentlySnappedComponent = getComponentWithID(103);
164165
else
@@ -256,7 +257,7 @@ public string getCategoryName(int index) {
256257
}
257258
}
258259

259-
public virtual void update(GameTime time) {
260+
public override void update(GameTime time) {
260261
base.update(time);
261262
if (_hasFinished) {
262263
shipItems();
@@ -451,13 +452,13 @@ public string getCategorySound(int which) {
451452
}
452453
}
453454

454-
public virtual void applyMovementKey(int direction) {
455+
public override void applyMovementKey(int direction) {
455456
if (!CanReceiveInput())
456457
return;
457458
base.applyMovementKey(direction);
458459
}
459460

460-
public virtual void performHoverAction(int x, int y) {
461+
public override void performHoverAction(int x, int y) {
461462
if (!CanReceiveInput())
462463
return;
463464
base.performHoverAction(x, y);
@@ -476,7 +477,7 @@ public bool CanReceiveInput() {
476477
return introTimer <= 0 && !outro;
477478
}
478479

479-
public virtual void receiveKeyPress(Keys key) {
480+
public override void receiveKeyPress(Keys key) {
480481
if (!CanReceiveInput())
481482
return;
482483
if (introTimer <= 0 && !Game1.options.gamepadControls && (key.Equals((Keys) 27) ||
@@ -492,7 +493,7 @@ public virtual void receiveKeyPress(Keys key) {
492493
}
493494
}
494495

495-
public virtual void receiveGamePadButton(Buttons b) {
496+
public override void receiveGamePadButton(Buttons b) {
496497
if (!CanReceiveInput())
497498
return;
498499
base.receiveGamePadButton(b);
@@ -528,7 +529,7 @@ private void okClicked() {
528529
Game1.changeMusicTrack("none");
529530
}
530531

531-
public virtual void receiveLeftClick(int x, int y, bool playSound = true) {
532+
public override void receiveLeftClick(int x, int y, bool playSound = true) {
532533
if (!CanReceiveInput())
533534
return;
534535
if (outro && !savedYet) {
@@ -593,18 +594,20 @@ public virtual void receiveLeftClick(int x, int y, bool playSound = true) {
593594
}
594595
}
595596

596-
public virtual void receiveRightClick(int x, int y, bool playSound = true) { }
597+
public override void receiveRightClick(int x, int y, bool playSound = true) { }
597598

598599
public bool showForwardButton() {
599600
return categoryItems[currentPage].Count > itemsPerCategoryPage * (currentTab + 1);
600601
}
601602

602-
public virtual void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds) {
603+
public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds) {
603604
initialize(0, 0, Game1.viewport.Width, Game1.viewport.Height);
604605
RepositionItems();
605606
}
606607

607-
public virtual void draw(SpriteBatch b) {
608+
public override void draw(SpriteBatch b)
609+
{
610+
SaveAnywhere.ModMonitor.Log("Test",LogLevel.Debug);
608611
if (Game1.wasRainingYesterday) {
609612
b.Draw(Game1.mouseCursors, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height),
610613
new Rectangle(639, 858, 1, 184),

Framework/SaveManager.cs

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public void LoadData() {
100100
return;
101101
Game1.timeOfDay = data.Time;
102102
ResumeSwimming(data);
103+
Game1.dayOfMonth = Game1.dayOfMonth - 1;
103104
SetPositions(data.Characters);
104105
var onLoaded = OnLoaded;
105106
if (onLoaded != null)

SaveAnywhere.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ private void OnDayStarted(object sender, DayStartedEventArgs e) {
105105
else if (firstLoad) {
106106
SaveManager.ClearData();
107107
}
108-
109108
ShouldResetSchedules = true;
110109
}
111110

@@ -119,6 +118,7 @@ private void OnButtonPressed(object sender, ButtonPressedEventArgs e) {
119118
else {
120119
IsCustomSaving = true;
121120
SaveManager.BeginSaveData();
121+
122122
}
123123
}
124124
else {

0 commit comments

Comments
 (0)