Merge pull request #6 from lukiono/SDV_1.3_beta

Migration to SMAPI 2.6-beta.8
This commit is contained in:
cdaragorn 2018-05-07 11:06:01 -06:00 committed by GitHub
commit 007452cf88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 17 deletions

View File

@ -62,14 +62,14 @@ namespace UIInfoSuite.UIElements
} }
_timeToDisappear.Elapsed += StopTimerAndFadeBarOut; _timeToDisappear.Elapsed += StopTimerAndFadeBarOut;
GraphicsEvents.OnPreRenderHudEvent += OnPreRenderHudEvent; GraphicsEvents.OnPreRenderHudEvent += OnPreRenderHudEvent;
LocationEvents.CurrentLocationChanged += RemoveAllExperiencePointDisplays; PlayerEvents.Warped += RemoveAllExperiencePointDisplays;
} }
public void Dispose() public void Dispose()
{ {
PlayerEvents.LeveledUp -= OnLevelUp; PlayerEvents.LeveledUp -= OnLevelUp;
GraphicsEvents.OnPreRenderHudEvent -= OnPreRenderHudEvent; GraphicsEvents.OnPreRenderHudEvent -= OnPreRenderHudEvent;
LocationEvents.CurrentLocationChanged -= RemoveAllExperiencePointDisplays; PlayerEvents.Warped -= RemoveAllExperiencePointDisplays;
_timeToDisappear.Stop(); _timeToDisappear.Stop();
_timeToDisappear.Dispose(); _timeToDisappear.Dispose();
} }
@ -98,12 +98,12 @@ namespace UIInfoSuite.UIElements
public void ToggleShowExperienceBar(bool showExperienceBar) public void ToggleShowExperienceBar(bool showExperienceBar)
{ {
//GraphicsEvents.OnPreRenderHudEvent -= OnPreRenderHudEvent; //GraphicsEvents.OnPreRenderHudEvent -= OnPreRenderHudEvent;
//LocationEvents.CurrentLocationChanged -= RemoveAllExperiencePointDisplays; //PlayerEvents.Warped -= RemoveAllExperiencePointDisplays;
_showExperienceBar = showExperienceBar; _showExperienceBar = showExperienceBar;
//if (showExperienceBar) //if (showExperienceBar)
//{ //{
// GraphicsEvents.OnPreRenderHudEvent += OnPreRenderHudEvent; // GraphicsEvents.OnPreRenderHudEvent += OnPreRenderHudEvent;
// LocationEvents.CurrentLocationChanged += RemoveAllExperiencePointDisplays; // PlayerEvents.Warped += RemoveAllExperiencePointDisplays;
//} //}
} }
@ -161,7 +161,7 @@ namespace UIInfoSuite.UIElements
_experienceBarShouldBeVisible = false; _experienceBarShouldBeVisible = false;
} }
private void RemoveAllExperiencePointDisplays(object sender, EventArgsCurrentLocationChanged e) private void RemoveAllExperiencePointDisplays(object sender, EventArgsPlayerWarped e)
{ {
_experiencePointDisplays.Clear(); _experiencePointDisplays.Clear();
} }

View File

@ -21,7 +21,7 @@ namespace UIInfoSuite.UIElements
public void Toggle(bool showLuckOfDay) public void Toggle(bool showLuckOfDay)
{ {
LocationEvents.CurrentLocationChanged -= AdjustIconXToBlackBorder; PlayerEvents.Warped -= AdjustIconXToBlackBorder;
GraphicsEvents.OnPreRenderHudEvent -= DrawDiceIcon; GraphicsEvents.OnPreRenderHudEvent -= DrawDiceIcon;
GraphicsEvents.OnPostRenderHudEvent -= DrawHoverTextOverEverything; GraphicsEvents.OnPostRenderHudEvent -= DrawHoverTextOverEverything;
GameEvents.HalfSecondTick -= CalculateLuck; GameEvents.HalfSecondTick -= CalculateLuck;
@ -29,7 +29,7 @@ namespace UIInfoSuite.UIElements
if (showLuckOfDay) if (showLuckOfDay)
{ {
AdjustIconXToBlackBorder(null, null); AdjustIconXToBlackBorder(null, null);
LocationEvents.CurrentLocationChanged += AdjustIconXToBlackBorder; PlayerEvents.Warped += AdjustIconXToBlackBorder;
GameEvents.HalfSecondTick += CalculateLuck; GameEvents.HalfSecondTick += CalculateLuck;
GraphicsEvents.OnPreRenderHudEvent += DrawDiceIcon; GraphicsEvents.OnPreRenderHudEvent += DrawDiceIcon;
GraphicsEvents.OnPostRenderHudEvent += DrawHoverTextOverEverything; GraphicsEvents.OnPostRenderHudEvent += DrawHoverTextOverEverything;
@ -93,7 +93,7 @@ namespace UIInfoSuite.UIElements
} }
} }
private void AdjustIconXToBlackBorder(object sender, EventArgsCurrentLocationChanged e) private void AdjustIconXToBlackBorder(object sender, EventArgsPlayerWarped e)
{ {
_icon = new ClickableTextureComponent("", _icon = new ClickableTextureComponent("",
new Rectangle(Tools.GetWidthInPlayArea() - 134, new Rectangle(Tools.GetWidthInPlayArea() - 134,

View File

@ -33,13 +33,13 @@ namespace UIInfoSuite.UIElements
public void ToggleOption(bool showWhenAnimalNeedsPet) public void ToggleOption(bool showWhenAnimalNeedsPet)
{ {
_timer.Stop(); _timer.Stop();
LocationEvents.CurrentLocationChanged -= OnLocationChange; PlayerEvents.Warped -= OnLocationChange;
GraphicsEvents.OnPreRenderHudEvent -= DrawAnimalHasProduct; GraphicsEvents.OnPreRenderHudEvent -= DrawAnimalHasProduct;
if (showWhenAnimalNeedsPet) if (showWhenAnimalNeedsPet)
{ {
_timer.Start(); _timer.Start();
LocationEvents.CurrentLocationChanged += OnLocationChange; PlayerEvents.Warped += OnLocationChange;
GraphicsEvents.OnPreRenderHudEvent += DrawAnimalHasProduct; GraphicsEvents.OnPreRenderHudEvent += DrawAnimalHasProduct;
} }
} }
@ -95,7 +95,7 @@ namespace UIInfoSuite.UIElements
} }
} }
private void OnLocationChange(object sender, EventArgsCurrentLocationChanged e) private void OnLocationChange(object sender, EventArgsPlayerWarped e)
{ {
if (e.NewLocation is AnimalHouse || if (e.NewLocation is AnimalHouse ||
e.NewLocation is Farm) e.NewLocation is Farm)

View File

@ -1,12 +1,7 @@
{ {
"Name": "UI Info Suite", "Name": "UI Info Suite",
"Author": "Cdaragorn", "Author": "Cdaragorn",
"Version": { "Version": "1.7.2",
"MajorVersion": 1,
"MinorVersion": 7,
"PatchVersion": 1,
"Build": null
},
"Description": "Adds a lot of useful information to the user interface. This is based on Demiacle's excellent UIModSuite.", "Description": "Adds a lot of useful information to the user interface. This is based on Demiacle's excellent UIModSuite.",
"UniqueID": "Cdaragorn.UiInfoSuite", "UniqueID": "Cdaragorn.UiInfoSuite",
"EntryDll": "UIInfoSuite.dll", "EntryDll": "UIInfoSuite.dll",