public override void SetItems(List <ItemId> itemIds) { SetItems(itemIds, DefaultSlots, DefaultSlots); IntPtr address = Start + (DefaultSlots - 1) * Step; if (OpenSlots.Count == 0) { return; } // Since the item count above isn't accurate (just a default value large enough to reasonably accommodate // most scenarios), fake slots at the end of the list must be removed in order for the initial state to be // correct. for (int i = 0; i < DefaultSlots; i++) { int rawId = MemoryTools.ReadInt(Handle, address); address -= Step; if (rawId == -1) { OpenSlots.RemoveLast(); TotalSlots--; } else { break; } } }
public ActionResult Slots(DateTime? day, int? interval = 1) { var appointmentsFor = appointments.ForDay(day.Value.Date); appointmentsFor = appointments.ForDay(day.Value.Date); var slots = new OpenSlots(); slots.RegisterAppointments(appointmentsFor); var intervalSlots = new List<dynamic>(); foreach (var s in slots) intervalSlots.AddRange(s.Variations(hours: interval)); return new DynamicJsonResult(new { slots = intervalSlots, appointments = appointmentsFor }); }
public static void EndProjectile(LSProjectile projectile) { int id = projectile.ID; if (ProjectileActive[id] == false) { return; } if (ProjectileBucket[id] != projectile) { return; } ProjectileActive[id] = false; ProjectileBucket[id] = null; OpenSlots.Add(id); CacheProjectile(projectile); projectile.Deactivate(); }
private void UpdateFoldouts() { if (!OpenSlots.ContainsKey("wardrobeSets")) { OpenSlots.Add("wardrobeSets", true); } if (!OpenSlots.ContainsKey("arbitraryRecipes")) { OpenSlots.Add("arbitraryRecipes", true); } for (int i = 0; i < _compatibleRaces.Count; i++) { bool open = i == 0 ? true : false; if (!OpenSlots.ContainsKey(_compatibleRaces[i])) { OpenSlots.Add(_compatibleRaces[i], open); } } }
public bool Equals(DestinyProfileTransitoryJoinability input) { if (input == null) { return(false); } return (( OpenSlots == input.OpenSlots || (OpenSlots.Equals(input.OpenSlots)) ) && ( PrivacySetting == input.PrivacySetting || (PrivacySetting != null && PrivacySetting.Equals(input.PrivacySetting)) ) && ( ClosedReasons == input.ClosedReasons || (ClosedReasons != null && ClosedReasons.Equals(input.ClosedReasons)) )); }
public static void Initialize() { Array.Clear(ProjectileActive, 0, ProjectileActive.Length); OpenSlots.FastClear(); PeakCount = 0; }
public override bool OnGUI(string targetName, ref bool _dnaDirty, ref bool _textureDirty, ref bool _meshDirty) { bool changed = false; if (!OpenSlots.ContainsKey("wardrobeSet")) { OpenSlots.Add("wardrobeSet", true); } if (_sharedColorsEditor.OnGUI(_recipe)) { changed = true; } //if this is a backwards compatible DCS recipe (i.e. has SlotData AND a Wardrobe set) we need to show BOTH things //for this to really work youd need to be able to edit the WardrobeSet and have that modify the slotDataList //Hence the epic UpdateBackwardsCompatibleData method if (_recipe.slotDataList.Length > 0) { EditorGUILayout.HelpBox("This is a 'Backwards Compatible' DynamicCharacterAvatar recipe. The slots and overlays in the 'BackwardsCompatibleData' section will update as you change the items in the WardrobeSet.", MessageType.Info); } if (DrawWardrobeSetUI()) { changed = true; if (_recipe.slotDataList.Length > 0) { UpdateBackwardsCompatibleData(); } } if (_recipe.slotDataList.Length > 0) { if (!OpenSlots.ContainsKey("backwardsCompatibleData")) { OpenSlots.Add("backwardsCompatibleData", false); } GUILayout.BeginHorizontal(EditorStyles.toolbarButton); GUILayout.Space(10); bool bcdfoldoutOpen = OpenSlots["backwardsCompatibleData"]; bcdfoldoutOpen = EditorGUILayout.Foldout(OpenSlots["backwardsCompatibleData"], "Backwards Compatible Data"); OpenSlots["backwardsCompatibleData"] = bcdfoldoutOpen; GUILayout.EndHorizontal(); if (bcdfoldoutOpen) { EditorGUI.BeginDisabledGroup(true); GUIHelper.BeginVerticalPadded(10, new Color(0.75f, 0.875f, 1f)); EditorGUILayout.HelpBox("If you are going to use the recipe with a DynamicCharacterAvatar, it is recommended that you that you edit the 'WardrobeSet' section above and/or the base/wardrobe recipes directly. Changes you make manually below will only affect old style UMAAvatars", MessageType.Info); for (int i = 0; i < _slotEditors.Count; i++) { var editor = _slotEditors[i]; if (editor == null) { GUILayout.Label("Empty Slot"); continue; } changed |= editor.OnGUI(ref _dnaDirty, ref _textureDirty, ref _meshDirty); if (editor.Delete) { _dnaDirty = true; _textureDirty = true; _meshDirty = true; _slotEditors.RemoveAt(i); _recipe.SetSlot(editor.idx, null); i--; changed = true; } } GUIHelper.EndVerticalPadded(10); EditorGUI.EndDisabledGroup(); } } return(changed); }
void before_each() { openSlots = new OpenSlots(); }