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

Update promos #337

Merged
merged 4 commits into from
May 12, 2021
Merged

Update promos #337

merged 4 commits into from
May 12, 2021

Conversation

megalon
Copy link
Member

@megalon megalon commented May 9, 2021

Updated promos logic to allow for up to 3 links per promo, and updated the YUR promo for the new format.

Screenshot:
image

This implementation is a bit gross, but this is the best way I could get this to work correctly.

In the future it may be worth using a more elegant solution, but it doesn't seem like this type of styling is easy to dynamically generate in this situation. My knowledge of WPF is limited, so there may be an easier way to do this that I've overlooked.

Before anyone tries to go down that rabbit hole like I did, here's what I tried:

Access the mod's StackPanel directly to inject the promo elements when needed
It is possible to find elements by name using rootElementName.FindName("nameToFind"), but the element would need a unique name in the list.
Unfortunately, it is not possible to set the name programmatically through xaml, such as with Name="{Binding ModName}" .
I think this would be possible if the xaml for the list were generated from the C# code, but it would require reworking a lot of MA.

Using a different WPF element other than TextBlock
Using a different element still runs into the same issue as above, and the hyperlinks would still need to be their own child elements.

@megalon megalon added the enhancement New feature or request label May 9, 2021
@Assistant Assistant merged commit 328a2d0 into bsmg:master May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants