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

Add @DisplayName to be able control the name show on status and Paperdoll #1305

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

Jhobean
Copy link
Contributor

@Jhobean Jhobean commented Oct 11, 2024

I added a new trigger for RP server.

With this trigger you are able to control the name you want to display on the paperdoll and the status bar.

@cbnolok
Copy link
Contributor

cbnolok commented Oct 13, 2024

Isn't TAG.NAME.ALT working for you?

@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 13, 2024

Isn't TAG.NAME.ALT working for you?

No because, the person knowing you must see the real name. I want hide my name only to the person not knowing me. (Like many RP server do on servUo do)
With the trigger, I can check my tag system in script and decide if this player have condition to see my name

@Jhobean Jhobean closed this Oct 13, 2024
@Jhobean Jhobean reopened this Oct 13, 2024
@cbnolok
Copy link
Contributor

cbnolok commented Oct 14, 2024

I'd opt for a different solution. It would be wise to not call any triggers right in the packet class. I'd add that code instead in CChar::GetName method. Also, is RETURN 1 really necessary? I mean, we could read anyways ARGS and use that

@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 14, 2024

The problem in get name method is I dont know who I get the name for.

I mean, my name will be different if I dont know you. If I use getName method I must add argument to the method (pTarget)...

Adding an argument is acceptable?

Even with argument, Ill have problem with the return 1 I explain just after this.

@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 14, 2024

Aboit the return 1 it was require because If I dont return 1, We get all the name with the title.

Hector the magician
Name+title

If we return 1 we force to shiw only the name (similar to incognito)

@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 14, 2024

Just notice I must add the trigger on the Tooltip too.... I'll convert to draft for now.
I just dont figure how to modify GetName function to be able do what I do.

@Jhobean Jhobean marked this pull request as draft October 14, 2024 14:01
@cbnolok
Copy link
Contributor

cbnolok commented Oct 14, 2024

You can create a CChar::GetNameFor method

@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 14, 2024

You can create a CChar::GetNameFor method

I will need to determine when use it (Will requiere a trigger) and I will need to block the rest of Info on paperdoll (Title etc.) (Will need trigger or a bool)

@Jhobean Jhobean marked this pull request as ready for review October 16, 2024 00:15
@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 16, 2024

This modif if for my custom shard. I think it can be usefull for everyone it's why I Share it.
1- I removed the cache of tooltip on Player to be able achieve what we want
2- I add the same trigger at 3 differents place because it's the only way I found how to do it

If it's not "legit" for the communauty I'll just close it and keep it on my fork.

@cbnolok
Copy link
Contributor

cbnolok commented Oct 18, 2024

While it could be useful, i wouldn't keep it in this state for some reasons: i'd avoid triggers in packet code and the removal of the tooltip cache. Having to regenerate it for each char every time can be time consuming for the cpu when the area is very crowded.

@Jhobean
Copy link
Contributor Author

Jhobean commented Oct 18, 2024

About code in packet, I habe not other idea for doing it. We should bring all the code of packet outside of the packet method.... It would be the same and make no sense. Why it's mad to add code there?

About the tootip, it's just impossible to change player name in tootip if we cache it.
An iptimisation I can do, is dont cache the tooltip only if you use the displayname trigger. But since we only dont cache the Player tooltip, I think it's not really game changer

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.

2 participants