Exemplo n.º 1
0
        public CharacterSelection(IRenderWindow renderWindow,
                                  ISceneManager sceneManager, ITextDictionary textDictionary, Func <eButtonType, IButton> createButton)
        {
            this.renderWindow = renderWindow;

            backgroundSprite         = renderWindow.LoadSprite(ResourcePaths.CharacterSelectionBackground, Palettes.Sky);
            createNewCharacterButton = createButton(eButtonType.Tall);
            // TODO: use strCreateNewCharacter -- need to get the text to split after 10 chars though.
            createNewCharacterButton.Text       = textDictionary.Translate("strCreateNewCharacter");// "Create New".ToUpper();
            createNewCharacterButton.Location   = new Point(33, 467);
            createNewCharacterButton.OnActivate = () => sceneManager.ChangeScene(eSceneType.SelectHeroClass);

            deleteCharacterButton          = createButton(eButtonType.Tall);
            deleteCharacterButton.Text     = textDictionary.Translate("strDelete");
            deleteCharacterButton.Location = new Point(433, 467);

            exitButton            = createButton(eButtonType.Medium);
            exitButton.Text       = textDictionary.Translate("strExit");
            exitButton.Location   = new Point(33, 540);
            exitButton.OnActivate = () => sceneManager.ChangeScene(eSceneType.MainMenu);

            okButton          = createButton(eButtonType.Medium);
            okButton.Text     = textDictionary.Translate("strOk");
            okButton.Location = new Point(630, 540);
            okButton.Enabled  = false;
        }
Exemplo n.º 2
0
        public void Initialize(string characterName, eHero hero)
        {
            var random = new Random();

            Seed = random.Next();

            sceneManager.ChangeScene("Game");
            ChangeMap(eLevelId.Act1_Town1);
        }
Exemplo n.º 3
0
        private static void switchScene(string viewFilePath)
        {
            View newView = JsonConvert.DeserializeObject <View>(
                File.ReadAllText(viewFilePath));

            ISceneManager sceneManager = ContainerProvider.Scope.Resolve <ISceneManager>();

            if (newView.Elements == null)
            {
                newView.Elements = new System.Collections.Generic.List <Element>();
            }

            if (newView.Theme == null)
            {
                if (!string.IsNullOrEmpty(newView.ThemeName))
                {
                    switch (newView.ThemeName)
                    {
                    case "Light":
                        newView.Theme = new Theme()
                        {
                            BackgroundColor = "#FFFFFF",
                            PrimaryColor    = "#007acc",
                            TextColor       = "#007acc",
                            TooltipColor    = "#9da6a4"
                        }; break;

                    default:
                        newView.Theme = new Theme()
                        {
                            BackgroundColor = "#263238",
                            PrimaryColor    = "#00C853",
                            TextColor       = "#00C853",
                            TooltipColor    = "#78909C"
                        }; break;
                    }
                }
                else
                {
                    newView.Theme = new Theme()
                    {
                        BackgroundColor = "#FFFFFF",
                        PrimaryColor    = "#007acc",
                        TextColor       = "#007acc",
                        TooltipColor    = "#9da6a4"
                    };
                }
            }

            sceneManager.ChangeScene(newView);
        }
Exemplo n.º 4
0
        public void Initialize(string characterName, eHero hero, eSessionType sessionType)
        {
            sessionManager = getSessionManager(sessionType);
            sessionManager.Initialize();

            sessionManager.OnSetSeed       += OnSetSeedEvent;
            sessionManager.OnLocatePlayers += OnLocatePlayers;
            sessionManager.OnPlayerInfo    += OnPlayerInfo;
            sessionManager.OnFocusOnPlayer += OnFocusOnPlayer;

            mapInfo = new List <IMapInfo>();
            sceneManager.ChangeScene(eSceneType.Game);

            sessionManager.JoinGame(characterName, hero);
        }
Exemplo n.º 5
0
        private void OnExitClicked()
        {
            var heros = Enum.GetValues(typeof(eHero)).Cast <eHero>();

            foreach (var hero in heros)
            {
                heroRenderInfo[hero].SpecialFrameTime = 0;
                heroRenderInfo[hero].Stance           = eHeroStance.Idle;
            }
            showEntryUi = false;
            keyboardInfoProvider.KeyPressCallback = null;
            characterNameTextBox.Text             = "";
            okButton.Enabled = false;

            sceneManager.ChangeScene("Main Menu");
        }
Exemplo n.º 6
0
        private void OnExitClicked()
        {
            StopSfx();

            foreach (var hero in eHeroExtensions.all)
            {
                heroRenderInfo[hero].SpecialFrameTime = 0;
                heroRenderInfo[hero].Stance           = eHeroStance.Idle;
            }
            showEntryUi = false;
            keyboardInfoProvider.KeyPressCallback = null;
            characterNameTextBox.Text             = "";
            okButton.Enabled = false;
            selectedHero     = null;

            sceneManager.ChangeScene(eSceneType.SelectCharacter);
        }
Exemplo n.º 7
0
 private void OnSinglePlayerClicked()
 => sceneManager.ChangeScene(eSceneType.SelectHeroClass);
Exemplo n.º 8
0
 private void OnCreditsClicked()
 => sceneManager.ChangeScene(eSceneType.Credits);
Exemplo n.º 9
0
 private void OnActivateClicked()
 => sceneManager.ChangeScene(eSceneType.MainMenu);
Exemplo n.º 10
0
 private void StartGame()
 {
     _sceneManager.ChangeScene(_startScene);
 }
Exemplo n.º 11
0
        private void setupScene()
        {
            View view = ContainerProvider.Scope.Resolve <View>();

            sceneManager.ChangeScene(view);
        }