1
0
forked from akanyan/mu3-mods

feat: add the remaining things

* DisableMaintenance
* UnlockAllMusic
* UnlockGameEvents
* UnlockMemoryChapters
This commit is contained in:
2024-07-08 02:10:46 +09:00
parent 42cf65bdb7
commit cc7bc8613b
17 changed files with 263 additions and 1 deletions

View File

@ -0,0 +1,32 @@
using MU3.Data;
using MU3.User;
using MU3.Util;
using System.Collections.Generic;
using System.Linq;
namespace MU3.Client;
class patch_PacketGetUserMemoryChapter: Packet {
private Dictionary<int, User.UserMemoryChapter> userMemoryChapter_;
public override State proc() {
switch(procImpl()) {
case State.Done: {
GetUserMemoryChapterResponse response_ = (query_ as GetUserMemoryChapter).response_;
foreach(MemoryChapterData memoryChapterData in SingletonStateMachine<DataManager, DataManager.EState>.instance.allMemoryChapterData) {
UserMemoryChapter userMemoryChapter = Enumerable.FirstOrDefault(response_.userMemoryChapterList, (UserMemoryChapter c) => c.chapterId == memoryChapterData.id);
if(userMemoryChapter != null) {
User.UserMemoryChapter userMemoryChapter2 = new User.UserMemoryChapter();
userMemoryChapter2.copyFrom(userMemoryChapter);
userMemoryChapter_[userMemoryChapter2.ChapterId] = userMemoryChapter2;
} else {
User.UserMemoryChapter userMemoryChapter3 = new User.UserMemoryChapter(memoryChapterData.id);
userMemoryChapter_[userMemoryChapter3.ChapterId] = userMemoryChapter3;
}
}
Singleton<UserManager>.instance.UserMemoryChapter = userMemoryChapter_;
break;
}
}
return state_;
}
}

View File

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<AssemblyName>Assembly-CSharp.UnlockMemoryChapters.mm</AssemblyName>
<Description>Unlock memory chapters</Description>
</PropertyGroup>
<Import Project="..\Mu3Mods.csproj" />
</Project>