/// <summary> Moves any ILayer from layer to layer when ZPos is changed. </summary> private void OnFieldChanged(object Object, FieldOrProperty field, object oldValue) { if (!(Object is IGameObject && sector.Contains((IGameObject)Object))) //return, if it's not (GameObject in our sector) { return; } if (Object is IDrawableLayer && field.Name == "Layer") //filter for ILayer.Layer { Layer layer = (Layer)SceneGraphRoot; ILayer ILayer = (ILayer)Object; ColorNode color = colors[ILayer]; int oldLayer = (int)oldValue; layer.Remove(oldLayer, color); layer.Add(ILayer.Layer, color); QueueDraw(); } PropertyPropertiesAttribute propertyProperties = (PropertyPropertiesAttribute) field.GetCustomAttribute(typeof(PropertyPropertiesAttribute)); if (propertyProperties != null && propertyProperties.RedrawOnChange) //Every property that affects appearance is marked using this attribute { QueueDraw(); } }
/// <summary> Static member accesible for other ICustomSettingsWidgets. </summary> public static void CreateToolTip(object caller, Widget widget, FieldOrProperty field) { // Create a tooltip if we can. PropertyPropertiesAttribute propertyProperties = (PropertyPropertiesAttribute) field.GetCustomAttribute(typeof(PropertyPropertiesAttribute)); if ((propertyProperties != null) && (caller.GetType() == typeof(PropertiesView))) { //PropertiesView propview = (PropertiesView)caller; widget.TooltipText = propertyProperties.Tooltip; } }
/// <summary> Static member accesible for other ICustomSettingsWidgets. </summary> public static void CreateToolTip(object caller, Widget widget, FieldOrProperty field) { // Create a tooltip if we can. PropertyPropertiesAttribute propertyProperties = (PropertyPropertiesAttribute) field.GetCustomAttribute(typeof(PropertyPropertiesAttribute)); if ((propertyProperties != null) && (caller.GetType() == typeof(PropertiesView))) { PropertiesView propview = (PropertiesView)caller; propview.tooltips.SetTip(widget, propertyProperties.Tooltip, propertyProperties.Tooltip); } }
/// <summary> Moves any ILayer from layer to layer when ZPos is changed. </summary> private void OnFieldChanged(object Object, FieldOrProperty field, object oldValue) { if (! (Object is IGameObject && sector.Contains((IGameObject)Object))) //return, if it's not (GameObject in our sector) return; if (Object is IDrawableLayer && field.Name == "Layer") { //filter for ILayer.Layer Layer layer = (Layer) SceneGraphRoot; ILayer ILayer = (ILayer) Object; ColorNode color = colors[ILayer]; int oldLayer = (int) oldValue; layer.Remove(oldLayer, color); layer.Add(ILayer.Layer, color); QueueDraw(); } PropertyPropertiesAttribute propertyProperties = (PropertyPropertiesAttribute) field.GetCustomAttribute(typeof(PropertyPropertiesAttribute)); if (propertyProperties != null && propertyProperties.RedrawOnChange) //Every property that affects appearance is marked using this attribute QueueDraw(); }