Social Page: NPC Shader

This commit is contained in:
Joshua Navarro 2018-07-18 11:48:37 -07:00 committed by GitHub
parent 9c6b2efccd
commit 0509259a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 0 deletions

View File

@ -160,6 +160,39 @@ namespace ShaderExample
} }
} }
if ((Game1.activeClickableMenu as StardewValley.Menus.GameMenu).currentTab == 2)
{
var pageField = GetInstanceField(typeof(StardewValley.Menus.GameMenu), Game1.activeClickableMenu, "pages");
var pages = (List<IClickableMenu>)pageField;
var v = pages.ElementAt(2);
if (v == null)
{
Monitor.Log("WHATTT?????");
}
int slotPosition2=(int)GetInstanceField(typeof(StardewValley.Menus.SocialPage), v, "slotPosition");
var sprites = (List<ClickableTextureComponent>)GetInstanceField(typeof(StardewValley.Menus.SocialPage), v, "sprites");
var names = (List<object>)GetInstanceField(typeof(StardewValley.Menus.SocialPage), v, "names");
for (int slotPosition = slotPosition2; slotPosition < slotPosition2 + 5; ++slotPosition)
{
if (slotPosition < sprites.Count)
{
if (names[slotPosition] is string)
getInvokeMethod(v, "drawNPCSlot", new object[]{
Game1.spriteBatch, slotPosition
});
else if (names[slotPosition] is long)
getInvokeMethod(v, "drawFarmerSlot", new object[]{
Game1.spriteBatch, slotPosition
});
}
}
}
Game1.activeClickableMenu.upperRightCloseButton.draw(Game1.spriteBatch); Game1.activeClickableMenu.upperRightCloseButton.draw(Game1.spriteBatch);
Game1.activeClickableMenu.drawMouse(Game1.spriteBatch); Game1.activeClickableMenu.drawMouse(Game1.spriteBatch);
Game1.spriteBatch.End(); Game1.spriteBatch.End();
@ -194,6 +227,12 @@ namespace ShaderExample
//Game1.spriteBatch.End(); //Game1.spriteBatch.End();
} }
public void getInvokeMethod(object target, string name ,object[] param)
{
var hello=target.GetType().GetMethod(name, BindingFlags.Public | BindingFlags.NonPublic| BindingFlags.Instance| BindingFlags.Static);
hello.Invoke(target, param);
}
public void drawMapPart2() public void drawMapPart2()
{ {
//Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); //Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);