Skip to content

Commit

Permalink
修改 自定义收藏品添加是否为新物品开关
Browse files Browse the repository at this point in the history
  • Loading branch information
WYH2004-MC committed Oct 18, 2024
1 parent 0d6fc6a commit 8425bd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SinmaiAssist {
public static partial class BuildInfo {
public const string CommitHash = "f200d57";
public const string BuildDate = "2024-10-17T02:02:06.5635344+08:00";
public const string CommitHash = "0d6fc6a";
public const string BuildDate = "2024-10-18T12:05:17.5213371+08:00";
}
}
12 changes: 7 additions & 5 deletions GUI/UserDataPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class UserDataPanel
{
private static UserData _player1 = null;
private static UserData _player2 = null;
private static bool _isNewItem = false;

private enum CollectionType
{
Expand Down Expand Up @@ -54,6 +55,7 @@ public static void OnGUI()
}
GUILayout.EndHorizontal();
}
_isNewItem = GUILayout.Toggle(_isNewItem, "Is New Item");

GUILayout.Label("Unlock Music", MainGUI.Style.Title);
GUILayout.BeginHorizontal();
Expand Down Expand Up @@ -86,13 +88,13 @@ private static void AddCollections(long index, CollectionType type, string input
{
if (int.TryParse(input, out int id))
{
if (userData.AddCollections((UserData.Collection)type, id))
if (userData.AddCollections((UserData.Collection)type, id, _isNewItem))
{
GameMessageManager.SendMessage((int)index,$"Add Collections \n{type} {id}");
GameMessageManager.SendMessage((int)index,$"Add Collections \n{type} {id}" + (_isNewItem ? " (New Item)" : "") );
}
else
{
GameMessageManager.SendMessage((int)index,$"Failed to add Collections \n{type} {id}");
GameMessageManager.SendMessage((int)index,$"Failed to add Collections or already added\n{type} {id}");
}
}
else
Expand Down Expand Up @@ -127,7 +129,7 @@ private static void UnlockMusic(long index, string input)
}
else
{
GameMessageManager.SendMessage((int)index,$"Failed to unlock music \n{id}");
GameMessageManager.SendMessage((int)index,$"Failed to unlock music or already unlocked \n{id}");
}
}
else if(!userData.IsUnlockMusic(UserData.MusicUnlock.Master, id))
Expand All @@ -138,7 +140,7 @@ private static void UnlockMusic(long index, string input)
}
else
{
GameMessageManager.SendMessage((int)index,$"Music not found or already unlocked\n{id}");
GameMessageManager.SendMessage((int)index,$"Failed to unlock Master or already unlocked\n{id}");
}
}
else
Expand Down

0 comments on commit 8425bd0

Please sign in to comment.