Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight friends in the online list #79

Merged
merged 2 commits into from Aug 31, 2018

Conversation

GrantBartlett
Copy link
Member

  • Currently highlights friends in the online box with a star

friends

* Currently highlights friends in the online box with a star
@GrantBartlett GrantBartlett changed the title First pass at a custom player list box Highlight friends in the online list Aug 4, 2018
@Rampastring Rampastring self-requested a review August 25, 2018 10:07
Copy link
Member

@Rampastring Rampastring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to fix, otherwise looks good.

}

if (DrawBorders)
DrawPanelBorders();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to call DrawChildren at the end of the draw function for the scroll bar to get drawn.

@@ -13,5 +13,6 @@ public ChannelUser(IRCUser ircUser)
public IRCUser IRCUser { get; private set; }

public bool IsAdmin { get; set; }
public bool IsFriend { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property should be moved to IRCUser. After all, if a user is a friend of yours on one channel, they'll also be your friend on another channel.

lbPlayerList.Clear();

foreach (ChannelUser user in currentChatChannel.Users)
{
AddUser(user);
user.IsFriend = pmWindow.IsFriend(user.IRCUser.Name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better to set this property when the user joins CnCNet (in CnCNetManager), although that'd need splitting the friend-handling functions from the PM window so this is a fine temporary hack.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did see that too, I didn't want to do that in this PR though.

GetColorWithAlpha(FocusColor));
}

if (user.IsAdmin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be possible to just draw lbItem.Texture here using Renderer.DrawTexture instead of performing these checks? The checks in AddUserToList look identical.

* Added call to draw scroll bars
* Moved IsFriend from ChannelUser to IRCUser
* Simplified draw texture
@GrantBartlett
Copy link
Member Author

@Rampastring is there a place you would like the friend icon to be placed in the repo? I've also done a new commit with your changes.

@Rampastring

This comment has been minimized.

@Rampastring
Copy link
Member

Rampastring commented Aug 31, 2018

Hm right, the friend icon is just loaded as a regular texture, that's fine too.

You don't need to add the icon to the repo, I'll update the DTA resources later and also include the friend icon.

@Rampastring Rampastring merged commit 9b0cb27 into CnCNet:master Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants