A game about forced loneliness, made by TACStudios
1using UnityEngine.UIElements;
2
3namespace UnityEditor.Tilemaps
4{
5 [UxmlElement]
6 public partial class TilePaletteClipboardErrorElement : VisualElement
7 {
8 private static readonly string ussClassName = "unity-tilepalette-clipboard-error-element";
9 private static readonly string k_Name = L10n.Tr("Tile Palette Clipboard Error Element");
10
11 internal static class Styles
12 {
13 public static readonly string emptyPaletteInfo = L10n.Tr("Drag Tile, Sprite or Texture (Sprite type) asset/s here.");
14 public static readonly string invalidPaletteInfo = L10n.Tr("This is an invalid palette. Did you delete the palette asset?");
15 public static readonly string invalidGridInfo = L10n.Tr("The palette has an invalid Grid. Did you add a Grid to the palette asset?");
16 public static readonly string invalidDragAndDropInfo = L10n.Tr("You have dragged invalid items to the palette.");
17 }
18
19 private Label m_LabelElement;
20
21 public TilePaletteClipboardErrorElement()
22 {
23 AddToClassList(ussClassName);
24
25 name = k_Name;
26 TilePaletteOverlayUtility.SetStyleSheet(this);
27
28 m_LabelElement = new Label();
29 Add(m_LabelElement);
30 }
31
32 public void SetEmptyPaletteText()
33 {
34 m_LabelElement.text = Styles.emptyPaletteInfo;
35 }
36
37 public void SetInvalidPaletteText()
38 {
39 m_LabelElement.text = Styles.invalidPaletteInfo;
40 }
41
42 public void SetInvalidGridText()
43 {
44 m_LabelElement.text = Styles.invalidGridInfo;
45 }
46
47 public void SetInvalidDragAndDropText()
48 {
49 m_LabelElement.text = Styles.invalidDragAndDropInfo;
50 }
51
52 public void ClearText()
53 {
54 m_LabelElement.text = null;
55 }
56 }
57}