mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-18 03:12:18 +12:00
commit
328a2d0aa9
|
@ -1,3 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace ModAssistant
|
||||
{
|
||||
class Promotions
|
||||
|
@ -7,8 +9,11 @@ namespace ModAssistant
|
|||
new Promotion
|
||||
{
|
||||
ModName = "YUR Fit Calorie Tracker",
|
||||
Text = "Join our Discord!",
|
||||
Link = "https://yur.chat"
|
||||
Links = new List<PromotionLink>(){
|
||||
new PromotionLink{Text = "Join our Discord!", Link = "https://yur.chat", TextAfterLink = " Or find us on "},
|
||||
new PromotionLink{Text = "iOS", Link = "https://y.at/💣🍑📱", TextAfterLink = " and " },
|
||||
new PromotionLink{Text = "Android", Link = "https://y.at/💾🔬📡💻📱", TextAfterLink = "!" }
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -16,7 +21,13 @@ namespace ModAssistant
|
|||
class Promotion
|
||||
{
|
||||
public string ModName;
|
||||
public List<PromotionLink> Links;
|
||||
}
|
||||
|
||||
class PromotionLink
|
||||
{
|
||||
public string Text;
|
||||
public string Link;
|
||||
public string TextAfterLink;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,11 +95,26 @@
|
|||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="{Binding PromotionMargin}">
|
||||
<Hyperlink NavigateUri="{Binding PromotionLink, TargetNullValue=about:blank}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Run Text="{Binding PromotionText}" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Margin="{Binding PromotionMargin}" Padding="0">
|
||||
<Hyperlink NavigateUri="{Binding PromotionLinks[0], TargetNullValue=about:blank}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Run Text="{Binding PromotionTexts[0]}" />
|
||||
</Hyperlink>
|
||||
|
||||
<TextBlock Text="{Binding PromotionTextAfterLinks[0]}" Padding="0" Margin="0" />
|
||||
|
||||
<Hyperlink NavigateUri="{Binding PromotionLinks[1], TargetNullValue=about:blank}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Run Text="{Binding PromotionTexts[1]}" />
|
||||
</Hyperlink>
|
||||
|
||||
<TextBlock Text="{Binding PromotionTextAfterLinks[1]}" Padding="0" Margin="0" />
|
||||
|
||||
<Hyperlink NavigateUri="{Binding PromotionLinks[2], TargetNullValue=about:blank}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Run Text="{Binding PromotionTexts[2]}" />
|
||||
</Hyperlink>
|
||||
|
||||
<TextBlock Text="{Binding PromotionTextAfterLinks[2]}" Padding="0" Margin="0" />
|
||||
|
||||
</TextBlock>
|
||||
<TextBlock MouseLeftButtonDown="CopyText" Text="{Binding ModDescription}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -285,8 +285,17 @@ namespace ModAssistant.Pages
|
|||
{
|
||||
if (mod.name == promo.ModName)
|
||||
{
|
||||
ListItem.PromotionText = promo.Text;
|
||||
ListItem.PromotionLink = promo.Link;
|
||||
ListItem.PromotionTexts = new string[promo.Links.Count];
|
||||
ListItem.PromotionLinks = new string[promo.Links.Count];
|
||||
ListItem.PromotionTextAfterLinks = new string[promo.Links.Count];
|
||||
|
||||
for (int i = 0; i < promo.Links.Count; ++i)
|
||||
{
|
||||
PromotionLink link = promo.Links[i];
|
||||
ListItem.PromotionTexts[i] = link.Text;
|
||||
ListItem.PromotionLinks[i] = link.Link;
|
||||
ListItem.PromotionTextAfterLinks[i] = link.TextAfterLink;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -609,13 +618,14 @@ namespace ModAssistant.Pages
|
|||
}
|
||||
}
|
||||
|
||||
public string PromotionText { get; set; }
|
||||
public string PromotionLink { get; set; }
|
||||
public string[] PromotionTexts { get; set; }
|
||||
public string[] PromotionLinks { get; set; }
|
||||
public string[] PromotionTextAfterLinks { get; set; }
|
||||
public string PromotionMargin
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(PromotionText)) return "0";
|
||||
if (PromotionTexts == null || string.IsNullOrEmpty(PromotionTexts[0])) return "-15,0,0,0";
|
||||
return "0,0,5,0";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue