public static void Initialize() { CheatToolsWindow.OnShown = window => { _studioInstance = Studio.Studio.IsInstance() ? Studio.Studio.Instance : null; _soundInstance = Manager.Sound.Instance; _sceneInstance = Scene.Instance; _gameMgr = Game.IsInstance() ? Game.Instance : null; _resources = Resources.Instance; _map = Map.IsInstance() ? Map.Instance : null; _hScene = HSceneFlagCtrl.IsInstance() ? HSceneFlagCtrl.Instance : null; _gameTimeText = null; _openInInspectorButtons = new[] { new KeyValuePair <object, string>(_map != null && _map.AgentTable.Count > 0 ? (Func <object>)(() => _map.AgentTable.Values.Select(x => new ReadonlyCacheEntry(x.CharaName, x))) : null, "Heroine list"), new KeyValuePair <object, string>(Manager.ADV.IsInstance() ? Manager.ADV.Instance : null, "Manager.ADV.Instance"), new KeyValuePair <object, string>(AnimalManager.IsInstance() ? AnimalManager.Instance : null, "Manager.AnimalManager.Instance"), new KeyValuePair <object, string>(_map, "Manager.Map.Instance"), new KeyValuePair <object, string>(Character.IsInstance() ? Character.Instance : null, "Manager.Character.Instance"), new KeyValuePair <object, string>(Config.IsInstance() ? Config.Instance : null, "Manager.Config.Instance"), new KeyValuePair <object, string>(_gameMgr, "Manager.Game.Instance"), new KeyValuePair <object, string>(Manager.Housing.IsInstance() ? Manager.Housing.Instance : null, "Manager.Housing.Instance"), new KeyValuePair <object, string>(_sceneInstance, "Manager.Scene.Instance"), new KeyValuePair <object, string>(_soundInstance, "Manager.Sound.Instance"), new KeyValuePair <object, string>(_studioInstance, "Studio.Instance"), new KeyValuePair <object, string>((Func <object>)EditorUtilities.GetRootGoScanner, "Root Objects") }; }; CheatToolsWindow.Cheats.Add(new CheatEntry(w => _map != null && _map.Player != null && _map.Player.PlayerData != null, DrawPlayerCheats, "Start the game to see player cheats")); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _map != null && _map.Simulator != null, DrawEnviroControls, null)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _hScene != null, DrawHSceneCheats, null)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _map != null, DrawGirlCheatMenu, null)); CheatToolsWindow.Cheats.Add(CheatEntry.CreateOpenInInspectorButtons(() => _openInInspectorButtons)); }
private void SettingInventoryFilter() { Manager.Resources resources = !Singleton <Manager.Resources> .IsInstance() ? (Manager.Resources)null : Singleton <Manager.Resources> .Instance; PlayerActor playerActor = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player; if (Object.op_Equality((Object)resources, (Object)null) || Object.op_Equality((Object)playerActor, (Object)null)) { return; } PetHomePoint.HomeKind kind = this._currentPetHomePoint.Kind; Dictionary <int, List <ValueTuple <ItemIDKeyPair, int> > > petItemInfoTable = resources.AnimalTable.PetItemInfoTable; int key = (int)kind; InventoryFacadeViewer.ItemFilter[] itemFilter1 = (InventoryFacadeViewer.ItemFilter[])null; if (!this._itemFilterTable.TryGetValue(key, out itemFilter1)) { List <ValueTuple <ItemIDKeyPair, int> > valueTupleList; petItemInfoTable.TryGetValue(key, out valueTupleList); if (!((IReadOnlyList <ValueTuple <ItemIDKeyPair, int> >)valueTupleList).IsNullOrEmpty <ValueTuple <ItemIDKeyPair, int> >()) { Dictionary <int, List <int> > toRelease = DictionaryPool <int, List <int> > .Get(); using (List <ValueTuple <ItemIDKeyPair, int> > .Enumerator enumerator = valueTupleList.GetEnumerator()) { while (enumerator.MoveNext()) { ItemIDKeyPair itemIdKeyPair = (ItemIDKeyPair)enumerator.Current.Item1; List <int> intList1; if (!toRelease.TryGetValue(itemIdKeyPair.categoryID, out intList1) || intList1 == null) { List <int> intList2 = ListPool <int> .Get(); toRelease[itemIdKeyPair.categoryID] = intList2; intList1 = intList2; } intList1.Add(itemIdKeyPair.itemID); } } InventoryFacadeViewer.ItemFilter[] itemFilter2 = new InventoryFacadeViewer.ItemFilter[toRelease.Count]; int index1 = 0; foreach (KeyValuePair <int, List <int> > keyValuePair in toRelease) { int[] IDs = new int[keyValuePair.Value.Count]; for (int index2 = 0; index2 < IDs.Length; ++index2) { IDs[index2] = keyValuePair.Value[index2]; } itemFilter2[index1] = new InventoryFacadeViewer.ItemFilter(keyValuePair.Key, IDs); ++index1; } List <int> list = toRelease.Keys.ToList <int>(); for (int index2 = 0; index2 < list.Count; ++index2) { ListPool <int> .Release(toRelease[list[index2]]); } DictionaryPool <int, List <int> > .Release(toRelease); this._itemFilterTable[key] = itemFilter2; this._inventoryUI.SetItemFilter(itemFilter2); } else { this._itemFilterTable[key] = this._emptyFilter; this._inventoryUI.SetItemFilter(this._emptyFilter); } } else { this._inventoryUI.SetItemFilter(itemFilter1); } }
public static void Resources_Awake_SetMaxAgents(Manager.Resources __instance) => Traverse.Create(__instance.DefinePack.MapDefines).Field("_agentMax").SetValue(girlCount);