Skip to content

Commit

Permalink
Merge pull request #22 from jsebold666/hotfix-maps-healthbar-with-logotu
Browse files Browse the repository at this point in the history
hotfix for healthbar and maps tracking guild members
  • Loading branch information
jsebold666 authored Feb 28, 2024
2 parents af04656 + 6fc127f commit 7a5592c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/ClassicUO.Client/Configuration/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ internal sealed class Profile
public bool DrawMobilesWithSurfaceOverhead { get; set; } = false;
public bool IgnoreCoTEnabled { get; set; } = false;
public bool ShowDeathOnWorldmap { get; set; } = false;

public bool ShowMapCloseFriend { get; set; }
// ## BEGIN - END ## // MISC2
// ## BEGIN - END ## // MACROS
public int LastTargetRange { get; set; }
Expand Down
10 changes: 8 additions & 2 deletions src/ClassicUO.Client/Dust765/External/OnCastingGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using ClassicUO.Renderer;
using ClassicUO.Dust765.Managers;
using System;
using ClassicUO.Game.Data;

namespace ClassicUO.Dust765.External
{
Expand Down Expand Up @@ -60,10 +61,15 @@ public void Start(uint _spell_id, uint _re = 0)
}

try
{
{
SpellAction spell = (SpellAction)_spell_id;
circle = (uint)SpellManager.GetCircle(spell);
_endTime = _startTime + 400 + circle * 250 + _re; // (0.5+ 0.25 * circle) * 1000
uint protection_delay = 0;
if (World.Player.IsBuffIconExists(BuffIconType.Protection))
{
protection_delay = protection_delay + 4;
}
_endTime = _startTime + 400 + (circle + protection_delay) * 250 + _re; // (0.5+ 0.25 * circle) * 1000
GameActions.iscasting = true;
}
catch
Expand Down
17 changes: 11 additions & 6 deletions src/ClassicUO.Client/Dust765/Shared/SpellManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public enum SpellCircle
Fifth,
Sixth,
Seventh,
Eighth
Eighth,
Ninth,
Eleventh,
Twelfth
}

public enum SpellAction : ushort
Expand Down Expand Up @@ -247,7 +250,6 @@ public static SpellCircle GetCircle(SpellAction spell)
case SpellAction.Strength:
case SpellAction.CurseWeapon:
case SpellAction.PainSpike:
case SpellAction.AttuneWeapon:
case SpellAction.CleansebyFire:
case SpellAction.Thunderstorm:
return SpellCircle.Second;
Expand All @@ -265,11 +267,12 @@ public static SpellCircle GetCircle(SpellAction spell)
case SpellAction.SummonFey:
case SpellAction.SummonFiend:
case SpellAction.ReaperForm:
case SpellAction.Wildfire:
case SpellAction.EssenceofWind:
case SpellAction.DryadAllure:
case SpellAction.EtherealVoyage:
case SpellAction.WordofDeath:
case SpellAction.Wildfire:
case SpellAction.EssenceofWind:

return SpellCircle.Third;

case SpellAction.ArchCure:
Expand All @@ -281,7 +284,6 @@ public static SpellCircle GetCircle(SpellAction spell)
case SpellAction.ManaDrain:
case SpellAction.Recall:
case SpellAction.RemoveCurse:
case SpellAction.GiftofLife:
case SpellAction.ArcaneCircle:
case SpellAction.HorrificBeast:
case SpellAction.Exorcism:
Expand All @@ -291,6 +293,8 @@ public static SpellCircle GetCircle(SpellAction spell)
case SpellAction.PoisonStrike:
case SpellAction.Wither:
case SpellAction.MindRot:
case SpellAction.GiftofLife:
case SpellAction.AttuneWeapon:
return SpellCircle.Fourth;

case SpellAction.BladeSpirits:
Expand Down Expand Up @@ -337,8 +341,9 @@ public static SpellCircle GetCircle(SpellAction spell)
case SpellAction.EarthElemental:
case SpellAction.FireElemental:
case SpellAction.WaterElemental:
case SpellAction.GiftofRenewal:
return SpellCircle.Eighth;
case SpellAction.GiftofRenewal:
return SpellCircle.Twelfth;
}
throw new InvalidOperationException();
}
Expand Down
8 changes: 6 additions & 2 deletions src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,15 @@ protected override void OnMouseDown(int x, int y, MouseButtonType button)
// ## BEGIN - END ## // MISC
Entity ent = World.Get(LocalSerial);
if (ent == null)
{
TargetManager.LastTargetInfo.Serial = LocalSerial;
TargetManager.CancelTarget();
}

else
{
TargetManager.LastTargetInfo.Serial = LocalEntity.Serial;
GameActions.Print($"Changing last target to {LocalEntity.Name}");
GameActions.Print(World.Player, $"Target: {LocalEntity.Name}");
TargetManager.CancelTarget();
}
// ## BEGIN - END ## // MISC
Mouse.LastLeftButtonClickTime = 0;
Expand Down
7 changes: 6 additions & 1 deletion src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ internal class OptionsGump : Gump
private InputField _SpecialSetLastTargetClilocText, _blockWoSArt, _blockEnergyFArt;
// ## BEGIN - END ## // MISC
// ## BEGIN - END ## // MISC2
private Checkbox _wireframeView, _hueImpassableView, _transparentHouses, _invisibleHouses, _ignoreCoT, _showDeathOnWorldmap, _drawMobilesWithSurfaceOverhead;
private Checkbox _wireframeView, _hueImpassableView, _transparentHouses, _invisibleHouses, _ignoreCoT, _showDeathOnWorldmap, _showMapCloseFriend, _drawMobilesWithSurfaceOverhead;
private HSliderBar _transparentHousesZ, _transparentHousesTransparency, _invisibleHousesZ, _dontRemoveHouseBelowZ;
// ## BEGIN - END ## // MISC2
// ## BEGIN - END ## // MACROS
Expand Down Expand Up @@ -4424,6 +4424,10 @@ private void BuildDust()

section8.Add(_showDeathOnWorldmap = AddCheckBox(null, "Show death location on world map for 5min:", _currentProfile.ShowDeathOnWorldmap, startX, startY));
startY += _showDeathOnWorldmap.Height + 2;

section8.Add(_showMapCloseFriend = AddCheckBox(null, "Show closed friend in World Map:", _currentProfile.ShowMapCloseFriend, startX, startY));
startY += _showMapCloseFriend.Height + 2;

// ## BEGIN - END ## // MISC2
// ## BEGIN - END ## // NAMEOVERHEAD
SettingsSection section9 = AddSettingsSection(box, "-----NAMEOVERHEAD-----");
Expand Down Expand Up @@ -7821,6 +7825,7 @@ private void Apply()
// ## BEGIN - END ## // ONCASTINGGUMP
_currentProfile.OnCastingGump = _onCastingGump.IsChecked;
_currentProfile.OnCastingGump_hidden = _onCastingGump_hidden.IsChecked;
_currentProfile.ShowMapCloseFriend = _showMapCloseFriend.IsChecked;
// ## BEGIN - END ## // ONCASTINGGUMP
// ## BEGIN - END ## // MISC3 SHOWALLLAYERS
_currentProfile.ShowAllLayers = _showAllLayers.IsChecked;
Expand Down
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ private void DrawAll(UltimaBatcher2D batcher, Rectangle srcRect, int gX, int gY,
{
if (string.IsNullOrEmpty(wme.Name) && !string.IsNullOrEmpty(partyMember.Name))
{
wme.Name = partyMember.Name;
wme.Name = wme.GetName(partyMember.Serial);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/ClassicUO.Client/Game/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ public static void Update()
}
else
{
if (mob.NotorietyFlag == NotorietyFlag.Ally)
WMapEntity wme = WMapManager.GetEntity(mob.Serial);
if (mob.NotorietyFlag == NotorietyFlag.Ally || wme != null && wme.IsGuild)
{
WMapManager.AddOrUpdate
(
Expand Down

0 comments on commit 7a5592c

Please sign in to comment.