2019-04-10 23:10:40 +08:00
|
|
|
|
1. Inject assembly reference, namespace: StardewModdingAPI
|
2019-04-10 01:22:10 +08:00
|
|
|
|
|
|
|
|
|
2.Modify class StardewValley.Game1, modify constructor method<6F><64>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);
|
2019-04-12 13:20:42 +08:00
|
|
|
|
public virtual void OnGame1_Draw(GameTime time, RenderTarget2D toBuffer);
|
2019-04-10 01:22:10 +08:00
|
|
|
|
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)
|
2019-04-12 13:20:42 +08:00
|
|
|
|
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
|
2019-04-12 23:40:59 +08:00
|
|
|
|
callvirt System.Void StardewValley.ModHooks::OnGame1_Draw(Microsoft.Xna.Framework.GameTime,Microsoft.Xna.Framework.Graphics.RenderTarget2D)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-14 13:34:51 +08:00
|
|
|
|
Optional
|
2019-04-12 23:40:59 +08:00
|
|
|
|
|
2019-04-14 13:34:51 +08:00
|
|
|
|
GamePad Input
|
2019-04-12 23:40:59 +08:00
|
|
|
|
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()
|
|
|
|
|
|
|
|
|
|
|
2019-04-14 13:34:51 +08:00
|
|
|
|
Json Asset<65><74>
|
|
|
|
|
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
|