Ejemplo n.º 1
0
        //################################################################################
        #region Private Members

        private void InitializePanels()
        {
            LayoutPanel = new LayoutPanel(this);
            TitlePanel  = new TitlePanel(this);

            EurTryStockPanel  = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "EURTRY"));
            UsdTryStockPanel  = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "USDTRY"));
            EurUsdStockPanel  = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "EURUSD"), 5000);
            SiemensStockPanel = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "SIEMENS"), 10000);

            HourPanel = new TimerPanel();

            LayoutPanel.Add(TitlePanel);

            LayoutPanel.Add(EurTryStockPanel);
            LayoutPanel.Add(UsdTryStockPanel);
            LayoutPanel.Add(EurUsdStockPanel);
            LayoutPanel.Add(SiemensStockPanel);

            LayoutPanel.Add(HourPanel);

            Controls.Add(LayoutPanel);

            TitlePanel.CustomContextMenu = CustomContextMenu.Instance;
        }
Ejemplo n.º 2
0
 public void ReturnToMainMenu()
 {
     TimerPanel.SetPause(false);
     TimerPanel.UnsubscribeDelegates();
     FMODPlayer.StopAllSounds();
     SceneManager.LoadScene(0);
 }
Ejemplo n.º 3
0
 public QuizTimer(float duration, TimerPanel template, bool paused, TimerThreshold[] thresholds)
 {
     Duration   = duration;
     Template   = template;
     Thresholds = thresholds;
     Paused     = paused;
 }
Ejemplo n.º 4
0
 public void Pause()
 {
     canvasGroup.DOFade(1, fadeTime);
     canvasGroup.interactable   = true;
     canvasGroup.blocksRaycasts = true;
     TimerPanel.SetPause(true);
     pauseButton.sprite = pausedImage;
 }
Ejemplo n.º 5
0
 public void BackToMenu()
 {
     FMODPlayer.StopAllSounds();
     StopCoroutine(BackToMenuButtonAnimation());
     TimerPanel.UnsubscribeDelegates();
     TimerPanel.SetPause(false);
     SceneManager.LoadScene(0);
 }
Ejemplo n.º 6
0
    private void FinishTutorial()
    {
        HideAllScreens();

        if (thisIsTheGameScene)
        {
            TimerPanel.SetPause(false);
        }

        sectionManager.SelectSection(1);
    }
Ejemplo n.º 7
0
    private void Prompt()
    {
        currentScreen = 0;

        if (thisIsTheGameScene)
        {
            TimerPanel.SetPause(true);
        }

        StartCoroutine(ShowScreen(currentScreen));
    }
Ejemplo n.º 8
0
 public void Resume()
 {
     canvasGroup.DOFade(0, fadeTime);
     canvasGroup.interactable   = false;
     canvasGroup.blocksRaycasts = false;
     if (!SoldierPanel.isEditButtonsEnable)
     {
         TimerPanel.SetPause(false);
     }
     pauseButton.sprite = unpausedImage;
 }
Ejemplo n.º 9
0
    private IEnumerator GameFinishedCoroutine()
    {
        gameOverPanel.DOFade(1, panelFadeTime);
        gameOverPanel.interactable   = true;
        gameOverPanel.blocksRaycasts = true;
        TimerPanel.SetPause(true);

        yield return(new WaitForSeconds(buttonAppearTime));

        yield return(BackToMenuButtonAnimation());
    }
Ejemplo n.º 10
0
    public void StartTutorial()
    {
        sectionManager.SelectSection(1);
        currentScreen = 1;

        if (thisIsTheGameScene)
        {
            TimerPanel.SetPause(true);
        }

        StartCoroutine(ShowScreen(currentScreen));
    }
Ejemplo n.º 11
0
        public override void Tick()
        {
            base.Tick();

            if (Game.Instance.Round == null)
            {
                return;
            }

            RoundLabel.UpdateTranslation(new TranslationData($"ROUND.STATE.{Game.Instance.Round.RoundName.ToUpper().Replace(' ', '_')}"));

            TimerPanel.SetClass("disabled", Game.Instance.Round is Rounds.WaitingRound);
            TimerLabel.Text = Game.Instance.Round.TimeLeftFormatted;
        }
Ejemplo n.º 12
0
    private IEnumerator BattleRoutine()
    {
        TimerPanel.SetPause(true);
        numberOfBattlesLostByThePlayerLastTurn = 0;
        numberOfBattlesWonByThePlayerLastTurn  = 0;
        for (int i = 0; i < propertiesInBattle.Count; i++)
        {
            yield return(IndividualBattle(propertiesInBattle[i], battleInformations[i]));

            OnIndividualBattleEnded();
        }
        OnBattlesEnd();
        TimerPanel.SetPause(false);
        ResetBattleList();
    }
Ejemplo n.º 13
0
        //Timer para mostrar el panel 3 segundos
        private void TimerPanel_Tick(object sender, EventArgs e)
        {
            int Num = Convert.ToInt32(lblSeg.Text);

            lblSeg.Text = Convert.ToString(Num - 1);

            if (lblSeg.Text == "0")
            {
                TimerPanel.Stop();
                panel1.Visible     = false;
                TimerPanel.Enabled = false;
                TimerVideo.Enabled = true;
                TimerVideo.Start();
            }
        }
Ejemplo n.º 14
0
        private void OpenPanel(int pSegundos)
        {
            //Panel Informativo del Video
            lblDesafio.Text  = "Nuevo Desafio";
            lblComienza.Text = "Comienza en";
            lblTitulo.Text   = Video.Nombre.ToString();
            int Min = pSegundos / 60;
            int Seg = pSegundos % 60;

            lblTiempo.Text = Min.ToString() + ":" + Seg.ToString();
            panel1.Visible = true;

            // MessageBox.Show(TotalSeg.ToString());
            TimerPanel.Enabled = true;
            TimerPanel.Start();
        }
        private async Task SetTimerToZeroAsync()
        {
            int delay = 500;
            var anim  = new Animation();

            anim.Add(0, 1.0, new Animation(t => { TimerPanel.WidthRequest = t; }, TimerPanel.WidthRequest, 0, Easing.SinIn));

            anim.Commit(this, "TimerAnimation", 16, (uint)delay);
            await TimerPanel.ColorTo(Color.LightGreen, Color.Yellow, c => TimerPanel.BackgroundColor = c, 150);

            await TimerPanel.ColorTo(Color.Yellow, Color.Red, c => TimerPanel.BackgroundColor = c, 150);

            await TimerPanel.ColorTo(Color.Red, Color.DarkRed, c => TimerPanel.BackgroundColor = c, 200);

            await Task.Delay(delay);
        }
Ejemplo n.º 16
0
    public void ToggleEditButtons()
    {
        isEditButtonsEnable = !isEditButtonsEnable;
        if (isEditButtonsEnable)
        {
            FMODPlayer.Instance.Play("enter battle mode");
        }
        TimerPanel.SetPause(isEditButtonsEnable);
        toggle.color = isEditButtonsEnable ? editEnabledColor : editDisabledColor;
        float target = isEditButtonsEnable ? 1 : 0;

        editButtonsGroup.interactable   = isEditButtonsEnable;
        editButtonsGroup.blocksRaycasts = isEditButtonsEnable;
        editButtonsGroup.DOFade(target, editButtonsFadeTime);

        if (!isEditButtonsEnable && SendTroopsBox.Instance.IsActivated)
        {
            SendTroopsBox.Instance.CancelOperation();
        }
    }
        public async Task StartTimerAsync()
        {
            if (this.AnimationIsRunning("TimerAnimation"))
            {
                return;
            }
            TimerPanel.BackgroundColor = Color.LightGreen;
            uint total_time = 10000;
            var  anim       = new Animation();

            anim.Add(0, 1.0, new Animation(t => { TimerPanel.WidthRequest = t; }, MaxTimerWidth, 0, Easing.SinInOut));

            anim.Commit(this, "TimerAnimation", 16, total_time, null, (v, c) => RaiseEventTimerExpired());

            await TimerPanel.ColorTo(Color.LightGreen, Color.Yellow, c => TimerPanel.BackgroundColor = c, 3000);

            await TimerPanel.ColorTo(Color.Yellow, Color.Red, c => TimerPanel.BackgroundColor = c, 2000);

            await TimerPanel.ColorTo(Color.Red, Color.DarkRed, c => TimerPanel.BackgroundColor = c, 5000);
        }
Ejemplo n.º 18
0
    void Awake()
    {
        _battleRaging = false;

        _party1 = PlayerPanel.GetComponent <PartyGroup>();
        //_party1SuccessSprite = PlayerPanel.GetComponentInChildren<SuccessSprite>(true);
        //_party1FailSprite = PlayerPanel.GetComponentInChildren<FailSprite>(true);

        _party2 = BossPanel.GetComponent <PartyGroup>();
        //_party2SuccessSprite = BossPanel.GetComponentInChildren<SuccessSprite>(true);
        //_party2FailSprite = BossPanel.GetComponentInChildren<FailSprite>(true);

        _timerPanel = TimerPanel.GetComponent <TimerPanel>();

        _resolutionPanel = GetComponentInChildren <ResolutionPanel>(true);
        _theBigButton    = GetComponentInChildren <TheBigButton>(true);
        _buttonNamePanel = GetComponentInChildren <ButtonNamePanel>(true);
        _getReadyPanel   = GetComponentInChildren <AttackGetReadyPanel>(true);
        _cannon          = GetComponentInChildren <ProjectileCannon>(true);

        _audioSource = GetComponent <AudioSource>();
    }
Ejemplo n.º 19
0
        //Timer para mostrar el panel del desafio Completado(3 Seg)
        private void TimerVideo_Tick(object sender, EventArgs e)
        {
            TotalSeg--;
            if (TotalSeg == 4)
            {
                if (ControlUser.VideoVisto(Video))
                {
                    lblSeg.Text        = "3";
                    lblDesafio.Text    = "Desafio Completado";
                    lblComienza.Text   = "Finaliza en";
                    panel1.Visible     = true;
                    TimerPanel.Enabled = true;
                    TimerPanel.Start();
                }
            }

            if (TotalSeg == 0)
            {
                TimerVideo.Stop();
                TimerVideo.Enabled = false;
                this.Close();
            }
        }
Ejemplo n.º 20
0
    private IEnumerator LoadGameCoroutine()
    {
        // Waits for the PropertyManager to finish setting up
        TimerPanel.SetPause(true);
        while (!PropertyManager.Instance.HasFinishedSettingUp)
        {
            yield return(null);
        }

        // Loads game
        SaveData saveData = SaveSystem.LoadGame();

        // Overwrites saved game state over current game state
        Population = saveData.population;
        Happiness  = saveData.happiness;
        Gold       = saveData.gold;
        Food       = saveData.food;
        Building   = saveData.building;
        FindObjectOfType <TimerPanel>().SetCurrentDay(saveData.day);
        StartingKingdomController.Instance.PlayerKingdom = saveData.playerKingdom;
        Camera.main.transform.position = new Vector3(saveData.cameraX, saveData.cameraY, Camera.main.transform.position.z);
        foreach (PropertySaveData pSaveData in saveData.properties)
        {
            PropertyManager.Instance.Propriedades[pSaveData.index].SetDominated(pSaveData.dominated, false);
            PropertyManager.Instance.Propriedades[pSaveData.index].SetSoldiers(SoldierType.InProperty, pSaveData.soldiers);
            PropertyManager.Instance.Propriedades[pSaveData.index].Level = pSaveData.level;
            PropertyManager.Instance.Propriedades[pSaveData.index].UpdateSoldierInfo();
            PropertyManager.Instance.Propriedades[pSaveData.index].kingdom = pSaveData.kingdom;
            PropertyManager.Instance.Propriedades[pSaveData.index].UpdateSprite(PropertyManager.Instance.Propriedades[pSaveData.index]);
        }
        if (saveData.activeEvents != null)
        {
            KEventManager.Instance.ClearActiveEvents();
            foreach (EventSaveData eSaveData in saveData.activeEvents)
            {
                KEvent kevt = ScriptableObject.CreateInstance <KEvent>();
                kevt.PortugueseExhibitionName = eSaveData.PortugueseExhibitionName;
                kevt.EnglishExhibitionName    = eSaveData.EnglishExhibitionName;
                kevt.InternalName             = eSaveData.InternalName;
                kevt.PortugueseDescription    = eSaveData.PortugueseDescription;
                kevt.EnglishDescription       = eSaveData.EnglishDescription;
                kevt.Duration               = eSaveData.Duration;
                kevt.LeftDuration           = eSaveData.LeftDuration;
                kevt.ActiveIntensity        = eSaveData.ActiveIntensity;
                kevt.mode                   = eSaveData.mode;
                kevt.battle                 = eSaveData.battle;
                kevt.chance                 = eSaveData.chance;
                kevt.PercentGoldLight       = eSaveData.PercentGoldLight;
                kevt.PercentFoodLight       = eSaveData.PercentFoodLight;
                kevt.PercentBuildingLight   = eSaveData.PercentBuildingLight;
                kevt.PercentPeopleLight     = eSaveData.PercentPeopleLight;
                kevt.PercentHappinessLight  = eSaveData.PercentHappinessLight;
                kevt.PercentGoldMedium      = eSaveData.PercentGoldMedium;
                kevt.PercentFoodMedium      = eSaveData.PercentFoodMedium;
                kevt.PercentBuildingMedium  = eSaveData.PercentBuildingMedium;
                kevt.PercentPeopleMedium    = eSaveData.PercentPeopleMedium;
                kevt.PercentHappinessMedium = eSaveData.PercentHappinessMedium;
                kevt.PercentGoldHeavy       = eSaveData.PercentGoldHeavy;
                kevt.PercentFoodHeavy       = eSaveData.PercentFoodHeavy;
                kevt.PercentBuildingHeavy   = eSaveData.PercentBuildingHeavy;
                kevt.PercentPeopleHeavy     = eSaveData.PercentPeopleHeavy;
                kevt.PercentHappinessHeavy  = eSaveData.PercentHappinessHeavy;
                kevt.AbsoluteGoldLight      = eSaveData.AbsoluteGoldLight;
                kevt.AbsoluteFoodLight      = eSaveData.AbsoluteFoodLight;
                kevt.AbsoluteBuildingLight  = eSaveData.AbsoluteBuildingLight;
                kevt.AbsoluteGoldMedium     = eSaveData.AbsoluteGoldMedium;
                kevt.AbsoluteFoodMedium     = eSaveData.AbsoluteFoodMedium;
                kevt.AbsoluteBuildingMedium = eSaveData.AbsoluteBuildingMedium;
                kevt.AbsoluteGoldHeavy      = eSaveData.AbsoluteGoldHeavy;
                kevt.AbsoluteFoodHeavy      = eSaveData.AbsoluteFoodHeavy;
                kevt.AbsoluteBuildingHeavy  = eSaveData.AbsoluteBuildingHeavy;
                kevt.showInInspector        = eSaveData.showInInspector;
                KEventManager.Instance.AddActiveEvent(kevt);
            }
        }

        hud.UpdateHUD();
        TimerPanel.SetPause(false);
    }
Ejemplo n.º 21
0
 public SaveData(GameManager gameManager, TimerPanel timer, PropertyManager propertyManager, KEventManager eventManager, StartingKingdomController startingKingdomController, Transform camera)
 {
     population    = gameManager.Population;
     happiness     = gameManager.Happiness;
     gold          = gameManager.Gold;
     food          = gameManager.Food;
     building      = gameManager.Building;
     day           = timer.GetCurrentDay();
     playerKingdom = startingKingdomController.PlayerKingdom;
     cameraX       = camera.position.x;
     cameraY       = camera.position.y;
     properties    = new PropertySaveData[propertyManager.Propriedades.Count];
     foreach (Property p in propertyManager.Propriedades)
     {
         properties[p.index] = new PropertySaveData(p.index, p.dominated, p.GetSoldiers(SoldierType.InProperty), p.Level, p.kingdom);
     }
     if (eventManager.GetAllActiveEvents().Count > 0)
     {
         List <KEvent> list = eventManager.GetAllActiveEvents();
         activeEvents = new EventSaveData[list.Count];
         for (int i = 0; i < list.Count; i++)
         {
             activeEvents[i] = new EventSaveData(
                 list[i].PortugueseExhibitionName,
                 list[i].EnglishExhibitionName,
                 list[i].InternalName,
                 list[i].PortugueseDescription,
                 list[i].EnglishDescription,
                 list[i].Duration,
                 list[i].LeftDuration,
                 list[i].ActiveIntensity,
                 list[i].mode,
                 list[i].battle,
                 list[i].chance,
                 list[i].PercentGoldLight,
                 list[i].PercentFoodLight,
                 list[i].PercentBuildingLight,
                 list[i].PercentPeopleLight,
                 list[i].PercentHappinessLight,
                 list[i].PercentGoldMedium,
                 list[i].PercentFoodMedium,
                 list[i].PercentBuildingMedium,
                 list[i].PercentPeopleMedium,
                 list[i].PercentHappinessMedium,
                 list[i].PercentGoldHeavy,
                 list[i].PercentFoodHeavy,
                 list[i].PercentBuildingHeavy,
                 list[i].PercentPeopleHeavy,
                 list[i].PercentHappinessHeavy,
                 list[i].AbsoluteGoldLight,
                 list[i].AbsoluteFoodLight,
                 list[i].AbsoluteBuildingLight,
                 list[i].AbsoluteGoldMedium,
                 list[i].AbsoluteFoodMedium,
                 list[i].AbsoluteBuildingMedium,
                 list[i].AbsoluteGoldHeavy,
                 list[i].AbsoluteFoodHeavy,
                 list[i].AbsoluteBuildingHeavy,
                 list[i].showInInspector);
         }
     }
     else
     {
         activeEvents = null;
     }
 }
Ejemplo n.º 22
0
 public void OnIndividualBattleEnded()
 {
     //Chamado quando cada batalha individual termina
     TimerPanel.OnIndividualBattleEnd();
 }
Ejemplo n.º 23
0
 public void DestroyWindow()
 {
     Destroy(this.gameObject);
     TimerPanel.SetPause(false);
 }
Ejemplo n.º 24
0
 private void Start()
 {
     TimerPanel.SetPause(true);
 }
Ejemplo n.º 25
0
 public void OnBattlesEnd()
 {
     //Chamado quando terminam todas as batalhas
     TimerPanel.OnBattleEnd();
 }