override public void SetVisibilityMode(VisibilityMode vmode, bool forcedRefresh) { if (vmode == visibilityMode && !forcedRefresh) { return; } if (vmode == VisibilityMode.Invisible | vmode == VisibilityMode.LayerCutHide) { if (model != null) { model.SetActive(false); } } else { if (visibilityMode == VisibilityMode.Invisible | visibilityMode == VisibilityMode.LayerCutHide) { if (model == null) { PrepareModel(); } else { model.SetActive(true); } } } visibilityMode = vmode; base.SetVisibilityMode(visibilityMode, true); }
virtual public void SetVisibilityMode(VisibilityMode vmode, bool forcedRefresh) { if (visibilityMode != vmode | forcedRefresh) { if (vmode != VisibilityMode.LayerCutCancel & visibilityMode == VisibilityMode.LayerCutHide) { return; } visibilityMode = vmode; visibilityChangedEvent?.Invoke(visibilityMode, forcedRefresh); if (extension != null && (vmode == VisibilityMode.Invisible | vmode == VisibilityMode.LayerCutCancel | vmode == VisibilityMode.LayerCutHide)) { var slist = extension.GetStructuresList(); if (slist != null && slist.Count != 0) { foreach (var s in slist) { s?.SetVisibility(vmode); } } } if (mainStructure != null && !mainStructureIsABlocker && !mainStructure.IsIPlanable()) { mainStructure.SetVisibility(vmode, forcedRefresh); } } }
EnvironmentObject(Dwarrowdelf.TerrainGen.TerrainData terrain, VisibilityMode visMode, IntVector3 startLocation) : base(ObjectType.Environment) { this.Version = 1; this.VisibilityMode = visMode; terrain.GetData(out m_tileGrid, out m_levelMap); this.Size = terrain.Size; this.StartLocation = startLocation; InitFlags(); VerifyLevelMap(); m_contentArray = new KeyedObjectCollection[this.Depth]; for (int i = 0; i < this.Depth; ++i) m_contentArray[i] = new KeyedObjectCollection(); m_originalNumTrees = ParallelEnumerable.Range(0, this.Size.Depth).Sum(z => { int sum = 0; for (int y = 0; y < this.Size.Height; ++y) for (int x = 0; x < this.Size.Width; ++x) if (GetTileData(x, y, z).HasTree) sum++; return sum; }); }
private void ToVisibility() { VisibilityMode = VisibilityMode.Hidden; if (ListView) { VisibilityMode |= VisibilityMode.ListView; } if (DetailView) { VisibilityMode |= VisibilityMode.DetailView; } if (CreateView) { VisibilityMode |= VisibilityMode.CreateView; } if (UpdateView) { VisibilityMode |= VisibilityMode.UpdateView; } if (DeleteView) { VisibilityMode |= VisibilityMode.DeleteView; } }
public static void InputAccessible(MnBaseElement model, VisibilityMode visibleMode, ref Dictionary <string, object> attributeList) { if (model.VisibleMode != VisibilityMode.Both && model.VisibleMode != visibleMode) { attributeList.Add("hidden", ""); } }
public void SetVisibilityMode(VisibilityMode vm, bool forcedRefresh) { if (visibilityMode != vm | forcedRefresh) { if (visibilityMode == VisibilityMode.LayerCutHide) { if (vm != VisibilityMode.LayerCutCancel) { return; } } visibilityMode = vm; if (extension != null) { extension.SetVisibility(vm); } else { if (mainStructure != null) { if (mainStructure.IsIPlanable()) { (mainStructure as IPlanable).IPlanable_SetVisibility(vm); } else { mainStructure.SetVisibility(vm, forcedRefresh); } } } } }
} //ignore structures visibility public void IPlanable_SetVisibility(VisibilityMode vmode) { if (vmode != visibilityMode && planes != null && planes.Count != 0) { foreach (var p in planes.Values) { p.SetVisibilityMode(vmode); } visibilityMode = vmode; } }
internal void SetVisibility(VisibilityMode mode, int timeout) { if (IsBluetoothEnabled) { int ret = Interop.Bluetooth.SetVisibility(mode, timeout); if (ret != (int)BluetoothError.None) { Log.Error(Globals.LogTag, "Failed to set visibility, Error - " + (BluetoothError)ret); BluetoothErrorFactory.ThrowBluetoothException(ret); } } else { BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); } }
public void IPlanable_SetVisibility(VisibilityMode vmode) { if (vmode != visibilityMode) { if (upperPlane != null) { upperPlane.SetVisibilityMode(vmode); } if (bottomPlane != null) { bottomPlane.SetVisibilityMode(vmode); } transform.GetChild(0).gameObject.SetActive(vmode != VisibilityMode.Invisible & vmode != VisibilityMode.LayerCutHide); visibilityMode = vmode; } }
private void RegisterVisibilityChangedEvent() { _visibilityChangedCallback = (int result, int mode, IntPtr userData) => { if (_visibilityModeChanged != null) { VisibilityMode visibility = (VisibilityMode)mode; BluetoothError res = (BluetoothError)result; _visibilityModeChanged(null, new VisibilityModeChangedEventArgs(res, visibility)); } }; int ret = Interop.Bluetooth.SetVisibilityModeChangedCallback(_visibilityChangedCallback, IntPtr.Zero); if (ret != (int)BluetoothError.None) { Log.Error(Globals.LogTag, "Failed to set visibility mode changed callback, Error - " + (BluetoothError)ret); } }
public void SetElementsVisibleMode(VisibilityMode visibleMode) { Elements.ForEach(e => { e.VisibleMode = visibleMode; if (e is MnSection) { (e as MnSection).Elements.ForEach(e2 => { e2.VisibleMode = visibleMode; if (e2 is MnSection) { (e2 as MnSection).Elements.ForEach(e3 => { e3.VisibleMode = visibleMode; }); } }); } }); }
private void SetRead(Binding bnd, UIElement ctl, IAuthorizeReadWrite source) { bool canRead = source.CanReadProperty(bnd.Path.Path); VisibilityMode visibilityMode = GetNotVisibleMode(ctl); if (canRead) { switch (visibilityMode) { case VisibilityMode.Collapsed: if (ctl.Visibility == Visibility.Collapsed) { ctl.Visibility = Visibility.Visible; } break; case VisibilityMode.Hidden: if (ctl.Visibility == Visibility.Hidden) { ctl.Visibility = Visibility.Visible; } break; default: break; } } else { switch (visibilityMode) { case VisibilityMode.Collapsed: ctl.Visibility = Visibility.Collapsed; break; case VisibilityMode.Hidden: ctl.Visibility = Visibility.Hidden; break; default: break; } } }
private int OnTestObjectVisible(void *pMessage, void *pAreaObject, void *pPlayerGameObject) { NwGameObject?areaObject = CNWSObject.FromPointer(pAreaObject).ToNwObjectSafe <NwGameObject>(); NwCreature? playerGameObject = CNWSObject.FromPointer(pPlayerGameObject).ToNwObjectSafe <NwCreature>(); NwPlayer? controllingPlayer = playerGameObject?.ControllingPlayer; if (areaObject == null || controllingPlayer == null || areaObject == playerGameObject) { return(testObjectVisibleHook.CallOriginal(pMessage, pAreaObject, pPlayerGameObject)); } VisibilityMode personalOverride = GetPersonalOverride(controllingPlayer, areaObject); VisibilityMode globalOverride = GetGlobalOverride(areaObject); VisibilityMode visibilityOverride = personalOverride != VisibilityMode.Default ? personalOverride : globalOverride != VisibilityMode.Default ? globalOverride : VisibilityMode.Default; int retVal; switch (visibilityOverride) { case VisibilityMode.Hidden: retVal = false.ToInt(); break; case VisibilityMode.DMOnly: retVal = controllingPlayer.IsDM ? testObjectVisibleHook.CallOriginal(pMessage, pAreaObject, pPlayerGameObject) : false.ToInt(); break; case VisibilityMode.AlwaysVisible: retVal = true.ToInt(); break; case VisibilityMode.AlwaysVisibleDMOnly: retVal = controllingPlayer.IsDM.ToInt(); break; case VisibilityMode.Default: case VisibilityMode.Visible: default: retVal = testObjectVisibleHook.CallOriginal(pMessage, pAreaObject, pPlayerGameObject); break; } return(retVal); }
public void SetVisibility(VisibilityMode vmode, bool forcedRefresh) { byte vm = (byte)vmode; bool?newDrawMode; if (vm >= (byte)VisibilityMode.HugeObjectsLOD) { newDrawMode = null; } else { if (vm < (byte)VisibilityMode.SmallObjectsLOD) { newDrawMode = false; } else { newDrawMode = true; } } if (newDrawMode != usingLOD | forcedRefresh) { usingLOD = newDrawMode; if (usingLOD == null) { model.SetActive(false); spriter.enabled = false; } else { if (usingLOD == true) { model.SetActive(false); spriter.enabled = true; } else { model.SetActive(true); spriter.enabled = false; } } } }
EnvironmentObject(Dwarrowdelf.TerrainGen.TerrainData terrain, VisibilityMode visMode, IntVector3 startLocation) : base(ObjectType.Environment) { this.Version = 1; this.VisibilityMode = visMode; terrain.GetData(out m_tileGrid, out m_levelMap); this.Size = terrain.Size; this.StartLocation = startLocation; InitFlags(); VerifyLevelMap(); m_contentArray = new KeyedObjectCollection[this.Depth]; for (int i = 0; i < this.Depth; ++i) { m_contentArray[i] = new KeyedObjectCollection(); } m_originalNumTrees = ParallelEnumerable.Range(0, this.Size.Depth).Sum(z => { int sum = 0; for (int y = 0; y < this.Size.Height; ++y) { for (int x = 0; x < this.Size.Width; ++x) { if (GetTileData(x, y, z).HasTree) { sum++; } } } return(sum); }); }
protected virtual void UpdateProperties() { if (PropertyBlock == null) { return; } var color = PropertyBlock.GetVector(ColorPropId); color.w = Opacity; PropertyBlock.SetVector(ColorPropId, color); PropertyBlock.SetColor(WireframeColorPropId, new Color(color.x, color.y, color.z, Opacity)); if (Opacity > 0.99f) { Visibility = VisibilityMode.Opaque; } else { Visibility = Opacity < DisableThreshold ? VisibilityMode.Disabled : VisibilityMode.Transparent; } }
static public HelperVisible createVisibility(MonoBehaviour mono, VisibilityMode mode) { HelperVisible visibility = null; Debug.Assert(mono != null, "need mono here"); switch (mode) { case VisibilityMode.SPRITE: visibility = new HelperVisibleSprite(mono); break; case VisibilityMode.MESH: visibility = new HelperVisibleMesh(mono); break; case VisibilityMode.UI: visibility = new HelperVisibleUi(mono); break; case VisibilityMode.SKINNED: visibility = new HelperVisibleSkinned(mono); break; case VisibilityMode.NONE: break; default: Debug.LogError("this visibilty mode (" + mode.ToString() + ") is not implem yet"); break; } return(visibility); }
public void IPlanable_SetVisibility(VisibilityMode vmode) { if (visibilityMode == vmode) { return; } if (upperPlane != null) { upperPlane.SetVisibilityMode(vmode); } if (model != null) { if (vmode == VisibilityMode.Invisible | vmode == VisibilityMode.LayerCutHide) { model.SetActive(false); } else { model.SetActive(true); } } visibilityMode = vmode; } // no multimaterial planes
public void SetVisibility(VisibilityMode vmode, bool forcedRefresh) { if (planes != null && planes.Count > 0) { byte vismask = myBlock.myChunk.GetVisibilityMask(myBlock.pos); vismask &= existingPlanesMask; int pmask = 0; foreach (var p in planes.Values) { if (vmode != VisibilityMode.Invisible & vmode != VisibilityMode.LayerCutHide) { pmask = (1 << p.faceIndex); if ((pmask & vismask) != 0) { p.SetVisibilityMode(vmode, forcedRefresh); } } else { p.SetVisibilityMode(vmode, forcedRefresh); } } } }
protected override void INLINE_SetVisibility(VisibilityMode vmode) { } //ignore structures visibility
/// <summary> /// Initializes a new instance of <see cref="AuthenticatedFilterAttribute" /> class. /// </summary> /// <param name="mode">Specified whether the field should be shown or hidden when the user is authenticated.</param> public AuthenticatedFilterAttribute(VisibilityMode mode = VisibilityMode.Show) { Mode = mode; }
public virtual Element SetVisibilityMode(VisibilityMode mode) { string strMode = ""; switch (mode) { case VisibilityMode.Visibility: strMode = "Ext.Element.VISIBILITY"; break; case VisibilityMode.Display: strMode = "Ext.Element.DISPLAY"; break; default: throw new ArgumentOutOfRangeException("mode"); } this.Call("setVisibilityMode", new JRawValue(strMode)); return this; }
protected override void INLINE_SetVisibility(VisibilityMode vmode) { // нужно переопределение, чтобы не действовали функции предков }
internal static extern int SetVisibility(VisibilityMode visibilityMode, int duration);
/// <summary> /// Initializes a new instance of <see cref="RoleFilterAttribute" /> class. /// </summary> /// <param name="roleNames">Comma-separated list of roles. The rule is matched if the user is in any of the roles.</param> /// <param name="mode">Specified whether the field should be shown or hidden when the user is in any of the roles.</param> public RoleFilterAttribute(string roleNames, VisibilityMode mode = VisibilityMode.Show) { Mode = mode; RoleNames = roleNames.Split(',', ';').Select(s => s.Trim()).ToArray(); }
public void SetPersonalOverride(NwPlayer player, NwObject target, VisibilityMode visibilityMode) { InternalVariableEnum <VisibilityMode> value = InternalVariables.PlayerVisibilityOverride(player, target); value.Value = visibilityMode; }
/// <summary> /// Initializes a new instance of <see cref="ViewFilterAttribute" /> class. /// </summary> /// <param name="viewNames">Comma-separated list of views. The rule is matched if the current view is one of the values of this parameter.</param> /// <param name="mode">Specified whether the field should be shown or hidden when the rule is matched.</param> public ViewFilterAttribute(string viewNames, VisibilityMode mode = VisibilityMode.Show) { ViewNames = viewNames.Split(',', ';').Select(v => v.Trim()).ToArray(); Mode = mode; }
public static EnvironmentObject Create(World world, Dwarrowdelf.TerrainGen.TerrainData terrain, VisibilityMode visMode, IntVector3 startLocation) { var ob = new EnvironmentObject(terrain, visMode, startLocation); ob.Initialize(world); return ob; }
/// <summary> /// Initializes a new instance of <see cref="ViewFilterAttribute" /> class. /// </summary> /// <param name="mode">Specified whether the field should be shown or hidden.</param> public UnmatchedFilterAttribute(VisibilityMode mode) { Mode = mode; }
internal VisibilityModeChangedEventArgs(BluetoothError result, VisibilityMode mode) { _result = result; _mode = mode; }
/// <summary> /// Sets the value controlling how controls /// bound to non-readable properties will be rendered. /// </summary> public static void SetNotVisibleMode(DependencyObject obj, VisibilityMode mode) { obj.SetValue(NotVisibleModeProperty, mode); }
public void SetGlobalOverride(NwGameObject target, VisibilityMode visibilityMode) { InternalVariableEnum <VisibilityMode> value = InternalVariables.GlobalVisibilityOverride(target); value.Value = visibilityMode; }
public Visibility(VisibilityMode visibility) { Mode = visibility; }
public void SetVisibilityMode(VisibilityMode vmode) { SetVisibilityMode(vmode, false); }
public override void ReceiveObjectData(BaseGameObjectData _data) { var data = (EnvironmentObjectData)_data; base.ReceiveObjectData(_data); // XXX we currently always get the map size if (!data.Size.IsEmpty) m_tileGrid.SetSize(data.Size); this.VisibilityMode = data.VisibilityMode; }