2019-01-10 18:31:23 +08:00
using System ;
2018-12-21 05:34:08 +08:00
using System.Collections.Generic ;
2018-12-25 04:00:58 +08:00
using System.IO ;
2018-12-30 18:00:05 +08:00
using Microsoft.Xna.Framework ;
using PyTK.Extensions ;
using PyTK.Types ;
2019-01-10 10:05:03 +08:00
using Revitalize.Framework ;
2019-08-27 07:34:03 +08:00
using Revitalize.Framework.Crafting ;
2018-12-30 18:00:05 +08:00
using Revitalize.Framework.Environment ;
2019-08-27 07:34:03 +08:00
using Revitalize.Framework.Factories.Objects ;
2018-12-26 11:48:45 +08:00
using Revitalize.Framework.Illuminate ;
2018-12-30 18:00:05 +08:00
using Revitalize.Framework.Objects ;
2019-08-27 07:34:03 +08:00
using Revitalize.Framework.Objects.Furniture ;
2018-12-29 15:28:21 +08:00
using Revitalize.Framework.Player ;
2019-01-10 18:31:23 +08:00
using Revitalize.Framework.Utilities ;
2018-12-30 18:00:05 +08:00
using StardewModdingAPI ;
using StardewValley ;
using StardewValley.Objects ;
2019-07-16 17:09:42 +08:00
using StardustCore.UIUtilities ;
2019-07-18 01:18:51 +08:00
using StardustCore.Animations ;
2019-07-24 23:44:55 +08:00
using StardewValley.Menus ;
2019-08-27 07:34:03 +08:00
using Revitalize.Framework.Objects.Extras ;
2019-07-26 08:16:14 +08:00
using Revitalize.Framework.Minigame.SeasideScrambleMinigame ;
2019-08-27 07:34:03 +08:00
using Revitalize.Framework.Objects.Items.Resources ;
2019-08-21 16:39:06 +08:00
using Revitalize.Framework.Hacks ;
2019-08-30 10:51:13 +08:00
using Revitalize.Framework.Configs ;
2019-09-01 09:23:47 +08:00
using StardewValley.Locations ;
using System.Linq ;
2019-09-03 10:02:58 +08:00
using StardustCore.UIUtilities.MenuComponents.ComponentsV2.Buttons ;
using Revitalize.Framework.Menus ;
2019-09-05 05:20:05 +08:00
using Revitalize.Framework.Objects.CraftingTables ;
2019-09-07 05:15:54 +08:00
using Revitalize.Framework.Objects.Items.Tools ;
using StardewValley.Tools ;
2019-09-12 07:02:55 +08:00
using Revitalize.Framework.Menus.Machines ;
2019-09-19 08:33:45 +08:00
using Revitalize.Framework.Objects.Machines ;
2018-12-21 05:34:08 +08:00
namespace Revitalize
{
2019-05-16 13:27:38 +08:00
//Bugs:
// -Chair tops cut off objects
2019-09-01 09:23:47 +08:00
// -load content MUST be enabled for the table to be placed??????
2018-12-30 18:00:05 +08:00
// TODO:
2019-09-19 08:33:45 +08:00
/ *
2019-05-18 02:04:16 +08:00
// -Make this mod able to load content packs for easier future modding
2019-05-16 13:27:38 +08:00
/ /
2018-12-30 18:00:05 +08:00
// -Multiple Lights On Object
// -Illumination Colors
// Furniture:
2019-05-18 00:43:50 +08:00
// -rugs (done, needs factory info/sprite)
// -tables (done)
2019-05-22 03:10:57 +08:00
// -lamps (done)
2019-01-15 04:26:36 +08:00
// -chairs (done)
2019-05-16 05:27:33 +08:00
// -benches (done but needs factory info/sprite)
2019-08-06 14:46:06 +08:00
// -dressers/other storage containers (Done!)
2018-12-30 18:00:05 +08:00
// -fun interactables
2019-08-06 14:46:06 +08:00
// -Arcade machines
2019-09-19 08:33:45 +08:00
// -More crafting tables (done)
2019-08-22 10:06:17 +08:00
// -Baths (see chairs but swimming)
/ /
2018-12-30 18:00:05 +08:00
// -Machines
// !=Energy
2019-08-06 14:46:06 +08:00
// Generators:
- solar
- burnable
- watermill
- windmill
2019-08-22 10:06:17 +08:00
- crank ( costs stamina )
2019-08-06 14:46:06 +08:00
Storage :
- Batery Pack
2019-08-29 05:08:20 +08:00
- Mini - greenhouse
- takes fertilizer which can do things like help crops grow or increase prodcuction yield / quality .
- takes crop / extended crop seeds
- takes sprinklers
- has grid ( 1 x1 , 2 x2 , 3 x3 , 4 x4 , 5 x5 ) system for growing crops / placing sprinkers
- sprinkers auto water crops
- can auto harvest
- hover over crop to see it ' s info
- can be upgraded to grow crops from specific seasons with season stones ( spring , summer , fall winter ) ( configurable if they are required )
- Add in season stone recipe
2019-08-06 14:46:06 +08:00
2018-12-30 18:00:05 +08:00
// -Furnace
// -Seed Maker
// -Stone Quarry
2019-05-16 03:42:48 +08:00
// -Mayo Maker
// -Cheese Maker
2019-08-22 10:06:17 +08:00
- Yogurt Maker
- Fruit yogurts ( artisan good )
2019-05-16 03:42:48 +08:00
// -Auto fisher
// -Auto Preserves
// -Auto Keg
// -Auto Cask
2019-09-01 09:23:47 +08:00
// -Calcinator (oil+stone: produces titanum?)
2018-12-30 18:00:05 +08:00
// -Materials
2019-09-01 09:23:47 +08:00
// -Tin/Bronze/Alluminum/Silver?Platinum/Etc (all but platinum: may add in at a later date)
2019-09-19 08:33:45 +08:00
- titanium ( d0ne )
2019-07-16 17:09:42 +08:00
- Alloys !
2019-09-01 09:23:47 +08:00
- Brass ( done )
- Electrum ( done )
- Steel ( done )
- Bronze ( done )
2019-08-06 14:46:06 +08:00
- Mythrill
2019-09-01 09:23:47 +08:00
2019-08-06 14:46:06 +08:00
- Star Metal
- Star Steel
- Cobalt
2019-07-16 17:09:42 +08:00
- Liquids
- oil
- water
- coal
- juice ? ? ?
2019-08-06 14:46:06 +08:00
- lava ?
2019-08-29 05:33:56 +08:00
- Dyes !
- Dye custom objects certain colors !
- Rainbow Dye - ( set a custom object to any color )
- red , green , blue , yellow , pink , etc
2019-08-30 10:51:13 +08:00
- Make dye from flowers / coal / algee / minerals / gems ( black ) , etc
- soapstone ( washes off dye )
- Lunarite ( white )
2019-08-29 05:33:56 +08:00
Dye Machine
- takes custom object and dye
- dyes the object
- can use water to wash off dye .
2019-08-29 12:13:51 +08:00
- maybe dye stardew valley items ? ? ?
- Dyed Wool ( Artisan good )
2019-08-06 14:46:06 +08:00
Menus :
2018-12-30 18:00:05 +08:00
// -Crafting Menu
2019-08-06 14:46:06 +08:00
// -Item Grab Menu (Extendable) (Done!)
2019-05-24 07:53:44 +08:00
// -Yes/No Dialogue Box
// -Multi Choice dialogue box
2019-08-06 14:46:06 +08:00
2018-12-30 18:00:05 +08:00
// -Gift Boxes
2019-08-06 14:46:06 +08:00
2018-12-30 18:00:05 +08:00
// Magic!
// -Alchemy Bags
// -Transmutation
// -Effect Crystals
// -Spell books
// -Potions!
// -Magic Meter
2019-08-30 10:51:13 +08:00
// -Connected chests (3 digit color code) much like Project EE2 from MC
2019-01-06 14:25:22 +08:00
/ /
/ /
2019-08-06 14:46:06 +08:00
// -Food
2019-07-16 17:09:42 +08:00
- multi flavored sodas
2019-08-06 14:46:06 +08:00
2019-01-06 14:25:22 +08:00
// -Bigger chests
/ /
2018-12-30 18:00:05 +08:00
// Festivals
2019-08-06 14:46:06 +08:00
// -Firework festival
// -Horse Racing Festival
- Valentines day ( Maybe make this just one holiday )
- Spring . Male to female gifts .
- Winter . Female to male gifts .
2018-12-30 18:00:05 +08:00
// Stargazing???
// -Moon Phases+DarkerNight
// Bigger/Better Museum?
//
// Equippables!
// -accessories that provide buffs/regen/friendship
2019-01-06 14:25:22 +08:00
// -braclets/rings/broaches....more crafting for these???
2018-12-30 18:00:05 +08:00
//
// Music???
// -IDK maybe add in instruments???
//
// More buildings????
//
// More Animals???
//
// Readable Books?
//
// Custom NPCs for shops???
2019-08-06 14:46:06 +08:00
/ /
// Minigames:
// Frisbee Minigame?
// HorseRace Minigame/Betting?
2018-12-30 18:00:05 +08:00
//
// Locations:
2019-08-14 10:05:11 +08:00
- Make extra bus stop sign that travels between new towns / locations .
2018-12-30 18:00:05 +08:00
// -Small Island Home?
2019-08-06 14:46:06 +08:00
// -New town inspired by FOMT;Mineral Town/The Valley HM DS
/ /
2018-12-30 18:00:05 +08:00
// More crops
2019-08-06 14:46:06 +08:00
// -RF Crops
// -HM Crops
2019-01-06 14:25:22 +08:00
/ /
// More monsters
// -boss fights
/ /
// More dungeons??
2019-08-06 14:46:06 +08:00
// More NPCS?
Accessories
( recover hp / stamina , max hp , more friendship , run faster , take less damage , etc )
2019-09-01 09:23:47 +08:00
- Neckalces
2019-08-06 14:46:06 +08:00
- Broaches
- Earings
- Pendants
2019-09-04 04:49:21 +08:00
make chat notification when people are sleeping
2019-07-16 17:09:42 +08:00
* /
2018-12-25 15:34:38 +08:00
2018-12-21 05:34:08 +08:00
public class ModCore : Mod
{
public static IModHelper ModHelper ;
public static IMonitor ModMonitor ;
2019-05-22 03:10:57 +08:00
public static IManifest Manifest ;
2018-12-21 05:34:08 +08:00
2019-08-14 10:05:11 +08:00
/// <summary>
2019-08-23 10:09:58 +08:00
/// Keeps track of custom objects.
2019-08-14 10:05:11 +08:00
/// </summary>
2019-08-27 07:34:03 +08:00
public static ObjectManager ObjectManager ;
2018-12-21 05:34:08 +08:00
2019-08-14 10:05:11 +08:00
/// <summary>
/// Keeps track of all of the extra object groups.
/// </summary>
2019-08-27 07:34:03 +08:00
public static Dictionary < string , MultiTiledObject > ObjectGroups ;
2019-01-10 18:31:23 +08:00
2018-12-29 15:28:21 +08:00
public static PlayerInfo playerInfo ;
2018-12-21 05:34:08 +08:00
2019-01-10 18:31:23 +08:00
public static Serializer Serializer ;
2019-08-27 07:34:03 +08:00
public static Dictionary < GameLocation , MultiTiledObject > ObjectsToDraw ;
public static VanillaRecipeBook VanillaRecipeBook ;
2019-01-21 15:34:11 +08:00
2019-08-25 06:14:10 +08:00
public static Dictionary < Guid , CustomObject > CustomObjects ;
2019-09-07 05:15:54 +08:00
public static Dictionary < Guid , Item > CustomItems ;
2019-08-25 06:14:10 +08:00
2019-08-30 10:51:13 +08:00
public static ConfigManager Configs ;
2018-12-21 05:34:08 +08:00
public override void Entry ( IModHelper helper )
{
ModHelper = helper ;
2018-12-30 18:00:05 +08:00
ModMonitor = this . Monitor ;
2019-05-22 03:10:57 +08:00
Manifest = this . ModManifest ;
2019-08-30 10:51:13 +08:00
Configs = new ConfigManager ( ) ;
2018-12-25 04:00:58 +08:00
2018-12-30 18:00:05 +08:00
this . createDirectories ( ) ;
this . initailizeComponents ( ) ;
2019-08-17 05:35:40 +08:00
Serializer = new Serializer ( ) ;
2018-12-29 15:28:21 +08:00
playerInfo = new PlayerInfo ( ) ;
2019-08-28 15:31:14 +08:00
CustomObjects = new Dictionary < Guid , CustomObject > ( ) ;
2019-09-07 05:15:54 +08:00
CustomItems = new Dictionary < Guid , Item > ( ) ;
2019-01-09 14:15:58 +08:00
2019-08-23 10:09:58 +08:00
//Loads in textures to be used by the mod.
this . loadInTextures ( ) ;
2018-12-25 04:36:03 +08:00
2019-08-23 10:09:58 +08:00
//Loads in objects to be use by the mod.
2019-08-27 07:34:03 +08:00
ObjectGroups = new Dictionary < string , MultiTiledObject > ( ) ;
ObjectManager = new ObjectManager ( Manifest ) ;
ObjectsToDraw = new Dictionary < GameLocation , MultiTiledObject > ( ) ;
2019-05-16 03:42:48 +08:00
2019-08-23 10:09:58 +08:00
//Adds in event handling for the mod.
2019-08-14 11:13:27 +08:00
ModHelper . Events . GameLoop . SaveLoaded + = this . GameLoop_SaveLoaded ;
2019-09-05 05:20:05 +08:00
ModHelper . Events . GameLoop . SaveLoaded + = CraftingRecipeBook . AfterLoad_LoadRecipeBooks ;
ModHelper . Events . GameLoop . Saving + = CraftingRecipeBook . BeforeSave_SaveRecipeBooks ;
2019-08-14 11:13:27 +08:00
ModHelper . Events . GameLoop . TimeChanged + = this . GameLoop_TimeChanged ;
ModHelper . Events . GameLoop . UpdateTicked + = this . GameLoop_UpdateTicked ;
ModHelper . Events . GameLoop . ReturnedToTitle + = this . GameLoop_ReturnedToTitle ;
2019-09-05 05:20:05 +08:00
2019-08-27 07:34:03 +08:00
ModHelper . Events . Player . Warped + = ObjectManager . resources . OnPlayerLocationChanged ;
ModHelper . Events . GameLoop . DayStarted + = ObjectManager . resources . DailyResourceSpawn ;
2019-09-05 05:20:05 +08:00
ModHelper . Events . Input . ButtonPressed + = this . Input_ButtonPressed ;
2019-08-27 07:34:03 +08:00
ModHelper . Events . Input . ButtonPressed + = ObjectInteractionHacks . Input_CheckForObjectInteraction ;
2019-09-05 05:20:05 +08:00
2019-08-22 10:06:17 +08:00
ModHelper . Events . GameLoop . DayEnding + = Serializer . DayEnding_CleanUpFilesForDeletion ;
2019-08-27 07:34:03 +08:00
ModHelper . Events . Display . RenderedWorld + = ObjectInteractionHacks . Render_RenderCustomObjectsHeldInMachines ;
2019-08-21 16:39:06 +08:00
//ModHelper.Events.Display.Rendered += MenuHacks.EndOfDay_OnMenuChanged;
//ModHelper.Events.GameLoop.Saved += MenuHacks.EndOfDay_CleanupForNewDay;
2019-08-28 06:10:56 +08:00
ModHelper . Events . Multiplayer . ModMessageReceived + = MultiplayerUtilities . GetModMessage ;
2019-09-07 05:15:54 +08:00
ModHelper . Events . Input . ButtonPressed + = ObjectInteractionHacks . ResetNormalToolsColorOnLeftClick ;
2019-08-30 10:51:13 +08:00
2019-09-25 06:18:57 +08:00
ModHelper . Events . Input . ButtonPressed + = this . Input_ButtonPressed1 ;
2019-08-30 10:51:13 +08:00
2019-09-01 09:27:08 +08:00
ModHelper . Events . Display . MenuChanged + = MenuHacks . RecreateFarmhandInventory ;
2019-08-30 10:51:13 +08:00
2019-09-17 06:48:26 +08:00
ObjectManager . loadInItems ( ) ;
//Adds in recipes to the mod.
VanillaRecipeBook = new VanillaRecipeBook ( ) ;
CraftingRecipeBook . CraftingRecipesByGroup = new Dictionary < string , CraftingRecipeBook > ( ) ;
2018-12-21 05:34:08 +08:00
}
2019-09-01 09:23:47 +08:00
2019-09-25 06:18:57 +08:00
private void Input_ButtonPressed1 ( object sender , StardewModdingAPI . Events . ButtonPressedEventArgs e )
{
if ( e . Button = = SButton . MouseLeft )
{
if ( Game1 . player ! = null )
{
if ( Game1 . activeClickableMenu ! = null | | Game1 . eventUp | | Game1 . currentMinigame ! = null ) return ;
if ( Game1 . player . ActiveObject is CustomObject )
{
if ( ( Game1 . player . ActiveObject as CustomObject ) . canBePlacedHere ( Game1 . player . currentLocation , Game1 . currentCursorTile ) )
{
CustomObject o = ( CustomObject ) Game1 . player . ActiveObject ;
o . placementAction ( Game1 . currentLocation , ( int ) Game1 . currentCursorTile . X * Game1 . tileSize , ( int ) Game1 . currentCursorTile . Y * Game1 . tileSize , Game1 . player ) ;
//o.performObjectDropInAction(Game1.player.ActiveObject, true, Game1.player);
Game1 . player . reduceActiveItemByOne ( ) ;
playerInfo . justPlacedACustomObject = true ;
}
}
}
}
}
2019-09-07 05:15:54 +08:00
2019-08-23 10:09:58 +08:00
/// <summary>
/// Loads in textures to be used by the mod.
/// </summary>
private void loadInTextures ( )
{
TextureManager . AddTextureManager ( Manifest , "Furniture" ) ;
TextureManager . GetTextureManager ( Manifest , "Furniture" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Objects" , "Furniture" ) ) ;
2019-09-10 06:44:25 +08:00
TextureManager . AddTextureManager ( Manifest , "Machines" ) ;
TextureManager . GetTextureManager ( Manifest , "Machines" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Objects" , "Machines" ) ) ;
2019-08-23 10:09:58 +08:00
TextureManager . AddTextureManager ( Manifest , "InventoryMenu" ) ;
TextureManager . GetTextureManager ( Manifest , "InventoryMenu" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Menus" , "InventoryMenu" ) ) ;
TextureManager . AddTextureManager ( Manifest , "Resources.Ore" ) ;
TextureManager . GetTextureManager ( Manifest , "Resources.Ore" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Objects" , "Resources" , "Ore" ) ) ;
2019-09-10 07:07:39 +08:00
TextureManager . AddTextureManager ( Manifest , "Items.Resources.Misc" ) ;
TextureManager . GetTextureManager ( Manifest , "Items.Resources.Misc" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Items" , "Resources" , "Misc" ) ) ;
2019-08-23 10:09:58 +08:00
TextureManager . AddTextureManager ( Manifest , "Items.Resources.Ore" ) ;
TextureManager . GetTextureManager ( Manifest , "Items.Resources.Ore" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Items" , "Resources" , "Ore" ) ) ;
2019-09-07 05:15:54 +08:00
TextureManager . AddTextureManager ( Manifest , "Tools" ) ;
TextureManager . GetTextureManager ( Manifest , "Tools" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Items" , "Tools" ) ) ;
2019-09-03 10:02:58 +08:00
TextureManager . AddTextureManager ( Manifest , "Menus" ) ;
TextureManager . GetTextureManager ( Manifest , "Menus" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Menus" , "Misc" ) ) ;
2019-09-12 05:40:22 +08:00
TextureManager . AddTextureManager ( Manifest , "Menus.EnergyMenu" ) ;
TextureManager . GetTextureManager ( Manifest , "Menus.EnergyMenu" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Menus" , "EnergyMenu" ) ) ;
2019-09-03 11:48:29 +08:00
TextureManager . AddTextureManager ( Manifest , "CraftingMenu" ) ;
TextureManager . GetTextureManager ( Manifest , "CraftingMenu" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Menus" , "CraftingMenu" ) ) ;
2019-09-05 05:20:05 +08:00
2019-09-19 06:05:51 +08:00
TextureManager . AddTextureManager ( Manifest , "HUD" ) ;
TextureManager . GetTextureManager ( Manifest , "HUD" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "HUD" ) ) ;
2019-09-05 05:20:05 +08:00
TextureManager . AddTextureManager ( Manifest , "Objects.Crafting" ) ;
TextureManager . GetTextureManager ( Manifest , "Objects.Crafting" ) . searchForTextures ( ModHelper , this . ModManifest , Path . Combine ( "Content" , "Graphics" , "Objects" , "Crafting" ) ) ;
2019-09-07 05:15:54 +08:00
2019-08-23 10:09:58 +08:00
}
2019-07-18 01:18:51 +08:00
private void Input_ButtonPressed ( object sender , StardewModdingAPI . Events . ButtonPressedEventArgs e )
{
2019-08-06 12:19:56 +08:00
/ *
2019-07-18 01:18:51 +08:00
if ( e . Button = = SButton . U )
{
Game1 . currentMinigame = new Revitalize . Framework . Minigame . SeasideScrambleMinigame . SeasideScramble ( ) ;
}
2019-08-06 12:19:56 +08:00
* /
2019-09-12 05:40:22 +08:00
if ( e . Button = = SButton . U )
{
2019-09-22 15:18:48 +08:00
CraftingMenuV1 craft = new CraftingMenuV1 ( 100 , 100 , 600 , 800 , Color . White , Game1 . player . Items . ToList ( ) ) ;
2019-09-12 13:48:38 +08:00
craft . addInCraftingPageTab ( "Default" , new AnimatedButton ( new StardustCore . Animations . AnimatedSprite ( "Default Tab" , new Vector2 ( 100 + 48 , 100 + ( 24 * 4 ) ) , new AnimationManager ( TextureManager . GetExtendedTexture ( ModCore . Manifest , "Menus" , "MenuTabHorizontal" ) , new Animation ( 0 , 0 , 24 , 24 ) ) , Color . White ) , new Rectangle ( 0 , 0 , 24 , 24 ) , 2f ) ) ;
craft . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new List < CraftingRecipeComponent > ( )
{
//Inputs here
new CraftingRecipeComponent ( ModCore . ObjectManager . GetItem ( "SteelIngot" ) , 20 )
} , new CraftingRecipeComponent ( ModCore . ObjectManager . GetItem ( "Anvil" ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 32 , 32 ) , 1f , false , Color . White ) , "Default" ) ;
craft . currentTab = "Default" ;
craft . sortRecipes ( ) ;
Game1 . activeClickableMenu = craft ;
2019-09-12 05:40:22 +08:00
}
2019-08-27 12:14:37 +08:00
/ *
2019-08-06 14:46:06 +08:00
if ( e . Button = = SButton . Y )
2019-07-24 23:44:55 +08:00
{
//Game1.activeClickableMenu = new ItemGrabMenu(Game1.player.Items,false,true, new InventoryMenu.highlightThisItem(InventoryMenu.highlightAllItems),);
2019-08-06 12:19:56 +08:00
List < Item > newItems = new List < Item > ( )
{
new StardewValley . Object ( 184 , 10 )
} ;
2019-08-06 14:46:06 +08:00
Game1 . activeClickableMenu = new Revitalize . Framework . Menus . InventoryTransferMenu ( 100 , 100 , 500 , 500 , newItems , 36 ) ;
2019-07-24 23:44:55 +08:00
}
2019-08-27 12:14:37 +08:00
* /
2019-09-03 10:02:58 +08:00
if ( e . Button = = SButton . U )
{
2019-09-05 05:20:05 +08:00
/ *
2019-09-04 04:49:21 +08:00
CraftingMenuV1 menu = new Framework . Menus . CraftingMenuV1 ( 100 , 100 , 400 , 700 , Color . White , Game1 . player . Items ) ;
2019-09-03 10:02:58 +08:00
menu . addInCraftingPageTab ( "Default" , new AnimatedButton ( new StardustCore . Animations . AnimatedSprite ( "Default Tab" , new Vector2 ( 100 + 48 , 100 + ( 24 * 4 ) ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Menus" , "MenuTabHorizontal" ) , new Animation ( 0 , 0 , 24 , 24 ) ) , Color . White ) , new Rectangle ( 0 , 0 , 24 , 24 ) , 2f ) ) ;
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
2019-09-03 11:13:57 +08:00
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . Wool , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . FairyRose , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . PrismaticShard , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . OakResin , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . ChocolateCake , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . QualitySprinkler , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . JackOLantern , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . WildPlum , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . Egg , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
menu . addInCraftingRecipe ( new Framework . Menus . MenuComponents . CraftingRecipeButton ( new Recipe ( new Dictionary < Item , int > ( )
{
//Inputs here
{ new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 1 ) , 1 } ,
2019-09-04 06:12:34 +08:00
} , new KeyValuePair < Item , int > ( new StardewValley . Object ( ( int ) Enums . SDVObject . BakedFish , 1 ) , 1 ) ) , null , new Vector2 ( ) , new Rectangle ( 0 , 0 , 16 , 16 ) , 4f , true , Color . White ) , "Default" ) ;
2019-09-04 05:22:00 +08:00
2019-09-03 10:02:58 +08:00
menu . currentTab = "Default" ;
2019-09-04 06:12:34 +08:00
menu . sortRecipes ( ) ;
2019-09-03 10:02:58 +08:00
if ( Game1 . activeClickableMenu = = null ) Game1 . activeClickableMenu = menu ;
2019-09-05 05:20:05 +08:00
* /
2019-09-03 10:02:58 +08:00
}
2019-07-18 01:18:51 +08:00
}
2019-01-13 03:25:45 +08:00
private void GameLoop_ReturnedToTitle ( object sender , StardewModdingAPI . Events . ReturnedToTitleEventArgs e )
{
Serializer . returnToTitle ( ) ;
2019-08-27 07:34:03 +08:00
ObjectManager = new ObjectManager ( Manifest ) ;
2019-01-13 03:25:45 +08:00
}
2019-05-17 04:00:43 +08:00
/// <summary>
/// Must be enabled for the tabled to be placed????
/// </summary>
2019-01-10 18:31:23 +08:00
private void loadContent ( )
2018-12-21 05:34:08 +08:00
{
2019-08-27 07:34:03 +08:00
MultiTiledComponent obj = new MultiTiledComponent ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.MultiTiledComponent.Test" , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , typeof ( MultiTiledComponent ) , Color . White ) , new BasicItemInformation ( "CoreObjectTest" , "Omegasis.TEST1" , "YAY FUN!" , "Omegasis.Revitalize.MultiTiledComponent.Test" , Color . White , - 300 , 0 , false , 300 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Furniture" , "Oak Chair" ) , new Animation ( new Rectangle ( 0 , 0 , 16 , 16 ) ) ) , Color . White , false , null , null ) ) ;
MultiTiledComponent obj2 = new MultiTiledComponent ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.MultiTiledComponent.Test" , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , typeof ( MultiTiledComponent ) , Color . White ) , new BasicItemInformation ( "CoreObjectTest2" , "Omegasis.TEST2" , "Some fun!" , "Omegasis.Revitalize.MultiTiledComponent.Test" , Color . White , - 300 , 0 , false , 300 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Furniture" , "Oak Chair" ) , new Animation ( new Rectangle ( 0 , 16 , 16 , 16 ) ) ) , Color . White , false , null , null ) ) ;
MultiTiledComponent obj3 = new MultiTiledComponent ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.MultiTiledComponent.Test" , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , typeof ( MultiTiledComponent ) , Color . White ) , new BasicItemInformation ( "CoreObjectTest3" , "Omegasis.TEST3" , "NoFun" , "Omegasis.Revitalize.MultiTiledComponent.Test" , Color . White , - 300 , 0 , false , 100 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Furniture" , "Oak Chair" ) , new Animation ( new Rectangle ( 0 , 32 , 16 , 16 ) ) ) , Color . Red , false , null , null ) ) ;
2018-12-21 05:34:08 +08:00
2018-12-26 11:48:45 +08:00
2019-05-18 02:04:16 +08:00
obj3 . info . lightManager . addLight ( new Vector2 ( Game1 . tileSize ) , new LightSource ( 4 , new Vector2 ( 0 , 0 ) , 2.5f , Color . Orange . Invert ( ) ) , obj3 ) ;
2019-08-06 14:46:06 +08:00
2019-08-17 05:35:40 +08:00
MultiTiledObject bigObject = new MultiTiledObject ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.MultiTiledComponent.Test" , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , typeof ( MultiTiledObject ) , Color . White ) , new BasicItemInformation ( "MultiTest" , "Omegasis.BigTiledTest" , "A really big object" , "Omegasis.Revitalize.MultiTiledObject" , Color . Blue , - 300 , 0 , false , 500 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , new AnimationManager ( ) , Color . White , false , null , null ) ) ;
2019-07-16 17:09:42 +08:00
2019-05-18 00:43:50 +08:00
bigObject . addComponent ( new Vector2 ( 0 , 0 ) , obj ) ;
bigObject . addComponent ( new Vector2 ( 1 , 0 ) , obj2 ) ;
bigObject . addComponent ( new Vector2 ( 2 , 0 ) , obj3 ) ;
2019-08-06 14:46:06 +08:00
2019-09-05 05:20:05 +08:00
/ *
2018-12-25 14:02:25 +08:00
Recipe pie = new Recipe ( new Dictionary < Item , int > ( )
{
[bigObject] = 1
2019-01-10 10:05:03 +08:00
} , new KeyValuePair < Item , int > ( new Furniture ( 3 , Vector2 . Zero ) , 1 ) , new StatCost ( 100 , 50 , 0 , 0 ) ) ;
2019-09-05 05:20:05 +08:00
* /
2018-12-25 14:02:25 +08:00
2019-08-14 10:05:11 +08:00
ObjectManager . miscellaneous . Add ( "Omegasis.BigTiledTest" , bigObject ) ;
2019-08-06 14:46:06 +08:00
2019-08-17 05:35:40 +08:00
Framework . Objects . Furniture . RugTileComponent rug1 = new RugTileComponent ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.Furniture.Basic.Rugs.TestRug" , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , typeof ( RugTileComponent ) , Color . White ) , new BasicItemInformation ( "Rug Tile" , "Omegasis.Revitalize.Furniture.Basic.Rugs.TestRug" , "A rug tile" , "Rug" , Color . Brown , - 300 , 0 , false , 100 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Furniture" , "Oak Chair" ) , new Animation ( new Rectangle ( 0 , 0 , 16 , 16 ) ) ) , Color . White , true , null , null ) ) ;
2019-07-16 17:09:42 +08:00
2019-08-17 05:35:40 +08:00
Framework . Objects . Furniture . RugMultiTiledObject rug = new RugMultiTiledObject ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.Furniture.Basic.Rugs.TestRug" , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , typeof ( RugMultiTiledObject ) , Color . White , false ) , new BasicItemInformation ( "Simple Rug Test" , "Omegasis.Revitalize.Furniture.Basic.Rugs.TestRug" , "A simple rug for testing" , "Rugs" , Color . Brown , - 300 , 0 , false , 500 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "Oak Chair" ) , new AnimationManager ( ) , Color . White , true , null , null ) ) ;
2019-07-16 17:09:42 +08:00
2019-01-21 16:01:07 +08:00
rug . addComponent ( new Vector2 ( 0 , 0 ) , rug1 ) ;
2019-08-14 10:05:11 +08:00
ObjectManager . miscellaneous . Add ( "Omegasis.Revitalize.Furniture.Rugs.RugTest" , rug ) ;
2019-05-16 04:43:09 +08:00
2019-08-06 14:46:06 +08:00
2019-07-26 08:16:14 +08:00
SeasideScramble sscGame = new SeasideScramble ( ) ;
2019-08-17 05:35:40 +08:00
ArcadeCabinetTile ssc1 = new ArcadeCabinetTile ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , TextureManager . GetTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , typeof ( ArcadeCabinetTile ) , Color . White ) , new BasicItemInformation ( "Seaside Scramble Arcade Game" , "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , "A arcade to play Seaside Scramble!" , "Arcades" , Color . LimeGreen , - 300 , 0 , false , 100 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , new Animation ( new Rectangle ( 0 , 0 , 16 , 16 ) ) , new Dictionary < string , List < Animation > > ( )
2019-07-26 08:16:14 +08:00
{
{ "Animated" , new List < Animation > ( )
{
new Animation ( 0 , 0 , 16 , 16 , 60 ) ,
new Animation ( 16 , 0 , 16 , 16 , 60 )
}
}
2019-08-06 14:46:06 +08:00
} , "Animated" ) , Color . White , false , null , null ) , new Framework . Objects . InformationFiles . Furniture . ArcadeCabinetInformation ( sscGame , false ) ) ;
2019-08-17 05:35:40 +08:00
ArcadeCabinetTile ssc2 = new ArcadeCabinetTile ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , TextureManager . GetTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , typeof ( ArcadeCabinetTile ) , Color . White ) , new BasicItemInformation ( "Seaside Scramble Arcade Game" , "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , "A arcade to play Seaside Scramble!" , "Arcades" , Color . LimeGreen , - 300 , 0 , false , 100 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , new AnimationManager ( TextureManager . GetExtendedTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , new Animation ( new Rectangle ( 0 , 16 , 16 , 16 ) ) , new Dictionary < string , List < Animation > > ( )
2019-07-26 08:16:14 +08:00
{
{ "Animated" , new List < Animation > ( )
{
new Animation ( 0 , 16 , 16 , 16 , 60 ) ,
new Animation ( 16 , 16 , 16 , 16 , 60 )
}
}
} , "Animated" ) , Color . White , false , null , null ) , new Framework . Objects . InformationFiles . Furniture . ArcadeCabinetInformation ( sscGame , false ) ) ;
2019-08-17 05:35:40 +08:00
ArcadeCabinetOBJ sscCabinet = new ArcadeCabinetOBJ ( PyTKHelper . CreateOBJData ( "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , TextureManager . GetTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , typeof ( ArcadeCabinetOBJ ) , Color . White , true ) , new BasicItemInformation ( "Seaside Scramble Arcade Game" , "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , "A arcade to play Seaside Scramble!" , "Arcades" , Color . LimeGreen , - 300 , 0 , false , 500 , true , true , TextureManager . GetTexture ( Manifest , "Furniture" , "SeasideScrambleArcade" ) , new AnimationManager ( ) , Color . White , true , null , null ) ) ;
2019-08-06 14:46:06 +08:00
sscCabinet . addComponent ( new Vector2 ( 0 , 0 ) , ssc1 ) ;
2019-07-26 08:16:14 +08:00
sscCabinet . addComponent ( new Vector2 ( 0 , 1 ) , ssc2 ) ;
2019-08-14 10:05:11 +08:00
ObjectManager . miscellaneous . Add ( "Omegasis.Revitalize.Furniture.Arcade.SeasideScramble" , sscCabinet ) ;
2019-07-26 08:16:14 +08:00
2019-08-22 10:06:17 +08:00
//ModCore.log("Added in SSC!");
2019-09-05 05:20:05 +08:00
2019-01-10 18:31:23 +08:00
}
private void createDirectories ( )
{
Directory . CreateDirectory ( Path . Combine ( this . Helper . DirectoryPath , "Configs" ) ) ;
Directory . CreateDirectory ( Path . Combine ( this . Helper . DirectoryPath , "Content" ) ) ;
2019-08-06 14:46:06 +08:00
Directory . CreateDirectory ( Path . Combine ( this . Helper . DirectoryPath , "Content" , "Graphics" ) ) ;
2019-05-24 07:53:44 +08:00
//Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath, "Content", "Graphics","Furniture"));
2019-08-06 14:46:06 +08:00
Directory . CreateDirectory ( Path . Combine ( this . Helper . DirectoryPath , "Content" , "Graphics" , "Furniture" , "Chairs" ) ) ;
2019-05-24 07:53:44 +08:00
Directory . CreateDirectory ( Path . Combine ( this . Helper . DirectoryPath , "Content" , "Graphics" , "Furniture" , "Lamps" ) ) ;
Directory . CreateDirectory ( Path . Combine ( this . Helper . DirectoryPath , "Content" , "Graphics" , "Furniture" , "Tables" ) ) ;
2019-01-10 18:31:23 +08:00
}
2019-01-09 14:15:58 +08:00
2019-07-24 23:44:55 +08:00
/// <summary>
/// Initialize all modular components for this mod.
/// </summary>
2019-01-10 18:31:23 +08:00
private void initailizeComponents ( )
{
DarkerNight . InitializeConfig ( ) ;
}
2018-12-30 18:00:05 +08:00
2019-01-10 18:31:23 +08:00
private void GameLoop_UpdateTicked ( object sender , StardewModdingAPI . Events . UpdateTickedEventArgs e )
{
2019-09-25 06:18:57 +08:00
if ( playerInfo . justPlacedACustomObject = = true ) playerInfo . justPlacedACustomObject = false ;
2019-01-10 18:31:23 +08:00
DarkerNight . SetDarkerColor ( ) ;
playerInfo . update ( ) ;
}
private void GameLoop_TimeChanged ( object sender , StardewModdingAPI . Events . TimeChangedEventArgs e )
{
DarkerNight . CalculateDarkerNightColor ( ) ;
}
private void GameLoop_SaveLoaded ( object sender , StardewModdingAPI . Events . SaveLoadedEventArgs e )
{
2019-09-17 06:48:26 +08:00
//this.loadContent();
2019-09-12 09:04:12 +08:00
2019-08-22 11:17:27 +08:00
Serializer . afterLoad ( ) ;
2019-09-08 10:04:24 +08:00
ShopHacks . AddInCustomItemsToShops ( ) ;
2019-09-01 02:47:15 +08:00
ObjectInteractionHacks . AfterLoad_RestoreTrackedMachines ( ) ;
2019-08-22 10:06:17 +08:00
2019-08-22 11:03:16 +08:00
2019-08-06 14:46:06 +08:00
// Game1.player.addItemToInventory(GetObjectFromPool("Omegasis.BigTiledTest"));
2019-09-05 05:20:05 +08:00
//Game1.player.addItemToInventory(ObjectManager.getChair("Omegasis.Revitalize.Furniture.Chairs.OakChair"));
Game1 . player . addItemToInventoryBool ( ObjectManager . GetItem ( "Workbench" ) ) ;
2019-09-10 06:44:25 +08:00
2019-09-19 08:33:45 +08:00
MultiTiledObject batteryBin = ( MultiTiledObject ) ModCore . ObjectManager . GetItem ( "BatteryBin" , 1 ) ;
batteryBin . dyeColor ( Framework . Illuminate . ColorsList . Lime ) ;
2019-09-10 06:44:25 +08:00
2019-09-08 06:54:45 +08:00
//PickaxeExtended pick = new PickaxeExtended(new BasicItemInformation("My First Pickaxe", "Omegasis.Revitalize.Items.Tools.MyFirstPickaxe", "A testing pickaxe. Does it work?", "Tool", Color.SlateGray, 0, 0, false, 500, false, false, TextureManager.GetTexture(Manifest, "Tools", "Pickaxe"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Tools", "Pickaxe"), new Animation(0, 0, 16, 16)), Color.White, true, null, null),2,TextureManager.GetExtendedTexture(Manifest,"Tools","TestingPickaxeWorking"));
2019-09-07 05:15:54 +08:00
Game1 . player . addItemsByMenuIfNecessary ( new List < Item > ( )
{
2019-09-17 10:17:23 +08:00
new StardewValley . Object ( ( int ) Enums . SDVObject . Coal , 100 ) ,
2019-09-08 10:04:24 +08:00
ModCore . ObjectManager . GetItem ( "SteelIngot" , 20 ) ,
2019-09-10 06:44:25 +08:00
ModCore . ObjectManager . GetItem ( "TrashCan" , 1 ) ,
2019-09-17 10:17:23 +08:00
ModCore . ObjectManager . resources . getResource ( "Sand" , 5 ) ,
2019-09-17 06:48:26 +08:00
ModCore . ObjectManager . GetItem ( "Anvil" , 1 ) ,
ModCore . ObjectManager . GetItem ( "SolarPanelTier1" , 1 ) ,
2019-09-17 10:17:23 +08:00
ModCore . ObjectManager . GetItem ( "SolarArrayTier1" , 1 ) ,
2019-09-17 12:53:21 +08:00
new StardewValley . Object ( Vector2 . Zero , ( int ) Enums . SDVBigCraftable . Furnace , false ) ,
2019-09-20 05:44:46 +08:00
ModCore . ObjectManager . GetItem ( "CopperWire" , 10 ) ,
batteryBin ,
2019-09-20 06:44:02 +08:00
ModCore . ObjectManager . GetItem ( "Capacitor" , 1 ) ,
2019-09-20 10:07:15 +08:00
ModCore . ObjectManager . GetItem ( "ChargingStation" , 1 ) ,
2019-09-22 05:39:16 +08:00
new StardewValley . Object ( ( int ) Enums . SDVObject . CopperOre , 10 ) ,
2019-09-22 09:48:21 +08:00
ModCore . ObjectManager . GetTool ( "ChainsawV1" ) ,
2019-09-23 02:12:07 +08:00
ModCore . ObjectManager . GetItem ( "MiningDrillMachineV1" ) ,
ModCore . ObjectManager . GetItem ( "AlloyFurnace" ) ,
new StardewValley . Object ( ( int ) Enums . SDVObject . IronBar , 100 ) ,
2019-09-25 08:31:33 +08:00
ModCore . ObjectManager . GetItem ( "WaterPumpV1" ) ,
2019-09-26 06:02:58 +08:00
ModCore . ObjectManager . GetItem ( "SteamBoilerV1" ) ,
2019-10-04 14:42:16 +08:00
ModCore . ObjectManager . GetItem ( "IronPipe" , 100 ) ,
2019-10-09 04:01:58 +08:00
ModCore . ObjectManager . GetItem ( "SteamEngineV1" ) ,
ModCore . ObjectManager . GetItem ( "WindmillV1" ) ,
ModCore . ObjectManager . GetItem ( "WindmillV2" )
2019-09-07 05:15:54 +08:00
} ) ;
2018-12-21 05:34:08 +08:00
}
2019-08-14 10:05:11 +08:00
/ *
2019-05-16 03:42:48 +08:00
public static Item GetObjectFromPool ( string objName )
2019-01-13 10:12:14 +08:00
{
if ( customObjects . ContainsKey ( objName ) )
{
2019-08-06 14:46:06 +08:00
CustomObject i = ( CustomObject ) customObjects [ objName ] . getOne ( ) ;
2019-05-17 04:00:43 +08:00
return i ;
2019-01-13 10:12:14 +08:00
}
else
{
throw new Exception ( "Object Key name not found: " + objName ) ;
}
}
2019-08-14 10:05:11 +08:00
* /
2019-08-06 14:46:06 +08:00
2019-08-14 10:05:11 +08:00
/// <summary>
///Logs information to the console.
/// </summary>
/// <param name="message"></param>
2019-08-30 10:51:13 +08:00
public static void log ( object message , bool StackTrace = true )
2018-12-21 05:34:08 +08:00
{
2019-08-30 10:51:13 +08:00
if ( StackTrace )
{
ModMonitor . Log ( message . ToString ( ) + " " + getFileDebugInfo ( ) ) ;
}
else
{
ModMonitor . Log ( message . ToString ( ) ) ;
}
2019-08-22 10:06:17 +08:00
}
public static string getFileDebugInfo ( )
{
string currentFile = new System . Diagnostics . StackTrace ( true ) . GetFrame ( 2 ) . GetFileName ( ) ;
int currentLine = new System . Diagnostics . StackTrace ( true ) . GetFrame ( 2 ) . GetFileLineNumber ( ) ;
return currentFile + " line:" + currentLine ;
}
public static bool IsNullOrDefault < T > ( T argument )
{
// deal with normal scenarios
if ( argument = = null ) return true ;
if ( object . Equals ( argument , default ( T ) ) ) return true ;
// deal with non-null nullables
Type methodType = typeof ( T ) ;
if ( Nullable . GetUnderlyingType ( methodType ) ! = null ) return false ;
// deal with boxed value types
Type argumentType = argument . GetType ( ) ;
if ( argumentType . IsValueType & & argumentType ! = methodType )
{
object obj = Activator . CreateInstance ( argument . GetType ( ) ) ;
return obj . Equals ( argument ) ;
}
return false ;
2018-12-21 05:34:08 +08:00
}
}
}