Updated mods to SMAPI 3.X. Also revitalize: Placement bounds and depth properly work.

This commit is contained in:
Joshua Navarro 2019-01-20 23:34:11 -08:00
parent 0862d7559d
commit 50a7720bce
28 changed files with 159 additions and 47 deletions

View File

@ -1,7 +1,7 @@
{
"Name": "Advanced Save Backup",
"Author": "Alpha_Omegasis",
"Version": "1.6.0",
"Version": "1.7.0",
"Description": "Backs up your save files when loading SMAPI and every in game night when saving.",
"UniqueID": "Omegasis.AdvancedSaveBackup",
"EntryDll": "AdvancedSaveBackup.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Auto Speed",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Got to go fast!",
"UniqueID": "Omegasis.AutoSpeed",
"EntryDll": "AutoSpeed.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Billboard Anywhere",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Lets you view the billboard from anywhere.",
"UniqueID": "Omegasis.BillboardAnywhere",
"EntryDll": "BillboardAnywhere.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Build Endurance",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildEndurance",
"EntryDll": "BuildEndurance.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Build Health",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildHealth",
"EntryDll": "BuildHealth.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Buy Back Collectables",
"Author": "Alpha_Omegasis",
"Version": "1.6.0",
"Version": "1.7.0",
"Description": "Lets you buy back any obtained collectable.",
"UniqueID": "Omegasis.BuyBackCollectables",
"EntryDll": "BuyBackCollectables.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Daily Quest Anywhere",
"Author": "Alpha_Omegasis",
"Version": "1.6.0",
"Version": "1.7.0",
"Description": "Open the daily quest board from anywhere in the game.",
"UniqueID": "Omegasis.DailyQuestAnywhere",
"EntryDll": "DailyQuestAnywhere.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Fall 28 Snow Day",
"Author": "Alpha_Omegasis",
"Version": "1.6.0",
"Version": "1.7.0",
"Description": "Makes it snow on Fall 28, which makes a good explanation for all the snow on the next day.",
"UniqueID": "Omegasis.Fall28SnowDay",
"EntryDll": "Fall28SnowDay.dll",

View File

@ -1,4 +1,12 @@
Happy Birthday Change Log
Happy Birthday Change Log
~~~~~~~~~~~~~~~~
Manifest 1.9.0 Changelog
~~~~~~~~~~~~~~~~
General Changes
-Added support for Chinese birthday translations thanks to Nexus user erinyang.
-Added support for loading translation strings for Birthday Mail and HUD Messages.
~~~~~~~~~~~~~~~~
Manifest 1.8.0 Changelog

View File

@ -1,7 +1,7 @@
{
"Name": "Happy Birthday",
"Author": "Alpha_Omegasis",
"Version": "1.8.3",
"Version": "1.9.0",
"Description": "Adds the farmer's birthday to the game.",
"UniqueID": "Omegasis.HappyBirthday",
"EntryDll": "HappyBirthday.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "More Rain",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Change how much it rains in the game.",
"UniqueID": "Omegasis.MoreRain",
"EntryDll": "MoreRain.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Museum Rearranger",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Lets you rearrange the museum without needing to donate something.",
"UniqueID": "Omegasis.MuseumRearranger",
"EntryDll": "MuseumRearranger.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Night Owl",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.9.0",
"Description": "Lets you stay up all night.",
"UniqueID": "Omegasis.NightOwl",
"EntryDll": "NightOwl.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "No More Pets",
"Author": "Alpha_Omegasis",
"Version": "1.6.0",
"Version": "1.7.0",
"Description": "Removes all pets from the game.",
"UniqueID": "Omegasis.NoMorePets",
"EntryDll": "NoMorePets.dll",

View File

@ -35,11 +35,27 @@ namespace Revitalize.Framework.Objects
[JsonIgnore]
public Texture2D displayTexture => this.animationManager.getTexture();
public string ItemInfo
{
get
{
return Revitalize.ModCore.Serializer.ToJSONString(this.info);
}
set
{
Revitalize.ModCore.log("GUESS SERIALIZATION IS WORKING???");
this.info =(BasicItemInformation)Revitalize.ModCore.Serializer.DeserializeFromJSONString(value, typeof(BasicItemInformation));
}
}
protected Netcode.NetString netItemInfo;
/// <summary>Empty constructor.</summary>
public CustomObject() {
this.guid = Guid.NewGuid();
InitNetFields();
}
/// <summary>Construct an instance.</summary>
@ -77,13 +93,14 @@ namespace Revitalize.Framework.Objects
this.bigCraftable.Value = false;
this.initNetFields();
//this.initNetFields();
InitNetFields();
//if (this.info.ignoreBoundingBox)
// this.boundingBox.Value = new Rectangle(int.MinValue, int.MinValue, 0, 0);
}
public override bool isPassable()
{
return this.info.ignoreBoundingBox || Revitalize.ModCore.playerInfo.sittingInfo.SittingObject==this;
@ -223,6 +240,12 @@ namespace Revitalize.Framework.Objects
return base.placementAction(location, x, y, who);
}
public override bool canBePlacedHere(GameLocation l, Vector2 tile)
{
if (this.info.ignoreBoundingBox) return true;
return base.canBePlacedHere(l, tile);
}
public virtual void rotate()
{
if (this.info.facingDirection == Enums.Direction.Down) this.info.facingDirection = Enums.Direction.Right;
@ -371,11 +394,35 @@ namespace Revitalize.Framework.Objects
public void InitNetFields()
{
if (Game1.IsMultiplayer == false &&(Game1.IsClient==false || Game1.IsClient==false)) return;
this.initNetFields();
this.syncObject = new PySync(this);
this.NetFields.AddField(this.syncObject);
this.netItemInfo = new Netcode.NetString(this.ItemInfo);
this.NetFields.AddField(this.netItemInfo);
}
/// <summary>
/// Gets all of the data necessary for syncing.
/// </summary>
/// <returns></returns>
public override Dictionary<string, string> getSyncData()
{
Dictionary<string,string> syncData= base.getSyncData();
syncData.Add("BasicItemInfo", Revitalize.ModCore.Serializer.ToJSONString(this.info));
return syncData;
}
/// <summary>
/// Syncs all of the info to all players.
/// </summary>
/// <param name="syncData"></param>
public override void sync(Dictionary<string, string> syncData)
{
Revitalize.ModCore.log("SYNC OBJECT DATA!");
base.sync(syncData);
this.info = Revitalize.ModCore.Serializer.DeserializeFromJSONString<BasicItemInformation>(syncData["BasicItemInfo"]);
}
public string getDisplayNameFromStringsFile(string objectID)
{

View File

@ -62,6 +62,7 @@ namespace Revitalize.Framework.Objects.Furniture
objs.Add(pair.Key, (MultiTiledComponent)pair.Value);
}
return new ChairMultiTiledObject(this.info, this.TileLocation, objs);
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Revitalize.Framework.Objects.InformationFiles
{
public class ObjectGUIDInfo
{
public enum ObjectType
{
Solid,
Display
}
public ObjectGUIDInfo()
{
}
}
}

View File

@ -188,22 +188,27 @@ namespace Revitalize.Framework.Objects
/// <summary>What happens when the object is drawn at a tile location.</summary>
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
{
if (this.info == null) Revitalize.ModCore.log("info is null");
if (this.info.ignoreBoundingBox == true)
{
x *= -1;
y *= -1;
}
if (this.info == null)
{
Revitalize.ModCore.log("info is null");
if (this.syncObject == null) Revitalize.ModCore.log("DEAD SYNC");
}
if (this.animationManager == null) Revitalize.ModCore.log("Animation Manager Null");
if (this.displayTexture == null) Revitalize.ModCore.log("Display texture is null");
if (x <= -1)
{
spriteBatch.Draw(this.info.animationManager.getTexture(), Game1.GlobalToLocal(Game1.viewport, this.info.drawPosition), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(this.TileLocation.Y * Game1.tileSize) / 10000f));
}
else
{
//The actual planter box being drawn.
if (this.animationManager == null)
{
if (this.animationManager.getExtendedTexture() == null)
ModCore.ModMonitor.Log("Tex Extended is null???");
spriteBatch.Draw(this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(this.TileLocation.Y * Game1.tileSize) / 10000f));
spriteBatch.Draw(this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(y * Game1.tileSize) / 10000f));
// Log.AsyncG("ANIMATION IS NULL?!?!?!?!");
}
@ -222,7 +227,7 @@ namespace Revitalize.Framework.Objects
{
addedDepth += 1.0f;
}
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)((this.TileLocation.Y + addedDepth) * Game1.tileSize) / 10000f));
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)((y + addedDepth) * Game1.tileSize) / 10000f)+.00001f);
try
{
this.animationManager.tickAnimation();
@ -235,7 +240,7 @@ namespace Revitalize.Framework.Objects
}
// spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)((double)tileLocation.X * (double)Game1.tileSize + (((double)tileLocation.X * 11.0 + (double)tileLocation.Y * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2), (float)((double)tileLocation.Y * (double)Game1.tileSize + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2))), new Rectangle?(new Rectangle((int)((double)tileLocation.X * 51.0 + (double)tileLocation.Y * 77.0) % 3 * 16, 128 + this.whichForageCrop * 16, 16, 16)), Color.White, 0.0f, new Vector2(8f, 8f), (float)Game1.pixelZoom, SpriteEffects.None, (float)(((double)tileLocation.Y * (double)Game1.tileSize + (double)(Game1.tileSize / 2) + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) / 10000.0));
}
}

View File

@ -101,13 +101,17 @@ namespace Revitalize.Framework.Objects
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1)
{
foreach (KeyValuePair<Vector2, StardewValley.Object> pair in this.objects)
pair.Value.draw(spriteBatch, x + (int)pair.Key.X * Game1.tileSize, y + (int)pair.Key.Y * Game1.tileSize, alpha);
{
(pair.Value as MultiTiledComponent).draw(spriteBatch, x + ((int)pair.Key.X), y + ((int)pair.Key.Y), alpha);
}
}
public override void draw(SpriteBatch spriteBatch, int xNonTile, int yNonTile, float layerDepth, float alpha = 1)
{
foreach (KeyValuePair<Vector2, StardewValley.Object> pair in this.objects)
{
pair.Value.draw(spriteBatch, xNonTile + (int)pair.Key.X * Game1.tileSize, yNonTile + (int)pair.Key.Y * Game1.tileSize, layerDepth, alpha);
}
//base.draw(spriteBatch, xNonTile, yNonTile, layerDepth, alpha);
}
@ -147,9 +151,18 @@ namespace Revitalize.Framework.Objects
x = (int)translatedVector2.X * 64;
y = (int)translatedVector2.Y * 64;
}
bool flag = Utility.playerCanPlaceItemHere(location, (Item)pair.Value, x, y, Game1.player);
bool flag = (pair.Value as MultiTiledComponent).canBePlacedHere(location, new Vector2(x/Game1.tileSize, y/Game1.tileSize));
spriteBatch.Draw(Game1.mouseCursors, new Vector2((float)(x / 64 * 64 - Game1.viewport.X), (float)(y / 64 * 64 - Game1.viewport.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(flag ? 194 : 210, 388, 16, 16)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.01f);
this.draw(spriteBatch, x / 64, y / 64, 0.5f);
//Revitalize.ModCore.log(new Vector2(x + ((int)pair.Key.X), y + ((int)pair.Key.Y)));
if((pair.Value as MultiTiledComponent).info.ignoreBoundingBox)
{
x *= -1;
y *= -1;
}
(pair.Value as MultiTiledComponent).draw(spriteBatch, x/Game1.tileSize, y/Game1.tileSize, 0.5f);
//break;
//this.draw(spriteBatch, x / 64, y / 64, 0.5f);
}
}
@ -182,8 +195,15 @@ namespace Revitalize.Framework.Objects
public override bool placementAction(GameLocation location, int x, int y, Farmer who = null)
{
foreach (KeyValuePair<Vector2, StardewValley.Object> pair in this.objects)
{
if ((pair.Value as CustomObject).info.ignoreBoundingBox)
{
pair.Value.placementAction(location, -1 * (x + (int)pair.Key.X * Game1.tileSize), -1 * (y + (int)pair.Key.Y * Game1.tileSize), who);
}
else
{
pair.Value.placementAction(location, x + (int)pair.Key.X * Game1.tileSize, y + (int)pair.Key.Y * Game1.tileSize, who);
}
//ModCore.log(pair.Value.TileLocation);
}
this.location = location;

View File

@ -106,6 +106,8 @@ namespace Revitalize
public static Serializer Serializer;
public static Dictionary<GameLocation,MultiTiledObject> ObjectsToDraw;
public override void Entry(IModHelper helper)
{
ModHelper = helper;
@ -128,6 +130,7 @@ namespace Revitalize
loadContent();
Serializer = new Serializer();
ObjectsToDraw = new Dictionary<GameLocation, MultiTiledObject>();
}
@ -157,6 +160,7 @@ namespace Revitalize
Framework.Objects.Furniture.ChairTileComponent chairTop = new Framework.Objects.Furniture.ChairTileComponent(new BasicItemInformation("Oak Chair", "A basic wooden chair", "Chairs", Color.Brown, -300, 0, false, 100, Vector2.Zero, true, true, "Omegasis.Revitalize.Furniture.Basic.OakChair", "2048/0/-300/Crafting -9/Play '2048 by Platonymous' at home!/true/true/0/2048", Framework.Graphics.TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture, Color.White, 0, false, typeof(Framework.Objects.Furniture.ChairTileComponent), null, new AnimationManager(TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair"), new Animation(new Rectangle(0, 0, 16, 16)), new Dictionary<string, List<Animation>>() {
{ "Default_" + (int)Framework.Enums.Direction.Down , new List<Animation>()
{
@ -246,8 +250,8 @@ namespace Revitalize
Framework.Objects.Furniture.ChairMultiTiledObject oakChair = new Framework.Objects.Furniture.ChairMultiTiledObject(new BasicItemInformation("Oak Chair", "A wood chair you can place anywhere.", "Chair", Color.White, -300, 0, true, 100, Vector2.Zero, true, true, "Omegasis.Revitalize.Furniture.OakChair", "2048/0/-300/Crafting -9/Play '2048 by Platonymous' at home!/true/true/0/2048", TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture, Color.White, 0, true, typeof(Revitalize.Framework.Objects.Furniture.ChairMultiTiledObject), null, new AnimationManager(), Color.White, false, new Framework.Utilities.InventoryManager(), new LightManager()));
oakChair.addComponent(new Vector2(0, 0), chairTop);
oakChair.addComponent(new Vector2(0, 1), chairBottom);
oakChair.addComponent(new Vector2(0, -1), chairTop);
oakChair.addComponent(new Vector2(0, 0), chairBottom);
customObjects.Add("Omegasis.BigTiledTest", bigObject);
customObjects.Add("Omegasis.Revitalize.Furniture.Chairs.OakChair",oakChair);
@ -290,6 +294,9 @@ namespace Revitalize
//Game1.player.addItemToInventory(customObjects["Omegasis.BigTiledTest"].getOne());
Game1.player.addItemToInventory(getObjectFromPool("Omegasis.Revitalize.Furniture.Chairs.OakChair"));
Netcode.NetString str = new Netcode.NetString("AHHH");
Serializer.Serialize(Path.Combine(this.Helper.DirectoryPath, "str.json"),str);
/*
StardewValley.Tools.Axe axe = new StardewValley.Tools.Axe();
Serializer.Serialize(Path.Combine(this.Helper.DirectoryPath, "AXE.json"), axe);

View File

@ -69,6 +69,7 @@
<Compile Include="Framework\Objects\Furniture\FurnitureTileComponent.cs" />
<Compile Include="Framework\Objects\InformationFiles\Furniture\ChairInformation.cs" />
<Compile Include="Framework\Objects\InformationFiles\Furniture\FurnitureInformation.cs" />
<Compile Include="Framework\Objects\InformationFiles\ObjectGUIDInfo.cs" />
<Compile Include="Framework\Objects\MultiTiledComponent.cs" />
<Compile Include="Framework\Objects\MultiTiledObject.cs" />
<Compile Include="Framework\Player\Managers\MagicManager.cs" />

View File

@ -1,7 +1,7 @@
{
"Name": "Save Anywhere",
"Author": "Alpha_Omegasis",
"Version": "2.10.0",
"Version": "2.11.0",
"Description": "Lets you save almost anywhere.",
"UniqueID": "Omegasis.SaveAnywhere",
"EntryDll": "SaveAnywhere.dll",

View File

@ -150,7 +150,7 @@ namespace SimpleSoundManager
/// <summary>Used to resume the currently playing song.</summary>
public void resume()
{
dynamicSound?.Resume();
this.dynamicSound?.Resume();
}
/// <summary>Used to stop the currently playing song.</summary>

View File

@ -1,7 +1,7 @@
{
"Name": "Simple Sound Manager",
"Author": "Alpha_Omegasis",
"Version": "2.1.0",
"Version": "2.2.0",
"Description": "A simple framework to play sounds from wave banks and wav files.",
"UniqueID": "Omegasis.SimpleSoundManager",
"EntryDll": "SimpleSoundManager.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Stardew Symphony Remastered",
"Author": "Alpha_Omegasis",
"Version": "2.3.0",
"Version": "2.4.0",
"Description": "Adding more music to the game one beep at a time. Now with streaming!",
"UniqueID": "Omegasis.StardewSymphonyRemastered",
"EntryDll": "StardewSymphonyRemastered.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "StardustCore",
"Author": "Alpha_Omegasis",
"Version": "2.1.0",
"Version": "2.2.0",
"Description": "A core mod that allows for other mods of mine to be run.",
"UniqueID": "Omegasis.StardustCore",
"EntryDll": "StardustCore.dll",

View File

@ -1,7 +1,7 @@
{
"Name": "Time Freeze",
"Author": "Alpha_Omegasis",
"Version": "1.6.0",
"Version": "1.7.0",
"Description": "Emulates old Harvest Moon-style games where time is frozen inside.",
"UniqueID": "Omegasis.TimeFreeze",
"EntryDll": "TimeFreeze.dll",