Parcourir la source

Enhanced Attribute Inspector to display 'strike-out' visual cue in DropDownList editor having different values in multi-edit case.

Wei Tjong Yao il y a 12 ans
Parent
commit
fd8b475a3e
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      Bin/Data/Scripts/Editor/AttributeEditor.as

+ 5 - 0
Bin/Data/Scripts/Editor/AttributeEditor.as

@@ -48,6 +48,7 @@ UIElement@ SetValue(CheckBox@ element, bool value, bool sameValue)
 UIElement@ SetValue(DropDownList@ element, int value, bool sameValue)
 {
     element.selection = sameValue ? value : M_MAX_UNSIGNED;
+    element.placeholder.children[0].visible = !sameValue;
     return element;
 }
 
@@ -194,6 +195,10 @@ UIElement@ CreateIntAttributeEditor(ListView@ list, Array<Serializable@>@ serial
         attrEdit.style = uiStyle;
         attrEdit.SetFixedHeight(ATTR_HEIGHT - 2);
         attrEdit.resizePopup = true;
+        Text@ placeHolderText = Text();
+        attrEdit.placeholder.AddChild(placeHolderText);
+        placeHolderText.style = uiStyle;
+        placeHolderText.text = STRIKED_OUT;
         attrEdit.vars["Index"] = index;
         attrEdit.vars["SubIndex"] = subIndex;
         attrEdit.SetLayout(LM_HORIZONTAL, 0, IntRect(4, 1, 4, 1));