public WizardWindowViewModel(WizardWindow window, ApplicationStatusManager manager, SourceList <PhotoViewModel> photos, int selectedIndex) { _window = window; LocalizationContext = window.LocalizationContext; _router = new RoutingState(); _firstWizardViewModel = new FirstWizardViewModel(this, LocalizationContext); _secondWizardViewModel = new SecondWizardViewModel(this, LocalizationContext); _thirdWizardViewModel = new ThirdWizardViewModel(this, window, manager, LocalizationContext); _fourthWizardViewModel = new FourthWizardViewModel(this, manager, photos, selectedIndex, window.AppConfig, LocalizationContext); canGoNext = this .WhenAnyValue(x => x.CanGoNext); canGoBack = this. WhenAnyValue(x => x.CanGoBack); CanGoNext = true; CanGoBack = false; GoNext = ReactiveCommand.Create(Next, canGoNext); GoBack = ReactiveCommand.Create(Back, canGoBack); BackButtonText = LocalizationContext.WizardBackButtonText; NextButtonText = LocalizationContext.WizardNextButtonText; Log.Information("Wizard started."); }
public void Update() { if (Input.GetKeyUp(KeyCode.Escape)) { ApplicationStatusManager.GetStatus <StartStatus>().EnterToStart(); } }
public static void NextLine() { s_currentLine++; s_questionTime = Time.time; if (s_currentLine < currentPoemData.m_content.Length) { if (currentPoemData.m_content[s_currentLine].Contains("space")) { GlobalEvent.DispatchEvent(GameEventEnum.CreateSpace); s_currentLine++; } CreateAnswer(); } else { if (s_GameModel == GameModel.normal) { ApplicationStatusManager.GetStatus <GameStatus>().OpenFinishUI(); } else { NewPoem(); GlobalEvent.DispatchEvent(GameEventEnum.NextPoem); } } }
public SettingsWindowViewModel(SettingsWindow window, LocalizationContext context, ref AppConfig config, ApplicationStatusManager manager, ThemeManager mainThemeManager, ThemeManager settingsThemeManager) { _window = window; this.LocalizationContext = context; _settingsThemeManager = settingsThemeManager; _mainThemeManager = mainThemeManager; _config = config; _newConfig = AppConfig.DeepCopy(_config); _applicationStatusManager = manager; InitView(); this.WhenAnyValue(x => x.ThemeIndex) .Skip(1) .Subscribe(x => SwitchSettingsTheme()); SetupCommands(); MLUrl = _newConfig.MlModelConfig.Url; UpdateModelStatusCommand.Execute().Subscribe(); }
public void ArcadeModel() { Dictionary <string, object> data = new Dictionary <string, object>(); string difficultys = ""; for (int i = 0; i < GameOptionService.DifficultyLevels.Count; i++) { difficultys += "|" + GameOptionService.DifficultyLevels[i]; } string types = ""; for (int i = 0; i < GameOptionService.PoemTypes.Count; i++) { types += "|" + GameOptionService.PoemTypes[i]; } data.Add("GameType", "normal"); data.Add("DifficultyLevels", difficultys); data.Add("PoemTypes", types); SDKManager.Log("StartGame", data); GameLogic.s_GameModel = GameModel.Arcade; PoemLibrary.SetPoemByTag(GameOptionService.DifficultyLevels, GameOptionService.PoemTypes); ApplicationStatusManager.EnterStatus <GameStatus>(); }
// 按键消息接受 public void OnStart() { m_bIsActive = false; StopCoroutine("TextAnim"); ApplicationStatusManager.GetStatus <StartStatus> ().EnterToLobby(); // ApplicationStatusManager.EnterStatus<GameStatus>(); }
void ReceviceSocketStatus(InputNetworkConnectStatusEvent e) { isConnect = false; if (e.m_status == NetworkState.Connected) { ApplicationStatusManager.GetStatus <LoginState>().Login(SystemInfo.deviceUniqueIdentifier, UserData.NickName); } }
/// <summary> /// 程序启动 /// </summary> public void AppLaunch() { DontDestroyOnLoad(gameObject); Application.runInBackground = true; Screen.sleepTimeout = SleepTimeout.NeverSleep; SetResourceLoadType(useCacheWhenLoadResource); //设置资源加载类型 AudioPlayManager.Init(); MemoryManager.Init(); //内存管理初始化 Timer.Init(); //计时器启动 InputManager.Init(); //输入管理器启动 #if !UNITY_WEBGL UIManager.Init(); //UIManager启动 #else UIManager.InitAsync(); //异步加载UIManager #endif ApplicationStatusManager.Init(); //游戏流程状态机初始化 GlobalLogicManager.Init(); //初始化全局逻辑 if (AppMode != AppMode.Release) { GUIConsole.Init(); //运行时Console DevelopReplayManager.OnLunchCallBack += () => { SDKManager.Init(); //初始化SDKManger #if USE_LUA LuaManager.Init(); #endif InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterTestModel(m_Status); //可以从此处进入测试流程 }; DevelopReplayManager.Init(m_quickLunch); //开发者复盘管理器 LanguageManager.Init(); } else { Log.Init(false); //关闭 Debug SDKManager.Init(); //初始化SDKManger #if USE_LUA LuaManager.Init(); #endif InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterStatus(m_Status); //游戏流程状态机,开始第一个状态 LanguageManager.Init(); } if (s_OnApplicationModuleInitEnd != null) { s_OnApplicationModuleInitEnd(); } }
public override void OnUpdate() { if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)) || Input.GetKeyDown(KeyCode.Q)) { ApplicationStatusManager.EnterStatus <MainMenuState>(); } }
public SettingsWindow(LocalizationContext context, ref AppConfig appConfig, ApplicationStatusManager manager, ThemeManager themeManager) { AppConfig = appConfig; AvaloniaXamlLoader.Load(this); var settingsThemeManager = new ThemeManager(this); settingsThemeManager.UseTheme(themeManager.CurrentTheme); this.DataContext = new SettingsWindowViewModel(this, context, ref appConfig, manager, themeManager, settingsThemeManager); }
// Start Action public override void Start() { Debug.Log("[Action_EnterMap] : Start : "); MapManager kMapManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("MapManager") as MapManager; kMapManager.EnterMap(m_iMapID); End(); }
// 按钮消息接受 public void OnRecvClick(InputUIOnClickEvent e) { MessageManager.Message kMsg = new MessageManager.Message(); kMsg.m_eType = MessageManager.MessageType.MT_DialogClick; kMsg.m_dicParams = new Dictionary <string, string> (); MessageManager kMessageManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("MessageManager") as MessageManager; kMessageManager.AddMessage(kMsg); Debug.Log("Dialog Window On Clicked"); }
public ThirdWizardViewModel(IScreen screen, WizardWindow window, ApplicationStatusManager manager, LocalizationContext localizationContext) { _applicationStatusManager = manager; _window = window; LocalizationContext = localizationContext; HostScreen = screen; _appConfig = window.AppConfig; LoadModelCommand = ReactiveCommand.Create(LoadModel); UpdateModelStatusCommand = ReactiveCommand.Create(UpdateModelStatus); }
public void EnterMap(int iMapID) { if (iMapID == m_iCurMapID) { return; } ApplicationStatusManager.GetStatus <GameStatus>().ChangeMapScene(m_iCurMapID, iMapID); m_iCurMapID = iMapID; }
public void Update() { if (Input.GetKeyUp(KeyCode.F12)) { ApplicationStatusManager.GetStatus <GameStatus>().SaveGame("save_0.txt"); } else if (Input.GetKey(KeyCode.F11)) { ApplicationStatusManager.GetStatus <GameStatus>().LoadGame("save_0.txt"); } }
void ReceviceHotUpdateProgress(HotUpdateStatusInfo info) { if (info.m_loadState.isDone) { ApplicationStatusManager.EnterStatus <MainMenuState>(); } else { m_window.HotUpdate(info); } }
static int AppUpdate(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); ApplicationStatusManager.AppUpdate(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public SaveAsWindowViewModel(Window window, SourceList <PhotoViewModel> photos, ApplicationStatusManager applicationStatusManager, LocalizationContext localizationContext) { LocalizationContext = localizationContext; _photos = photos; _applicationStatusManager = applicationStatusManager; this.ValidationRule( viewModel => viewModel.OutputPath, Directory.Exists, path => $"Incorrect path {path}"); SelectPathCommand = ReactiveCommand.Create(SelectOutputFolder); SaveCommand = ReactiveCommand.Create(SavePhotos, this.IsValid()); }
public ModelManagerWindowViewModel(ModelManagerWindow window, LocalizationContext context, ref AppConfig config, ApplicationStatusManager manager) { this.LocalizationContext = context; _config = config; _newConfig = AppConfig.DeepCopy(_config); _applicationStatusManager = manager; _avalableModels .Connect() .Bind(out _avalableModelsCollection) .Subscribe(); _installedModels .Connect() .Bind(out _installedModelsCollection) .Subscribe(); _repositories .Connect() .Bind(out _repositoriesCollection) .Subscribe(); var repoRule = this.ValidationRule( viewModel => viewModel.RepositoryToAdd, x => string.IsNullOrWhiteSpace(x) == false, x => $"Incorrect repository {x}"); UpdateModelStatusCommand = ReactiveCommand.Create(async() => { await UpdateModelStatus(); }, CanExecute()); UpdateInstalledModelsCommand = ReactiveCommand.Create(async() => { await UpdateInstalledModels(); }, CanExecute()); UpdateAvailableModelsCommand = ReactiveCommand.Create(async() => { await UpdateAvailableModels(); }, CanExecute()); DownloadModelCommand = ReactiveCommand.Create(async() => { await DownloadModel(); }, CanExecute()); RemoveModelCommand = ReactiveCommand.Create(async() => { await RemoveModel(); }, CanExecute()); ActivateModelCommand = ReactiveCommand.Create(async() => { await ActivateModel(); }, CanExecute()); AddRepositoryCommand = ReactiveCommand.Create(AddRepository, this.IsValid()); RemoveRepositoryCommand = ReactiveCommand.Create(RemoveRepository, CanExecute()); ApplyCommand = ReactiveCommand.Create(async() => { _config = AppConfig.DeepCopy(_newConfig); await _config.Save(); window.AppConfig = _config; window.Close(); }, CanExecute()); CancelCommand = ReactiveCommand.Create(window.Close, CanExecute()); Task.Run(Init); }
static int EnterStatus(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); string arg0 = ToLua.CheckString(L, 1); ApplicationStatusManager.EnterStatus(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public FourthWizardViewModel(IScreen screen, ApplicationStatusManager manager, SourceList <PhotoViewModel> photos, int selectedIndex, AppConfig config, LocalizationContext localizationContext) { _applicationStatusManager = manager; _photos = photos; _selectedIndex = selectedIndex; _appConfig = config; LocalizationContext = localizationContext; StopCommand = ReactiveCommand.Create(Stop); HostScreen = screen; }
void OnClickExercise(InputUIOnClickEvent e) { Dictionary <string, object> data = new Dictionary <string, object>(); data.Add("GameType", "singlePoem"); data.Add("poemName", s_poemData.m_key); SDKManager.Log("StartGame", data); UIManager.CloseUIWindow(this); GameLogic.s_GameModel = GameModel.normal; PoemLibrary.SetPoemByName(s_poemData.m_key); ApplicationStatusManager.EnterStatus <GameStatus>(); }
void OnClickExercise(InputUIOnClickEvent e) { Dictionary <string, object> data = new Dictionary <string, object>(); data.Add("GameType", "FavoritesList"); data.Add("FavoritesListCount", FavoritesService.GetFavoritesList().Count); SDKManager.Log("StartGame", data); UIManager.CloseUIWindow(this); GameLogic.s_GameModel = GameModel.normal; PoemLibrary.SetPoemByFavorite(FavoritesService.GetFavoritesList()); ApplicationStatusManager.EnterStatus <GameStatus>(); }
static int GetStatus(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); string arg0 = ToLua.CheckString(L, 1); IApplicationStatus o = ApplicationStatusManager.GetStatus(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 程序启动 /// </summary> public void AppLaunch() { DontDestroyOnLoad(gameObject); SetResourceLoadType(); //设置资源加载类型 ResourcesConfigManager.Initialize(); //资源路径管理器启动 MemoryManager.Init(); //内存管理初始化 Timer.Init(); //计时器启动 InputManager.Init(); //输入管理器启动 #if !UNITY_WEBGL UIManager.Init(); //UIManager启动 #else UIManager.InitAsync(); //异步加载UIManager #endif ApplicationStatusManager.Init(); //游戏流程状态机初始化 GlobalLogicManager.Init(); //初始化全局逻辑 if (AppMode != AppMode.Release) { GUIConsole.Init(); //运行时Console DevelopReplayManager.OnLunchCallBack += () => { #if USE_LUA LuaManager.Init(); #endif InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterTestModel(m_Status); //可以从此处进入测试流程 }; DevelopReplayManager.Init(m_quickLunch); //开发者复盘管理器 } else { Log.Init(false); //关闭 Debug #if USE_LUA LuaManager.Init(); #endif InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterStatus(m_Status); //游戏流程状态机,开始第一个状态 } }
/// <summary> /// 程序启动 /// </summary> public void AppLaunch() { DontDestroyOnLoad(gameObject); SetResourceLoadType(); //设置资源加载类型 ResourcesConfigManager.Initialize(); //资源路径管理器启动 MemoryManager.Init(); //内存管理初始化 HeapObjectPool.Init(); Timer.Init(); //计时器启动 InputManager.Init(); //输入管理器启动 UIManager.Init(); //UIManager启动 ApplicationStatusManager.Init(); //游戏流程状态机初始化 GlobalLogicManager.Init(); //初始化全局逻辑 if (m_AppMode != AppMode.Release) { GUIConsole.Init(); //运行时Console DevelopReplayManager.OnLunchCallBack += () => { if (m_useLua) { LuaManager.Init(); } InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterTestModel(m_Status); //可以从此处进入测试流程 }; DevelopReplayManager.Init(m_quickLunch); //开发者复盘管理器 } else { Log.Init(false); //关闭 Debug if (m_useLua) { LuaManager.Init(); } InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterStatus(m_Status); //游戏流程状态机,开始第一个状态 } }
/// <summary> /// 程序启动 /// </summary> public void AppLaunch() { SetResourceLoadType(); //设置资源加载类型 BundleConfigManager.Initialize(); //资源路径管理器启动 Log.Init(); //日志系统启动 ApplicationStatusManager.Init(); //游戏流程状态机初始化 //初始化全局逻辑 InitGlobalLogic(); if (m_AppMode != AppMode.Release) { GUIConsole.Init(); //运行时Debug ApplicationStatusManager.EnterTestModel(m_Status); //可以从此处进入测试流程 } else { //游戏流程状态机,开始第一个状态 ApplicationStatusManager.EnterStatus(m_Status); } }
private void _ProcessMsg(Message kMsg) { if (kMsg.m_eType == MessageType.MT_DialogClick) { StoryManager kStoryManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("StoryManager") as StoryManager; Story curstory = kStoryManager.GetCurrentStory(); if (curstory == null) { Debug.LogError("[MessageManager] : MessageType.MT_DialogClick Error,Story is null"); return; } Action_Dialog kActionDialog = curstory.GetCurrentAction() as Action_Dialog; if (kActionDialog == null) { Debug.LogError("[MessageManager] : MessageType.MT_DialogClick Error,Story is null"); return; } // 需要判断story的下一个是否仍旧是dialog类型 kActionDialog.OnDialogEnd(); } }
static int _CreateApplicationStatusManager(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { ApplicationStatusManager obj = new ApplicationStatusManager(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: ApplicationStatusManager.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 程序启动 /// </summary> public void AppLaunch() { DontDestroyOnLoad(this); SetResourceLoadType(); //设置资源加载类型 ResourcesConfigManager.Initialize(); //资源路径管理器启动 InputManager.Init(); //输入管理器启动 UIManager.Init(); //UIManager启动 ApplicationStatusManager.Init(); //游戏流程状态机初始化 //初始化全局逻辑 GlobalLogicManager.Init(); if (m_AppMode != AppMode.Release) { GUIConsole.Init(); //运行时Console DevelopReplayManager.OnLunchCallBack += () => { LuaManager.Init(); InitGlobalLogic(); //全局逻辑 ApplicationStatusManager.EnterTestModel(m_Status); //可以从此处进入测试流程 }; DevelopReplayManager.Init(m_quickLunch); //开发者复盘管理器 } else { Log.Init(false); //关闭 Debug LuaManager.Init(); //全局逻辑 InitGlobalLogic(); //游戏流程状态机,开始第一个状态 ApplicationStatusManager.EnterStatus(m_Status); } }