61 lines
2.4 KiB
Plaintext
61 lines
2.4 KiB
Plaintext
1. Inject assembly reference, namespace: StardewModdingAPI
|
|
|
|
2.Modify class StardewValley.Game1, modify constructor method£¬insert Instructions at beginning:
|
|
newobj System.Void SMDroid.ModEntry::.ctor()
|
|
stsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
|
|
3.Modify class StardewValley.ModHooks, inject method:
|
|
public virtual void OnGame1_Update(GameTime time);
|
|
public virtual void OnGame1_Draw(GameTime time, RenderTarget2D toBuffer);
|
|
public virtual LocalizedContentManager OnGame1_CreateContentManager(IServiceProvider serviceProvider, string rootDirectory) => null;
|
|
|
|
4.Modify class StardewValley.Game1, modify method Update(GameTime gameTime), insert Instructions at beginning:
|
|
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
ldarg.1
|
|
callvirt System.Void StardewValley.ModHooks::OnGame1_Update(Microsoft.Xna.Framework.GameTime)
|
|
|
|
5.Modify class StardewValley.Game1, modify method CreateContentManager(GameTime gameTime), replace Instructions to:
|
|
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
ldarg.1
|
|
ldarg.2
|
|
callvirt StardewValley.LocalizedContentManager StardewValley.ModHooks::OnGame1_CreateContentManager(System.IServiceProvider,System.String)
|
|
ret
|
|
|
|
6.Modify class StardewValley.Game1, modify method Draw(GameTime gameTime, RenderTarget2D toBuffer), modify Instructions at beginning:
|
|
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
ldarg.1
|
|
ldnull
|
|
callvirt System.Void StardewValley.ModHooks::OnGame1_Draw(Microsoft.Xna.Framework.GameTime,Microsoft.Xna.Framework.Graphics.RenderTarget2D)
|
|
|
|
|
|
|
|
Optional
|
|
|
|
GamePad Input
|
|
Modify class StardewValley.Game1, modify method updateAndroidMenus(), modify Instructions at beginning:
|
|
ldsfld StardewValley.InputState StardewValley.Game1::input
|
|
callvirt Microsoft.Xna.Framework.Input.GamePadState StardewValley.InputState::GetGamePadState()
|
|
|
|
|
|
Json Asset£º
|
|
checkForAction Prefix
|
|
|
|
0 ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
5 ldarg.0
|
|
6 callvirt System.Boolean StardewValley.ModHooks::OnObject_checkForAction(StardewValley.Object)
|
|
11 brtrue.s -> (6) ldarg.2
|
|
13 ldc.i4.0
|
|
14 ret
|
|
|
|
isIndexOkForBasicShippedCategory Postfix
|
|
0 ldarg.0
|
|
1 ldc.i4 434
|
|
6 bne.un.s -> (5) ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
8 ldc.i4.0
|
|
9 ret
|
|
10 ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
|
|
15 ldarg.0
|
|
16 ldloca.s -> (0) (System.Boolean)
|
|
18 callvirt System.Void StardewValley.ModHooks::OnObject_isIndexOkForBasicShippedCategory(System.Int32,System.Boolean&)
|
|
23 ldloc.0
|
|
24 ret |