예제 #1
0
        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.");
        }
예제 #2
0
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         ApplicationStatusManager.GetStatus <StartStatus>().EnterToStart();
     }
 }
예제 #3
0
    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);
            }
        }
    }
예제 #4
0
        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();
        }
예제 #5
0
    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>();
    }
예제 #6
0
    // 按键消息接受
    public void OnStart()
    {
        m_bIsActive = false;
        StopCoroutine("TextAnim");

        ApplicationStatusManager.GetStatus <StartStatus> ().EnterToLobby();
        // ApplicationStatusManager.EnterStatus<GameStatus>();
    }
예제 #7
0
 void ReceviceSocketStatus(InputNetworkConnectStatusEvent e)
 {
     isConnect = false;
     if (e.m_status == NetworkState.Connected)
     {
         ApplicationStatusManager.GetStatus <LoginState>().Login(SystemInfo.deviceUniqueIdentifier, UserData.NickName);
     }
 }
예제 #8
0
    /// <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();
        }
    }
예제 #9
0
 public override void OnUpdate()
 {
     if (Application.platform == RuntimePlatform.Android &&
         (Input.GetKeyDown(KeyCode.Escape)) ||
         Input.GetKeyDown(KeyCode.Q))
     {
         ApplicationStatusManager.EnterStatus <MainMenuState>();
     }
 }
예제 #10
0
        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);
        }
예제 #11
0
    // 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();
    }
예제 #12
0
    // 按钮消息接受
    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");
    }
예제 #13
0
 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);
 }
예제 #14
0
    public void EnterMap(int iMapID)
    {
        if (iMapID == m_iCurMapID)
        {
            return;
        }

        ApplicationStatusManager.GetStatus <GameStatus>().ChangeMapScene(m_iCurMapID, iMapID);

        m_iCurMapID = iMapID;
    }
예제 #15
0
 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));
     }
 }
예제 #18
0
        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));
     }
 }
예제 #21
0
 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;
 }
예제 #22
0
    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));
     }
 }
예제 #25
0
    /// <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); //游戏流程状态机,开始第一个状态
        }
    }
예제 #26
0
    /// <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); //游戏流程状态机,开始第一个状态
        }
    }
예제 #27
0
    /// <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);
        }
    }
예제 #28
0
    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));
        }
    }
예제 #30
0
    /// <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);
        }
    }