private void LoadTooltips() { // Merge SVE Config with main config var CustomMapTooltips = SVEConfig != null ? ModMain.Config.CustomMapTooltips.Concat(SVEConfig.CustomMapTooltips).ToLookup(x => x.Key, x => x.Value) .ToDictionary(x => x.Key, g => g.First()) : ModMain.Config.CustomMapTooltips; foreach (var tooltip in CustomMapTooltips) { string text = tooltip.Value.GetValue("SecondaryText") != null ? (string)tooltip.Value.GetValue("PrimaryText") + Environment.NewLine + tooltip.Value.GetValue("SecondaryText") : (string)tooltip.Value.GetValue("PrimaryText"); Tooltips.Add(new ClickableComponent( new Rectangle( (int)tooltip.Value.GetValue("X"), (int)tooltip.Value.GetValue("Y"), (int)tooltip.Value.GetValue("Width"), (int)tooltip.Value.GetValue("Height") ), text )); } }
private void LoadTooltips() { foreach (var tooltip in ModMain.CustomData.CustomMapTooltips) { string text = tooltip.Value.GetValue("SecondaryText") != null ? (string)tooltip.Value.GetValue("PrimaryText") + Environment.NewLine + tooltip.Value.GetValue("SecondaryText") : (string)tooltip.Value.GetValue("PrimaryText"); Tooltips.Add(new ClickableComponent( new Rectangle( (int)tooltip.Value.GetValue("X"), (int)tooltip.Value.GetValue("Y"), (int)tooltip.Value.GetValue("Width"), (int)tooltip.Value.GetValue("Height") ), text )); } }
public ToolTipHelper RegisterTooltip(Point t, FrameworkElement re) { Extensions.Execute.UIThread(() => { MessageBox.Show(GetAbsoltutePlacement(re).ToString()); }); ToolTipHelper Helper = new ToolTipHelper { X = Math.Abs(t.X), Y = Math.Abs(t.Y), BorderBrush = "FFFFFF", Background = "000000", Opacity = 0.9, Text = "Hej", BorderSize = 3, CornerRadius = 3, Width = 100, Height = 100, }; Tooltips.Add(Helper); return(Helper); }