Ui-Info-Suite/SDVModTest/IconHandler.cs

44 lines
984 B
C#
Raw Normal View History

2017-07-20 11:51:05 +08:00
using Microsoft.Xna.Framework;
using StardewValley;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UIInfoSuite
{
class IconHandler
{
public static IconHandler Handler { get; private set; }
static IconHandler()
{
if (Handler == null)
Handler = new IconHandler();
}
private int _amountOfVisibleIcons;
private IconHandler()
{
}
public Point GetNewIconPosition()
{
int yPos = Game1.options.zoomButtons ? 290 : 260;
int xPosition = (int)Tools.GetWidthInPlayArea() - 134 - 46 * _amountOfVisibleIcons;
++_amountOfVisibleIcons;
return new Point(xPosition, yPos);
}
public void Reset(object sender, EventArgs e)
{
_amountOfVisibleIcons = 0;
}
}
}