Skip to content

Add SayText2 colors package to message module (fix issue #252) #260

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

Merged
merged 1 commit into from
Dec 15, 2018

Conversation

thetredev
Copy link
Contributor

@thetredev thetredev commented Oct 15, 2018

Test Script

from filters.players import PlayerIter

from messages.colors.saytext2 import GREEN
from messages.colors.saytext2 import ORANGE
from messages.colors.saytext2 import DARK_BLUE
from messages.colors.saytext2 import DULL_RED
from messages.colors.saytext2 import PINK
from messages.colors.saytext2 import DARK_BLUE
from messages.colors.saytext2 import YELLOW
from messages.colors.saytext2 import GRAY
from messages.colors.saytext2 import BRIGHT_GREEN
from messages.colors.saytext2 import RED
from messages.colors.saytext2 import BLUE
from messages.colors.saytext2 import LIGHT_BLUE
from messages.colors.saytext2 import PALE_RED
from messages.colors.saytext2 import WHITE


MY_COLORS = {
    'GREEN': GREEN,
    'ORANGE': ORANGE,
    'DULL_RED': DULL_RED,
    'PINK': PINK,
    'DARK_BLUE': DARK_BLUE,
    'YELLOW': YELLOW,
    'GRAY': GRAY,
    'BRIGHT_GREEN': BRIGHT_GREEN,
    'RED': RED,
    'BLUE': BLUE,
    'LIGHT_BLUE': LIGHT_BLUE,
    'PALE_RED': PALE_RED,
    'WHITE': WHITE
}


for player in PlayerIter('human'):
    for name, color in MY_COLORS.items():
        SayText2(f'{color}{name}').send(player.index)

CS:GO colors PALE_GREEN, PINK and DULL_RED are approximated for CS:S/OrangeBox using RGB values. colors.DARK_BLUE is too dark for the CS:S/OrangeBox chat box, so I changed it to Color(0, 0, 180).

Results

(ignore the SAYTEXT2_ prefix)

CS:S

saytext2_css

CS:GO

saytext2_csgo

Issues

  • Team color (\x03 for CS:GO) is not implemented. How would I go about that for CS:S/OrangeBox?
  • I can't test it with games other than CS:S and CS:GO. Does this issue only apply to the two games or the engines themselves?
  • What should we do for translation strings and INI files where chat colors are stored for plugins?
  • Any suggestions?

@Ayuto
Copy link
Member

Ayuto commented Oct 15, 2018

Thanks for the PR! The SAYTEXT2_ prefix is a little bit redundant, because the colors are already stored in a separate module.

@thetredev
Copy link
Contributor Author

Yeah I thought about that, too. Should I remove it?

@Ayuto
Copy link
Member

Ayuto commented Oct 15, 2018

Yes, please!

@thetredev
Copy link
Contributor Author

Done!

@Ayuto Ayuto merged commit fb1c6e4 into Source-Python-Dev-Team:master Dec 15, 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.

2 participants