-
Notifications
You must be signed in to change notification settings - Fork 6
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 customization to the scoreboard #9
Add customization to the scoreboard #9
Conversation
Great works ! |
Heads up, in 3ffb160 we changed the naming of our logo a bit - icon will refer to the 1:1 image of the specter, while logo refers to the icon with text |
bdc5771
to
b889f2e
Compare
Thank you, rebased and updated the logos to match. Meanwhile, I've been hitting some issues with how the SVG coloring is going to work. Currently, what I'm doing is updating the SVG with a function and replacing the fill color. Spectra-Frontend/src/app/combat/playercard/playercard.component.ts Lines 99 to 112 in b889f2e
However, this has some issues because currently, the Input for the component will not trigger change detection and therefore not re-trigger the updateSvg method in, for example, the testing component. This would have to be changed to a BehaviorSubject so we can track the changes. If there's any other ideas you have to solve this, I'm very open to suggestions as I don't want to just rewrite a lot of the main functionality of the application without your opinions first @DarkView @Tiranthine. |
Yeah we tried changing the color with CSS and the like too, so we don't have to have different files for each color. |
Definitely true, the simple other option is to just have a separate component for the Shield where the SVGs are inside the template. That would solve the problem without having to rewrite everything to use Subjects. I'll try to implement it that way and then you can see if that's something that makes sense to you. I haven't found any other way to change the pictures other than using something like an SVG overlay over a white version of the graphic or a calculated filter. |
Yeah that was the only way we found too. |
Since it's probably rarely gonna happen that changes need to be made to the Shield Icons such as recently, I think this option will hold out for a long time while keeping it all working with custom colors. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
1776f52
to
06e9cd2
Compare
Successfully rebased everything onto the current main branch and ran formatting as needed. |
This currently changes the default color in the config file here
for easy review if everything is still recolored as it should. This should be changed before merging or immediately after so people that don't want the custom color don't get forced onto it. I am also considering if I should add an optional query parameter for the colors, so people can use the official HUD without having to selfhost it to customize the colors. I would say this is up to @DarkView @Tiranthine depending on how something like an admin panel is coming along. |
Looking at the colors side by side, sadly the calculation approach to lightening the colors seems to produce results that are noticeably off from the original. |
Alright, so the reason the gradient doesn't look the same on this is because it's made inconsistently, where the secondary color is used for the red gradient but the primary for the green gradient. If you really want @DarkView I could add a fourth and fifth color option stating which color each gradient should use. But I think making the red a bit less potent is not that bad, but that's up to you. It's your project in the end. Edit: now that I think about it, this would also mean adding a separate configuration option for the gradients in the round reasons and player score components |
Looks good to me otherwise! |
Applied the requested changes. Happy holidays! |
This pull request is adding some features I've wanted to use myself and/or that had been asked if it was possible in the discord channels.
Main Additions
Customizable Colors
Here I am thinking of two different functionalities, one is being able to set defaults in the JSON configuration file already existing in the previous version since #4. Additionally, the user of the HUD should be able to customize their HUD using query parameters, like the group code already does.
The colors are applied to the following elements:
Customizable Sponsor Images
Since this is already working with a single image, I have already expanded this (in 68cbd2d) to add multiple images in the config, since this is most likely only used in self-hosted scenarios. If there's enough need for it, I might add this to query parameters too, however this would make them very crowded which is not great for readability of links.
Considerations/Ideas for the future
Due to how dependent on users these configurations are, it would be possible to make them be passed by the client. However, I would refrain from doing that since the client already handles a lot for "only" being an observer client. In my opinion, an Admin Panel or similar should be added in the future to customize the HUD before observers can simply launch their client, type in their authentication data and launch the game. A tournament admin, or in some cases also the same person, can then submit all the information that's needed for the HUD to be customized correctly beforehand. This could be temporarily stored in something like a Redis database or even memory (scalability would be a problem here though), so it can easily be retrieved.