forked from akanyan/mu3-mods
feat: add the remaining things
* DisableMaintenance * UnlockAllMusic * UnlockGameEvents * UnlockMemoryChapters
This commit is contained in:
@ -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_;
|
||||
}
|
||||
}
|
7
UnlockMemoryChapters/UnlockMemoryChapters.csproj
Normal file
7
UnlockMemoryChapters/UnlockMemoryChapters.csproj
Normal file
@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Assembly-CSharp.UnlockMemoryChapters.mm</AssemblyName>
|
||||
<Description>Unlock memory chapters</Description>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
Reference in New Issue
Block a user