commit
81c0078b78
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Revitalize.Framework.Objects.Furniture
|
|||
}
|
||||
|
||||
|
||||
public Bench(BasicItemInformation info,Vector2 TilePosition, Dictionary<Vector2,MultiTiledComponent> Objects): base(info, TilePosition, Objects)
|
||||
public Bench(BasicItemInformation info,Vector2 TilePosition, Dictionary<Vector2,MultiTiledComponent> Objects) : base(info, TilePosition, Objects)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace Revitalize.Framework.Objects.Furniture
|
|||
objs.Add(pair.Key, (MultiTiledComponent)pair.Value);
|
||||
}
|
||||
|
||||
|
||||
return new ChairMultiTiledObject(this.info, this.TileLocation, objs);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Xna.Framework;
|
||||
using PyTK.CustomElementHandler;
|
||||
using StardewValley;
|
||||
|
||||
namespace Revitalize.Framework.Objects.Furniture
|
||||
{
|
||||
public class RugMultiTiledObject:MultiTiledObject
|
||||
{
|
||||
public RugMultiTiledObject() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public RugMultiTiledObject(BasicItemInformation Info) : base(Info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public RugMultiTiledObject(BasicItemInformation Info, Vector2 TilePosition) : base(Info, TilePosition)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public RugMultiTiledObject(BasicItemInformation Info, Vector2 TilePosition, Dictionary<Vector2, MultiTiledComponent> Objects) : base(Info, TilePosition, Objects)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rotate all chair components associated with this chair object.
|
||||
/// </summary>
|
||||
public override void rotate()
|
||||
{
|
||||
Revitalize.ModCore.log("Rotate!");
|
||||
foreach (KeyValuePair<Vector2, StardewValley.Object> pair in this.objects)
|
||||
{
|
||||
(pair.Value as RugTileComponent).rotate();
|
||||
}
|
||||
foreach (KeyValuePair<Vector2, StardewValley.Object> pair in this.objects)
|
||||
{
|
||||
(pair.Value as RugTileComponent).checkForSpecialUpSittingAnimation();
|
||||
}
|
||||
|
||||
base.rotate();
|
||||
}
|
||||
|
||||
public override Item getOne()
|
||||
{
|
||||
Dictionary<Vector2, MultiTiledComponent> objs = new Dictionary<Vector2, MultiTiledComponent>();
|
||||
foreach (var pair in this.objects)
|
||||
{
|
||||
objs.Add(pair.Key, (MultiTiledComponent)pair.Value);
|
||||
}
|
||||
|
||||
|
||||
return new RugMultiTiledObject(this.info, this.TileLocation, objs);
|
||||
}
|
||||
|
||||
|
||||
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
|
||||
{
|
||||
RugMultiTiledObject obj = (RugMultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<RugMultiTiledObject>(additionalSaveData["GUID"]);
|
||||
if (obj == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Dictionary<Vector2, Guid> guids = new Dictionary<Vector2, Guid>();
|
||||
|
||||
foreach (KeyValuePair<Vector2, Guid> pair in obj.childrenGuids)
|
||||
{
|
||||
guids.Add(pair.Key, pair.Value);
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<Vector2, Guid> pair in guids)
|
||||
{
|
||||
obj.childrenGuids.Remove(pair.Key);
|
||||
//Revitalize.ModCore.log("DESERIALIZE: " + pair.Value.ToString());
|
||||
RugTileComponent component = Revitalize.ModCore.Serializer.DeserializeGUID<RugTileComponent>(pair.Value.ToString());
|
||||
component.InitNetFields();
|
||||
|
||||
obj.addComponent(pair.Key, component);
|
||||
|
||||
|
||||
}
|
||||
obj.InitNetFields();
|
||||
|
||||
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["GUID"]))
|
||||
{
|
||||
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["GUID"], obj);
|
||||
return obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Revitalize.ModCore.ObjectGroups[additionalSaveData["GUID"]];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override bool canBePlacedHere(GameLocation l, Vector2 tile)
|
||||
{
|
||||
return base.canBePlacedHere(l, tile);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
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 PyTK.CustomElementHandler;
|
||||
using StardewValley;
|
||||
|
||||
namespace Revitalize.Framework.Objects.Furniture
|
||||
{
|
||||
public class RugTileComponent:MultiTiledComponent
|
||||
{
|
||||
|
||||
public RugTileComponent() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public RugTileComponent(BasicItemInformation Info) : base(Info)
|
||||
{
|
||||
this.info.ignoreBoundingBox = true;
|
||||
}
|
||||
|
||||
public RugTileComponent(BasicItemInformation Info, Vector2 TileLocation) : base(Info, TileLocation)
|
||||
{
|
||||
this.info.ignoreBoundingBox = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// When the chair is right clicked ensure that all pieces associated with it are also rotated.
|
||||
/// </summary>
|
||||
/// <param name="who"></param>
|
||||
/// <returns></returns>
|
||||
public override bool rightClicked(Farmer who)
|
||||
{
|
||||
this.containerObject.rotate(); //Ensure that all of the chair pieces rotate at the same time.
|
||||
return true;
|
||||
//return base.rightClicked(who);
|
||||
}
|
||||
|
||||
public override Item getOne()
|
||||
{
|
||||
RugTileComponent component = new RugTileComponent(this.info);
|
||||
component.containerObject = this.containerObject;
|
||||
component.offsetKey = this.offsetKey;
|
||||
return component;
|
||||
}
|
||||
|
||||
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
|
||||
{
|
||||
//instead of using this.offsetkey.x use get additional save data function and store offset key there
|
||||
|
||||
Vector2 offsetKey = new Vector2(Convert.ToInt32(additionalSaveData["offsetKeyX"]), Convert.ToInt32(additionalSaveData["offsetKeyY"]));
|
||||
RugTileComponent self = Revitalize.ModCore.Serializer.DeserializeGUID<RugTileComponent>(additionalSaveData["GUID"]);
|
||||
if (self == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["ParentGUID"]))
|
||||
{
|
||||
//Get new container
|
||||
RugMultiTiledObject obj = (RugMultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<RugMultiTiledObject>(additionalSaveData["ParentGUID"]);
|
||||
self.containerObject = obj;
|
||||
obj.addComponent(offsetKey, self);
|
||||
//Revitalize.ModCore.log("ADD IN AN OBJECT!!!!");
|
||||
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["ParentGUID"], obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.containerObject = Revitalize.ModCore.ObjectGroups[additionalSaveData["ParentGUID"]];
|
||||
Revitalize.ModCore.ObjectGroups[additionalSaveData["GUID"]].addComponent(offsetKey, self);
|
||||
//Revitalize.ModCore.log("READD AN OBJECT!!!!");
|
||||
}
|
||||
|
||||
return (ICustomObject)self;
|
||||
}
|
||||
|
||||
public override Dictionary<string, string> getAdditionalSaveData()
|
||||
{
|
||||
Dictionary<string, string> saveData = base.getAdditionalSaveData();
|
||||
Revitalize.ModCore.Serializer.SerializeGUID(this.containerObject.childrenGuids[this.offsetKey].ToString(), this);
|
||||
|
||||
return saveData;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///Used to manage graphics for chairs that need to deal with special "layering" for transparent chair backs. Otherwise the player would be hidden.
|
||||
/// </summary>
|
||||
public void checkForSpecialUpSittingAnimation()
|
||||
{
|
||||
if (this.info.facingDirection == Enums.Direction.Up && Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject)
|
||||
{
|
||||
string animationKey = "Sitting_" + (int)Enums.Direction.Up;
|
||||
if (this.animationManager.animations.ContainsKey(animationKey))
|
||||
{
|
||||
this.animationManager.setAnimation(animationKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.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");
|
||||
|
||||
//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)(y * Game1.tileSize) / 10000f));
|
||||
// Log.AsyncG("ANIMATION IS NULL?!?!?!?!");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Log.AsyncC("Animation Manager is working!");
|
||||
float addedDepth = 0;
|
||||
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, 0.0001f));
|
||||
try
|
||||
{
|
||||
this.animationManager.tickAnimation();
|
||||
// Log.AsyncC("Tick animation");
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ModCore.ModMonitor.Log(err.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
// 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));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>()
|
||||
{
|
||||
|
@ -199,8 +203,6 @@ namespace Revitalize
|
|||
}
|
||||
}
|
||||
}, "Default_" + (int)Framework.Enums.Direction.Down), Color.White, true, new Framework.Utilities.InventoryManager(), new LightManager()), new Framework.Objects.InformationFiles.Furniture.ChairInformation(false));
|
||||
|
||||
|
||||
Framework.Objects.Furniture.ChairTileComponent chairBottom = 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, 16, 16, 16)), new Dictionary<string, List<Animation>>() {
|
||||
{ "Default_" + (int)Framework.Enums.Direction.Down , new List<Animation>()
|
||||
{
|
||||
|
@ -246,11 +248,17 @@ 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);
|
||||
|
||||
Framework.Objects.Furniture.RugTileComponent rug1 = new Framework.Objects.Furniture.RugTileComponent(new BasicItemInformation("BasicRugTile", "A basic rug", "Rug", Color.Brown, -300, 0, false, 100, new Vector2(0, 0), true, true, "Omegasis.Revitalize.Furniture.Basic.Rugs.TestRug", generatePlaceholderString(), TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture, Color.White, 0,true, typeof(Framework.Objects.Furniture.RugTileComponent), null, new AnimationManager(TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair"), new Animation(new Rectangle(0, 0, 16, 16))), Color.White, true, null, null));
|
||||
Framework.Objects.Furniture.RugMultiTiledObject rug = new Framework.Objects.Furniture.RugMultiTiledObject(new BasicItemInformation("BasicRugTile", "A basic rug", "Rug", Color.Brown, -300, 0, false, 100, new Vector2(0, 0), true, true, "Omegasis.Revitalize.Furniture.Basic.Rugs.TestRug", generatePlaceholderString(), TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture, Color.White, 0, true, typeof(Framework.Objects.Furniture.RugMultiTiledObject), null, new AnimationManager(), Color.White, true, null, null));
|
||||
rug.addComponent(new Vector2(0, 0), rug1);
|
||||
|
||||
customObjects.Add("Omegasis.Revitalize.Furniture.Rugs.RugTest", rug);
|
||||
}
|
||||
|
||||
private void createDirectories()
|
||||
|
@ -289,6 +297,7 @@ namespace Revitalize
|
|||
}
|
||||
//Game1.player.addItemToInventory(customObjects["Omegasis.BigTiledTest"].getOne());
|
||||
Game1.player.addItemToInventory(getObjectFromPool("Omegasis.Revitalize.Furniture.Chairs.OakChair"));
|
||||
Game1.player.addItemToInventory(getObjectFromPool("Omegasis.Revitalize.Furniture.Rugs.RugTest"));
|
||||
|
||||
/*
|
||||
StardewValley.Tools.Axe axe = new StardewValley.Tools.Axe();
|
||||
|
|
|
@ -67,8 +67,11 @@
|
|||
<Compile Include="Framework\Objects\Furniture\ChairTileComponent.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\CustomFurniture.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\FurnitureTileComponent.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\RugMultiTiledObject.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\RugTileComponent.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" />
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue