protected override void Awake() { Log.LoadingScreen.Print("Gameplay.Awake()", new object[0]); base.Awake(); s_instance = this; GameState state = GameState.Initialize(); if (this.ShouldHandleDisconnect()) { Log.LoadingScreen.Print(LogLevel.Warning, "Gameplay.Awake() - DISCONNECTED", new object[0]); this.HandleDisconnect(); } else { Network.Get().SetGameServerDisconnectEventListener(new Network.GameServerDisconnectEvent(this.OnDisconnect)); CheatMgr.Get().RegisterCheatHandler("saveme", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_saveme), null, null, null); state.RegisterCreateGameListener(new GameState.CreateGameCallback(this.OnCreateGame)); AssetLoader.Get().LoadGameObject("InputManager", new AssetLoader.GameObjectCallback(this.OnInputManagerLoaded), null, false); AssetLoader.Get().LoadGameObject("MulliganManager", new AssetLoader.GameObjectCallback(this.OnMulliganManagerLoaded), null, false); AssetLoader.Get().LoadGameObject("ThinkEmoteController", true, false); AssetLoader.Get().LoadActor("Card_Hidden", new AssetLoader.GameObjectCallback(this.OnCardDrawStandinLoaded), null, false); AssetLoader.Get().LoadGameObject("TurnStartManager", new AssetLoader.GameObjectCallback(this.OnTurnStartManagerLoaded), null, false); AssetLoader.Get().LoadGameObject("TargetReticleManager", new AssetLoader.GameObjectCallback(this.OnTargetReticleManagerLoaded), null, false); AssetLoader.Get().LoadGameObject("GameplayErrorManager", new AssetLoader.GameObjectCallback(this.OnGameplayErrorManagerLoaded), null, false); AssetLoader.Get().LoadGameObject("RemoteActionHandler", new AssetLoader.GameObjectCallback(this.OnRemoteActionHandlerLoaded), null, false); AssetLoader.Get().LoadGameObject("ChoiceCardMgr", new AssetLoader.GameObjectCallback(this.OnChoiceCardMgrLoaded), null, false); LoadingScreen.Get().RegisterFinishedTransitionListener(new LoadingScreen.FinishedTransitionCallback(this.OnTransitionFinished)); this.m_boardProgress = -1f; this.ProcessGameSetupPacket(); } }
protected override void Awake() { base.Awake(); s_instance = this; this.m_CurrentSubScene = null; this.m_TransitionOutSubScene = null; AdventureConfig config = AdventureConfig.Get(); config.OnAdventureSceneAwake(); config.AddSubSceneChangeListener(new AdventureConfig.SubSceneChange(this.OnSubSceneChange)); config.AddSelectedModeChangeListener(new AdventureConfig.SelectedModeChange(this.OnSelectedModeChanged)); config.AddAdventureModeChangeListener(new AdventureConfig.AdventureModeChange(this.OnAdventureModeChanged)); this.m_StartupAssetLoads++; bool @bool = Options.Get().GetBool(Option.HAS_SEEN_NAXX); if (!@bool) { this.m_StartupAssetLoads++; } this.LoadSubScene(config.GetCurrentSubScene(), new AssetLoader.GameObjectCallback(this.OnFirstSubSceneLoaded)); if (!@bool) { SoundManager.Get().Load("VO_KT_INTRO_39"); AssetLoader.Get().LoadGameObject("KT_Quote", new AssetLoader.GameObjectCallback(this.OnKTQuoteLoaded), null, false); } Options.Get().SetBool(Option.BUNDLE_JUST_PURCHASE_IN_HUB, false); if (ApplicationMgr.IsInternal()) { CheatMgr.Get().RegisterCheatHandler("advdev", new CheatMgr.ProcessCheatCallback(this.OnDevCheat), null, null, null); } this.InitializeAllDefs(); }
protected void OnDestroy() { CheatMgr mgr = CheatMgr.Get(); if (mgr != null) { mgr.UnregisterCheatHandler("wireframe", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_RenderWireframe)); } }
private void OnDestroy() { NetCache.Get().UnregisterNetCacheHandler(new NetCache.NetCacheCallback(this.OnNetCacheReady)); if (CheatMgr.Get() != null) { CheatMgr.Get().UnregisterCheatHandler("replaymissions", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_replaymissions)); CheatMgr.Get().UnregisterCheatHandler("replaymission", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_replaymissions)); } s_instance = null; }
private void Awake() { s_instance = this; this.m_practicePickerTray = ((GameObject)GameUtils.Instantiate((GameObject)this.m_practicePickerTrayPrefab, this.m_practicePickerTrayContainer, false)).GetComponent <PracticePickerTrayDisplay>(); if (UniversalInputManager.UsePhoneUI != null) { SceneUtils.SetLayer(this.m_practicePickerTray, GameLayer.IgnoreFullScreenEffects); } AssetLoader.Get().LoadActor((UniversalInputManager.UsePhoneUI == null) ? "DeckPickerTray" : "DeckPickerTray_phone", delegate(string name, GameObject go, object data) { if (go == null) { Debug.LogError("Unable to load DeckPickerTray."); } else { this.m_deckPickerTray = go.GetComponent <DeckPickerTrayDisplay>(); if (this.m_deckPickerTray == null) { Debug.LogError("DeckPickerTrayDisplay component not found in DeckPickerTray object."); } else { if (this.m_deckPickerTrayContainer != null) { GameUtils.SetParent(this.m_deckPickerTray, this.m_deckPickerTrayContainer, false); } AdventureSubScene component = base.GetComponent <AdventureSubScene>(); if (component != null) { this.m_practicePickerTray.AddTrayLoadedListener(delegate { this.OnTrayPartLoaded(); this.m_practicePickerTray.gameObject.SetActive(false); }); this.m_deckPickerTray.AddDeckTrayLoadedListener(new DeckPickerTrayDisplay.DeckTrayLoaded(this.OnTrayPartLoaded)); if (this.m_practicePickerTray.IsLoaded() && this.m_deckPickerTray.IsLoaded()) { component.SetIsLoaded(true); } } this.InitializeTrays(); CheatMgr.Get().RegisterCheatHandler("replaymissions", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_replaymissions), null, null, null); CheatMgr.Get().RegisterCheatHandler("replaymission", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_replaymissions), null, null, null); NetCache.Get().RegisterScreenPractice(new NetCache.NetCacheCallback(this.OnNetCacheReady)); } } }, null, false); }
private void UpdateInput() { if (!this.UpdateTextInput()) { InputManager manager = InputManager.Get(); if ((manager == null) || !manager.HandleKeyboardInput()) { CheatMgr mgr = CheatMgr.Get(); if ((mgr == null) || !mgr.HandleKeyboardInput()) { Cheats cheats = Cheats.Get(); if ((cheats == null) || !cheats.HandleKeyboardInput()) { DialogManager manager2 = DialogManager.Get(); if ((manager2 == null) || !manager2.HandleKeyboardInput()) { CollectionInputMgr mgr2 = CollectionInputMgr.Get(); if ((mgr2 == null) || !mgr2.HandleKeyboardInput()) { DraftInputManager manager3 = DraftInputManager.Get(); if ((manager3 == null) || !manager3.HandleKeyboardInput()) { PackOpening opening = PackOpening.Get(); if ((opening == null) || !opening.HandleKeyboardInput()) { if (SceneMgr.Get() != null) { Scene scene = SceneMgr.Get().GetScene(); if ((scene != null) && scene.HandleKeyboardInput()) { return; } } BaseUI eui = BaseUI.Get(); if ((eui != null) && eui.HandleKeyboardInput()) { } } } } } } } } } }
public void startWatch() { // init loader = new Loader(); // If a plugin is modified, reload it FileSystemWatcher fsw = new FileSystemWatcher(pluginDirectory, "*.dll"); fsw.NotifyFilter = NotifyFilters.LastWrite; fsw.Changed += new FileSystemEventHandler(onChange_raw); fsw.Created += new FileSystemEventHandler(onChange_raw); fsw.EnableRaisingEvents = true; Log.debug("Watching filesystem for plugin changes in: " + pluginDirectory); // If the user requests a plugin be run, reload it CheatMgr.Get().RegisterCheatHandler("run", new CheatMgr.ProcessCheatCallback(this.RunCommand)); // For testing CheatMgr.Get().RegisterCheatHandler("echo", new CheatMgr.ProcessCheatCallback(this.EchoCommand)); }
protected void Start() { CheatMgr mgr = CheatMgr.Get(); if (mgr != null) { mgr.RegisterCheatHandler("wireframe", new CheatMgr.ProcessCheatCallback(this.OnProcessCheat_RenderWireframe), null, null, null); } base.gameObject.GetComponent <Camera>().clearFlags = CameraClearFlags.Color; if (!SystemInfo.supportsImageEffects) { Debug.LogError("Fullscreen Effects not supported"); base.enabled = false; } else { if (this.m_BlurShader == null) { this.m_BlurShader = ShaderUtils.FindShader("Custom/FullScreen/Blur"); } if (this.m_BlurShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/Blur"); base.enabled = false; } if ((this.m_BlurShader == null) || !this.blurMaterial.shader.isSupported) { Debug.LogError("Fullscreen Effect Shader not supported: Custom/FullScreen/Blur"); base.enabled = false; } else { if (this.m_BlurVignettingShader == null) { this.m_BlurVignettingShader = ShaderUtils.FindShader("Custom/FullScreen/BlurVignetting"); } if (this.m_BlurVignettingShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/BlurVignetting"); base.enabled = false; } if (this.m_BlurDesaturationShader == null) { this.m_BlurDesaturationShader = ShaderUtils.FindShader("Custom/FullScreen/DesaturationBlur"); } if (this.m_BlurDesaturationShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/DesaturationBlur"); base.enabled = false; } if (this.m_BlendShader == null) { this.m_BlendShader = ShaderUtils.FindShader("Custom/FullScreen/Blend"); } if (this.m_BlendShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/Blend"); base.enabled = false; } if (this.m_VignettingShader == null) { this.m_VignettingShader = ShaderUtils.FindShader("Custom/FullScreen/Vignetting"); } if (this.m_VignettingShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/Vignetting"); base.enabled = false; } if (this.m_BlendToColorShader == null) { this.m_BlendToColorShader = ShaderUtils.FindShader("Custom/FullScreen/BlendToColor"); } if (this.m_BlendToColorShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/BlendToColor"); base.enabled = false; } if (this.m_DesaturationShader == null) { this.m_DesaturationShader = ShaderUtils.FindShader("Custom/FullScreen/Desaturation"); } if (this.m_DesaturationShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/Desaturation"); base.enabled = false; } if (this.m_DesaturationVignettingShader == null) { this.m_DesaturationVignettingShader = ShaderUtils.FindShader("Custom/FullScreen/DesaturationVignetting"); } if (this.m_DesaturationVignettingShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/DesaturationVignetting"); base.enabled = false; } if (this.m_BlurDesaturationVignettingShader == null) { this.m_BlurDesaturationVignettingShader = ShaderUtils.FindShader("Custom/FullScreen/BlurDesaturationVignetting"); } if (this.m_BlurDesaturationVignettingShader == null) { Debug.LogError("Fullscreen Effect Failed to load Shader: Custom/FullScreen/BlurDesaturationVignetting"); base.enabled = false; } } } }