Skip to content

Commit badca70

Browse files
authored
feat: (Day) Really tiny PR to target party members when clicked on names in the party menu (AscensionGameDev#2086)
1 parent 24ece0f commit badca70

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Intersect.Client/Interface/Game/PartyWindow.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,15 @@ public void Update()
205205
mMpValue[i].Show();
206206
mMpBarContainer[i].Show();
207207

208-
mLblnames[i].Text = Strings.Parties.name.ToString(
208+
var nameLabel = mLblnames[i];
209+
210+
nameLabel.Text = Strings.Parties.name.ToString(
209211
Globals.Me.Party[i].Name, Globals.Me.Party[i].Level
210212
);
211213

214+
nameLabel.UserData = Globals.Me.Party[i].Id;
215+
nameLabel.Clicked += PartyWindow_Clicked;
216+
212217
if (mHpBar[i].Texture != null)
213218
{
214219
var partyHpWidthRatio = 1f;
@@ -292,6 +297,16 @@ public void Update()
292297
}
293298
}
294299

300+
private void PartyWindow_Clicked(Base sender, ClickedEventArgs arguments)
301+
{
302+
var memberId = (Guid)((Label)sender).UserData;
303+
304+
if (Globals.Entities.TryGetValue(memberId, out var teammate))
305+
{
306+
Globals.Me.TryTarget(teammate);
307+
}
308+
}
309+
295310
public void Show()
296311
{
297312
mPartyWindow.IsHidden = false;

0 commit comments

Comments
 (0)