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
Highlight friends in the online list #79
Conversation
GrantBartlett
commented
Aug 4, 2018
- Currently highlights friends in the online box with a star
* Currently highlights friends in the online box with a star
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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.
DXMainClient/Online/ChannelUser.cs
Outdated
@@ -13,5 +13,6 @@ public ChannelUser(IRCUser ircUser) | |||
public IRCUser IRCUser { get; private set; } | |||
|
|||
public bool IsAdmin { get; set; } | |||
public bool IsFriend { get; set; } |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
@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. |
This comment has been minimized.
This comment has been minimized.
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. |