2017-09-13 02:20:18 +08:00
using Microsoft.Xna.Framework.Input ;
using StardewModdingAPI ;
using StardewValley ;
using StardewValley.Menus ;
2017-09-12 14:39:59 +08:00
using StardustCore.ModInfo ;
2017-09-05 19:13:42 +08:00
using System ;
2017-07-14 11:27:48 +08:00
using System.Collections.Generic ;
using System.Linq ;
using System.Text ;
using System.Threading.Tasks ;
2017-09-05 19:13:42 +08:00
namespace StardustCore
2017-07-14 11:27:48 +08:00
{
2017-09-05 19:13:42 +08:00
public class ModCore : Mod
2017-07-14 11:27:48 +08:00
{
2017-09-12 09:35:31 +08:00
public static IModHelper ModHelper ;
public static IMonitor ModMonitor ;
public override void Entry ( IModHelper helper )
{
ModHelper = helper ;
ModMonitor = this . Monitor ;
2017-09-13 07:30:30 +08:00
//Unused MetaData information. Works in player inventory but not in chests. Besides who really care where an object is from anyways. Also doesn't work 100% like I intended since it only gets base mod object that this runs from, not extensions?
2017-09-13 02:20:18 +08:00
2017-09-13 17:39:50 +08:00
// StardewModdingAPI.Events.GraphicsEvents.OnPostRenderGuiEvent += Metadata.GameEvents_UpdateTick;
// StardewModdingAPI.Events.ControlEvents.MouseChanged += ControlEvents_MouseChanged;
2017-09-13 02:20:18 +08:00
}
private void ControlEvents_MouseChanged ( object sender , StardewModdingAPI . Events . EventArgsMouseStateChanged e )
{
if ( Game1 . activeClickableMenu = = null ) return ;
var MouseState = Mouse . GetState ( ) ;
if ( Game1 . activeClickableMenu is StardewValley . Menus . ItemGrabMenu & & MouseState . LeftButton = = ButtonState . Released )
{
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . populateClickableComponentList ( ) ;
for ( int index = 0 ; index < ( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory . Count ; + + index )
{
if ( ( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] ! = null )
{
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] . myID + = 53910 ;
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] . upNeighborID + = 53910 ;
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] . rightNeighborID + = 53910 ;
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] . downNeighborID = - 7777 ;
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] . leftNeighborID + = 53910 ;
( Game1 . activeClickableMenu as StardewValley . Menus . ItemGrabMenu ) . ItemsToGrabMenu . inventory [ index ] . fullyImmutable = true ;
}
}
// (Game1.activeClickableMenu as ItemGrabMenu).inventory.playerInventory = false;
// Game1.activeClickableMenu =Game1.activeClickableMenu;//new ItemGrabMenu((Game1.activeClickableMenu as ItemGrabMenu).ItemsToGrabMenu.actualInventory,true,true,null,null,null,null,false,false,true,true,true,1,null,-1,null);
}
2017-09-12 09:35:31 +08:00
}
2017-07-14 11:27:48 +08:00
}
}