expose some private fields for modding

This commit is contained in:
Zoryn Aaron 2016-02-28 22:16:32 -05:00
parent bade4554d0
commit 524dc9e002
9 changed files with 474 additions and 4 deletions

View File

@ -0,0 +1,40 @@
Single difficulty
Int32 motionType
Int32 whichFish
Single bobberPosition
Single bobberSpeed
Single bobberAcceleration
Single bobberTargetPosition
Single scale
Single everythingShakeTimer
Single floaterSinkerAcceleration
Single treasurePosition
Single treasureCatchLevel
Single treasureAppearTimer
Single treasureScale
Boolean bobberInBar
Boolean buttonPressed
Boolean flipBubble
Boolean fadeIn
Boolean fadeOut
Boolean treasure
Boolean treasureCaught
Boolean perfect
Boolean bossFish
Int32 bobberBarHeight
Int32 fishSize
Int32 fishQuality
Int32 minFishSize
Int32 maxFishSize
Int32 fishSizeReductionTimer
Int32 whichBobber
Microsoft.Xna.Framework.Vector2 barShake
Microsoft.Xna.Framework.Vector2 fishShake
Microsoft.Xna.Framework.Vector2 everythingShake
Microsoft.Xna.Framework.Vector2 treasureShake
Single reelRotation
StardewValley.BellsAndWhistles.SparklingText sparkleText
Single bobberBarPos
Single bobberBarSpeed
Single bobberBarAcceleration
Single distanceFromCatching

329
Game1 Static Fields.txt Normal file
View File

@ -0,0 +1,329 @@
Int32 pixelZoom
Int32 tileSize
System.String version
Microsoft.Xna.Framework.GraphicsDeviceManager graphics
Microsoft.Xna.Framework.Content.ContentManager content
Microsoft.Xna.Framework.Content.ContentManager temporaryContent
Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch
Microsoft.Xna.Framework.Input.GamePadState oldPadState
Single thumbStickSensitivity
Single runThreshold
Microsoft.Xna.Framework.Input.KeyboardState oldKBState
Microsoft.Xna.Framework.Input.MouseState oldMouseState
System.Collections.Generic.List`1[StardewValley.GameLocation] locations
StardewValley.GameLocation currentLocation
StardewValley.GameLocation locationAfterWarp
xTile.Display.IDisplayDevice mapDisplayDevice
StardewValley.Farmer player
StardewValley.Farmer serverHost
xTile.Dimensions.Rectangle viewport
Microsoft.Xna.Framework.Graphics.Texture2D objectSpriteSheet
Microsoft.Xna.Framework.Graphics.Texture2D toolSpriteSheet
Microsoft.Xna.Framework.Graphics.Texture2D cropSpriteSheet
Microsoft.Xna.Framework.Graphics.Texture2D mailboxTexture
Microsoft.Xna.Framework.Graphics.Texture2D emoteSpriteSheet
Microsoft.Xna.Framework.Graphics.Texture2D debrisSpriteSheet
Microsoft.Xna.Framework.Graphics.Texture2D toolIconBox
Microsoft.Xna.Framework.Graphics.Texture2D rainTexture
Microsoft.Xna.Framework.Graphics.Texture2D bigCraftableSpriteSheet
Microsoft.Xna.Framework.Graphics.Texture2D swordSwipe
Microsoft.Xna.Framework.Graphics.Texture2D swordSwipeDark
Microsoft.Xna.Framework.Graphics.Texture2D buffsIcons
Microsoft.Xna.Framework.Graphics.Texture2D daybg
Microsoft.Xna.Framework.Graphics.Texture2D nightbg
Microsoft.Xna.Framework.Graphics.Texture2D logoScreenTexture
Microsoft.Xna.Framework.Graphics.Texture2D tvStationTexture
Microsoft.Xna.Framework.Graphics.Texture2D cloud
Microsoft.Xna.Framework.Graphics.Texture2D menuTexture
Microsoft.Xna.Framework.Graphics.Texture2D lantern
Microsoft.Xna.Framework.Graphics.Texture2D windowLight
Microsoft.Xna.Framework.Graphics.Texture2D sconceLight
Microsoft.Xna.Framework.Graphics.Texture2D cauldronLight
Microsoft.Xna.Framework.Graphics.Texture2D shadowTexture
Microsoft.Xna.Framework.Graphics.Texture2D mouseCursors
Microsoft.Xna.Framework.Graphics.Texture2D indoorWindowLight
Microsoft.Xna.Framework.Graphics.Texture2D animations
Microsoft.Xna.Framework.Graphics.Texture2D titleScreenBG
Microsoft.Xna.Framework.Graphics.Texture2D logo
Microsoft.Xna.Framework.Graphics.RenderTarget2D lightmap
Microsoft.Xna.Framework.Graphics.Texture2D fadeToBlackRect
Microsoft.Xna.Framework.Graphics.Texture2D staminaRect
Microsoft.Xna.Framework.Graphics.Texture2D currentCoopTexture
Microsoft.Xna.Framework.Graphics.Texture2D currentBarnTexture
Microsoft.Xna.Framework.Graphics.Texture2D currentHouseTexture
Microsoft.Xna.Framework.Graphics.Texture2D greenhouseTexture
Microsoft.Xna.Framework.Graphics.Texture2D littleEffect
Microsoft.Xna.Framework.Graphics.SpriteFont dialogueFont
Microsoft.Xna.Framework.Graphics.SpriteFont smallFont
Microsoft.Xna.Framework.Graphics.SpriteFont borderFont
Microsoft.Xna.Framework.Graphics.SpriteFont tinyFont
Microsoft.Xna.Framework.Graphics.SpriteFont tinyFontBorder
Microsoft.Xna.Framework.Graphics.SpriteFont smoothFont
Single fadeToBlackAlpha
Single pickToolInterval
Single screenGlowAlpha
Single flashAlpha
Single starCropShimmerPause
Single noteBlockTimer
Single globalFadeSpeed
Boolean fadeToBlack
Boolean fadeIn
Boolean dialogueUp
Boolean dialogueTyping
Boolean pickingTool
Boolean isQuestion
Boolean nonWarpFade
Boolean particleRaining
Boolean newDay
Boolean inMine
Boolean isEating
Boolean menuUp
Boolean eventUp
Boolean viewportFreeze
Boolean eventOver
Boolean nameSelectUp
Boolean screenGlow
Boolean screenGlowHold
Boolean screenGlowUp
Boolean progressBar
Boolean isRaining
Boolean isSnowing
Boolean killScreen
Boolean coopDwellerBorn
Boolean messagePause
Boolean isDebrisWeather
Boolean boardingBus
Boolean listeningForKeyControlDefinitions
Boolean weddingToday
Boolean exitToTitle
Boolean debugMode
Boolean isLightning
Boolean displayHUD
Boolean displayFarmer
Boolean showKeyHelp
Boolean inputMode
Boolean shippingTax
Boolean dialogueButtonShrinking
Boolean jukeboxPlaying
Boolean drawLighting
Boolean bloomDay
Boolean quit
Boolean isChatting
Boolean globalFade
Boolean drawGrid
Boolean freezeControls
Boolean saveOnNewDay
Boolean panMode
Boolean showingEndOfNightStuff
Boolean wasRainingYesterday
Boolean hasLoadedGame
Boolean isActionAtCurrentCursorTile
Boolean isInspectionAtCurrentCursorTile
Boolean paused
Boolean lastCursorMotionWasMouse
System.String currentSeason
System.String debugOutput
System.String nextMusicTrack
System.String selectedItemsType
System.String nameSelectType
System.String messageAfterPause
System.String fertilizer
System.String samBandName
System.String elliottBookName
System.String slotResult
System.String keyHelpString
System.String debugInput
System.String loadingMessage
System.String errorMessage
System.Collections.Generic.Queue`1[System.String] currentObjectDialogue
System.Collections.Generic.Queue`1[System.String] mailbox
System.Collections.Generic.List`1[System.String] questionChoices
Int32 xLocationAfterWarp
Int32 yLocationAfterWarp
Int32 gameTimeInterval
Int32 currentQuestionChoice
Int32 currentDialogueCharacterIndex
Int32 dialogueTypingInterval
Int32 dayOfMonth
Int32 year
Int32 timeOfDay
Int32 numberOfSelectedItems
Int32 priceOfSelectedItem
Int32 currentWallpaper
Int32 farmerWallpaper
Int32 wallpaperPrice
Int32 currentFloor
Int32 FarmerFloor
Int32 floorPrice
Int32 dialogueWidth
Int32 countdownToWedding
Int32 menuChoice
Int32 tvStation
Int32 currentBillboard
Int32 facingDirectionAfterWarp
Int32 tmpTimeOfDay
Int32 percentageToWinStardewHero
Int32 mouseClickPolling
Int32 weatherIcon
Int32 hitShakeTimer
Int32 staminaShakeTimer
Int32 pauseThenDoFunctionTimer
Int32 weatherForTomorrow
Int32 currentSongIndex
Int32 cursorTileHintCheckTimer
Int32 timerUntilMouseFade
Int32 minecartHighScore
System.Collections.Generic.List`1[System.Int32] dealerCalicoJackTotal
Microsoft.Xna.Framework.Color morningColor
Microsoft.Xna.Framework.Color eveningColor
Microsoft.Xna.Framework.Color unselectedOptionColor
Microsoft.Xna.Framework.Color screenGlowColor
StardewValley.NPC currentSpeaker
System.Random random
System.Random recentMultiplayerRandom
System.Collections.Generic.Dictionary`2[System.Int32,System.String] objectInformation
System.Collections.Generic.Dictionary`2[System.Int32,System.String] bigCraftablesInformation
System.Collections.Generic.List`1[StardewValley.Object] shippingBin
StardewValley.Locations.MineShaft mine
System.Collections.Generic.List`1[StardewValley.HUDMessage] hudMessages
System.Collections.Generic.Dictionary`2[System.String,System.Boolean] eventConditions
System.Collections.Generic.Dictionary`2[System.String,System.String] NPCGiftTastes
Single musicPlayerVolume
Single pauseAccumulator
Single pauseTime
Single upPolling
Single downPolling
Single rightPolling
Single leftPolling
Single debrisSoundInterval
Single toolHold
Single windGust
Single dialogueButtonScale
Single creditsTimer
Single globalOutdoorLighting
Microsoft.Xna.Framework.Audio.Cue currentSong
Microsoft.Xna.Framework.Audio.AudioCategory musicCategory
Microsoft.Xna.Framework.Audio.AudioCategory soundCategory
Microsoft.Xna.Framework.PlayerIndex playerOneIndex
Microsoft.Xna.Framework.Audio.AudioEngine audioEngine
Microsoft.Xna.Framework.Audio.WaveBank waveBank
Microsoft.Xna.Framework.Audio.SoundBank soundBank
Microsoft.Xna.Framework.Vector2 shiny
Microsoft.Xna.Framework.Vector2 previousViewportPosition
Microsoft.Xna.Framework.Vector2 currentCursorTile
Microsoft.Xna.Framework.Vector2 lastCursorTile
StardewValley.RainDrop[] rainDrops
Double chanceToRainTomorrow
Microsoft.Xna.Framework.Audio.Cue fuseSound
Microsoft.Xna.Framework.Audio.Cue chargeUpSound
Microsoft.Xna.Framework.Audio.Cue wind
Double dailyLuck
System.Collections.Generic.List`1[StardewValley.WeatherDebris] debrisWeather
System.Collections.Generic.List`1[StardewValley.TemporaryAnimatedSprite] screenOverlayTempSprites
Byte gameMode
Byte multiplayerMode
System.Collections.Generic.IEnumerator`1[System.Int32] currentLoader
UInt64 uniqueIDForThisGame
StardewValley.LoadGameScreen loadGameScreen
StardewValley.Stats stats
Int32[] cropsOfTheWeek
StardewValley.Quests.Quest questOfTheDay
StardewValley.MoneyMadeScreen moneyMadeScreen
System.Collections.Generic.HashSet`1[StardewValley.LightSource] currentLightSources
Microsoft.Xna.Framework.Color ambientLight
Microsoft.Xna.Framework.Color outdoorLight
Microsoft.Xna.Framework.Color textColor
Microsoft.Xna.Framework.Color textShadowColor
StardewValley.Menus.IClickableMenu activeClickableMenu
StardewValley.Minigames.IMinigame currentMinigame
System.Collections.Generic.List`1[StardewValley.Menus.IClickableMenu] onScreenMenus
StardewValley.BloomComponent bloom
System.Collections.Generic.Dictionary`2[System.Int32,System.String] achievements
StardewValley.Object dishOfTheDay
StardewValley.Menus.BuffsDisplay buffsDisplay
StardewValley.Menus.DayTimeMoneyBox dayTimeMoneyBox
System.Collections.Generic.Dictionary`2[System.Int64,StardewValley.Farmer] otherFarmers
StardewValley.Network.Server server
StardewValley.Network.Client client
StardewValley.KeyboardDispatcher keyboardDispatcher
StardewValley.Background background
StardewValley.Events.FarmEvent farmEvent
afterFadeFunction afterFade
afterFadeFunction afterDialogues
afterFadeFunction afterViewport
afterFadeFunction viewportReachedTarget
afterFadeFunction afterPause
Microsoft.Xna.Framework.GameTime currentGameTime
System.Collections.Generic.List`1[StardewValley.DelayedAction] delayedActions
System.Collections.Generic.Stack`1[StardewValley.Menus.IClickableMenu] endOfNightMenus
StardewValley.Options options
StardewValley.Game1 game1
Microsoft.Xna.Framework.Point lastMousePositionBeforeFade
Microsoft.Xna.Framework.Point viewportCenter
Microsoft.Xna.Framework.Vector2 viewportTarget
Single viewportSpeed
Int32 viewportHold
Boolean toggleFullScreen
Boolean isFullscreen
Boolean setToWindowedMode
Boolean setToFullscreen
System.String whereIsTodaysFest
Boolean farmerShouldPassOut
Microsoft.Xna.Framework.Vector2 currentViewportTarget
Microsoft.Xna.Framework.Vector2 viewportPositionLerp
Single screenGlowRate
Single screenGlowMax
Boolean haltAfterCheck
Int32 mouseCursor
Single mouseCursorTransparency
StardewValley.NPC objectDialoguePortraitPerson
Int32 defaultResolutionX
Int32 defaultResolutionY
Int32 smallestTileSize
Int32 up
Int32 right
Int32 down
Int32 left
Int32 spriteIndexForOveralls
Int32 colorToleranceForOveralls
Int32 spriteIndexForOverallsBorder
Int32 colorToloranceForOverallsBorder
Int32 dialogueBoxTileHeight
Int32 realMilliSecondsPerGameTenMinutes
Int32 rainDensity
Int32 millisecondsPerDialogueLetterType
Single pickToolDelay
Int32 defaultMinFishingBiteTime
Int32 defaultMaxFishingBiteTime
Int32 defaultMinFishingNibbleTime
Int32 defaultMaxFishingNibbleTime
Int32 minWallpaperPrice
Int32 maxWallpaperPrice
Int32 rainLoopLength
Int32 weather_sunny
Int32 weather_rain
Int32 weather_debris
Int32 weather_lightning
Int32 weather_festival
Int32 weather_snow
Int32 weather_wedding
Byte singlePlayer
Byte multiplayerClient
Byte multiplayerServer
Byte logoScreenGameMode
Byte titleScreenGameMode
Byte loadScreenGameMode
Byte newGameMode
Byte playingGameMode
Byte characterSelectMode
Byte loadingMode
Byte saveMode
Byte saveCompleteMode
Byte selectGameScreen
Byte creditsMode
Byte errorLogMode
Single keyPollingThreshold
Single toolHoldPerPowerupLevel
Single startingMusicVolume
Single thumbstickToMouseModifier
System.String NO_LETTER_MAIL

Binary file not shown.

View File

@ -22,9 +22,9 @@ namespace StardewModdingAPI
return new Color(Random.Next(0, 255), Random.Next(0, 255), Random.Next(0, 255)); return new Color(Random.Next(0, 255), Random.Next(0, 255), Random.Next(0, 255));
} }
public static string ToSingular(this IEnumerable<Object> enumerable) public static string ToSingular(this IEnumerable<Object> enumerable, string split = ", ")
{ {
string result = string.Join(", ", enumerable); string result = string.Join(split, enumerable);
return result; return result;
} }

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using StardewValley.Menus;
namespace StardewModdingAPI.Inheritance.Menus
{
public class SBobberBar : BobberBar
{
public static FieldInfo[] PrivateFields { get { return GetPrivateFields(); } }
/// <summary>
/// DO NOT CONSTRUCT THIS CLASS
/// This class ONLY provides functionality to access the base BobberBar class fields.
/// </summary>
/// <param name="whichFish"></param>
/// <param name="fishSize"></param>
/// <param name="treasure"></param>
/// <param name="bobber"></param>
public SBobberBar(int whichFish, float fishSize, bool treasure, int bobber) : base(whichFish, fishSize, treasure, bobber)
{
}
public static FieldInfo[] GetPrivateFields()
{
return typeof (BobberBar).GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
}
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace StardewModdingAPI.Inheritance.Minigames
{
abstract class SMinigameBase : StardewValley.Minigames.IMinigame
{
public abstract bool tick(GameTime time);
public abstract void receiveLeftClick(int x, int y, bool playSound = true);
public abstract void leftClickHeld(int x, int y);
public abstract void receiveRightClick(int x, int y, bool playSound = true);
public abstract void releaseLeftClick(int x, int y);
public abstract void releaseRightClick(int x, int y);
public abstract void receiveKeyPress(Keys k);
public abstract void receiveKeyRelease(Keys k);
public abstract void draw(SpriteBatch b);
public abstract void changeScreenSize();
public abstract void unload();
public abstract void receiveEventPoke(int data);
}
}

View File

@ -1,17 +1,26 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using StardewValley; using StardewValley;
using StardewValley.Minigames;
namespace StardewModdingAPI namespace StardewModdingAPI.Inheritance
{ {
public class SGame : Game1 public class SGame : Game1
{ {
public static FieldInfo[] StaticFields { get { return Thing(); } }
public static FieldInfo[] Thing()
{
return typeof(Game1).GetFields();
}
public KeyboardState KStateNow { get; private set; } public KeyboardState KStateNow { get; private set; }
public KeyboardState KStatePrior { get; private set; } public KeyboardState KStatePrior { get; private set; }

View File

@ -11,6 +11,7 @@ using System.Windows.Forms;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using StardewModdingAPI.Inheritance;
using StardewValley; using StardewValley;
using StardewValley.Menus; using StardewValley.Menus;
using StardewValley.Minigames; using StardewValley.Minigames;
@ -44,6 +45,8 @@ namespace StardewModdingAPI
{ {
Console.Title = "Stardew Modding API Console"; Console.Title = "Stardew Modding API Console";
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
if (File.Exists(ModPath)) if (File.Exists(ModPath))
File.Delete(ModPath); File.Delete(ModPath);
if (!Directory.Exists(ModPath)) if (!Directory.Exists(ModPath))
@ -62,6 +65,8 @@ namespace StardewModdingAPI
LogInfo("Starting SDV..."); LogInfo("Starting SDV...");
gameThread.Start(); gameThread.Start();
SGame.Thing();
while (!ready) while (!ready)
{ {
@ -184,7 +189,20 @@ namespace StardewModdingAPI
StardewForm.Invoke(a); StardewForm.Invoke(a);
} }
public static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string dllName = args.Name.Contains(',') ? args.Name.Substring(0, args.Name.IndexOf(',')) : args.Name.Replace(".dll", "");
dllName = dllName.Replace(".", "_");
if (dllName.EndsWith("_resources")) return null;
System.Resources.ResourceManager rm = new System.Resources.ResourceManager(typeof(Program).Namespace + ".Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());
byte[] bytes = (byte[])rm.GetObject(dllName);
return System.Reflection.Assembly.Load(bytes);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -54,6 +54,7 @@
<Reference Include="Stardew Valley, Version=1.0.5900.38427, Culture=neutral, processorArchitecture=x86"> <Reference Include="Stardew Valley, Version=1.0.5900.38427, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Stardew Valley.exe</HintPath> <HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Stardew Valley.exe</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -68,11 +69,13 @@
<Compile Include="Command.cs" /> <Compile Include="Command.cs" />
<Compile Include="Events.cs" /> <Compile Include="Events.cs" />
<Compile Include="Extensions.cs" /> <Compile Include="Extensions.cs" />
<Compile Include="Inheritance\Menus\SBobberBar.cs" />
<Compile Include="Inheritance\Minigames\SMinigameBase.cs" />
<Compile Include="Mod.cs" /> <Compile Include="Mod.cs" />
<Compile Include="ModItem.cs" /> <Compile Include="ModItem.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SGame.cs" /> <Compile Include="Inheritance\SGame.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />