Пример #1
0
 public override void Enter(object[] parameters)
 {
     if (ScreensManager.PreviousScreen != ScreensManager.FindScreen <Screen>("RecipaediaRecipes") && ScreensManager.PreviousScreen != ScreensManager.FindScreen <Screen>("RecipaediaDescription"))
     {
         m_previousScreen = ScreensManager.PreviousScreen;
     }
 }
Пример #2
0
 public override void Enter(object[] parameters)
 {
     if (ScreensManager.PreviousScreen != ScreensManager.FindScreen <Screen>("HelpTopic") && ScreensManager.PreviousScreen != ScreensManager.FindScreen <Screen>("Recipaedia") && ScreensManager.PreviousScreen != ScreensManager.FindScreen <Screen>("Bestiary"))
     {
         m_previousScreen = ScreensManager.PreviousScreen;
     }
 }
Пример #3
0
        public GameLoadingScreen()
        {
            XElement node = ContentManager.Get <XElement>("Screens/GameLoadingScreen");

            LoadContents(this, node);
            m_stateMachine.AddState("WaitingForFadeIn", null, delegate
            {
                if (!ScreensManager.IsAnimating)
                {
                    if (string.IsNullOrEmpty(m_worldSnapshotName))
                    {
                        m_stateMachine.TransitionTo("Loading");
                    }
                    else
                    {
                        m_stateMachine.TransitionTo("RestoringSnapshot");
                    }
                }
            }, null);
            m_stateMachine.AddState("Loading", null, delegate
            {
                ContainerWidget gamesWidget = ScreensManager.FindScreen <GameScreen>("Game").Children.Find <ContainerWidget>("GamesWidget");
                GameManager.LoadProject(m_worldInfo, gamesWidget);
                ScreensManager.SwitchScreen("Game");
            }, null);
            m_stateMachine.AddState("RestoringSnapshot", null, delegate
            {
                GameManager.DisposeProject();
                WorldsManager.RestoreWorldFromSnapshot(m_worldInfo.DirectoryName, m_worldSnapshotName);
                m_stateMachine.TransitionTo("Loading");
            }, null);
        }
Пример #4
0
 public override void Enter(object[] parameters)
 {
     if (ScreensManager.PreviousScreen != ScreensManager.FindScreen <Screen>("BestiaryDescription"))
     {
         m_previousScreen = ScreensManager.PreviousScreen;
     }
     m_creaturesList.SelectedItem = null;
 }
Пример #5
0
 public override void Update()
 {
     m_titleLabel.Text           = $"{m_componentPlayer.PlayerData.Name}, Level {MathUtils.Floor(m_componentPlayer.PlayerData.Level)} {m_componentPlayer.PlayerData.PlayerClass.ToString()}";
     m_healthValueBar.Value      = m_componentPlayer.ComponentHealth.Health;
     m_staminaValueBar.Value     = m_componentPlayer.ComponentVitalStats.Stamina;
     m_foodValueBar.Value        = m_componentPlayer.ComponentVitalStats.Food;
     m_sleepValueBar.Value       = m_componentPlayer.ComponentVitalStats.Sleep;
     m_temperatureValueBar.Value = m_componentPlayer.ComponentVitalStats.Temperature / 24f;
     m_wetnessValueBar.Value     = m_componentPlayer.ComponentVitalStats.Wetness;
     m_experienceValueBar.Value  = m_componentPlayer.PlayerData.Level - MathUtils.Floor(m_componentPlayer.PlayerData.Level);
     m_strengthLabel.Text        = string.Format(CultureInfo.InvariantCulture, "x {0:0.00}", m_componentPlayer.ComponentLevel.StrengthFactor);
     m_resilienceLabel.Text      = string.Format(CultureInfo.InvariantCulture, "x {0:0.00}", m_componentPlayer.ComponentLevel.ResilienceFactor);
     m_speedLabel.Text           = string.Format(CultureInfo.InvariantCulture, "x {0:0.00}", m_componentPlayer.ComponentLevel.SpeedFactor);
     m_hungerLabel.Text          = string.Format(CultureInfo.InvariantCulture, "x {0:0.00}", m_componentPlayer.ComponentLevel.HungerFactor);
     m_insulationLabel.Text      = string.Format(CultureInfo.InvariantCulture, "{0:0.00} clo", m_componentPlayer.ComponentClothing.Insulation);
     if (m_healthLink.IsClicked)
     {
         HelpTopic topic = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Health");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic.Title, topic.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_staminaLink.IsClicked)
     {
         HelpTopic topic2 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Stamina");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic2.Title, topic2.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_foodLink.IsClicked)
     {
         HelpTopic topic3 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Hunger");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic3.Title, topic3.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_sleepLink.IsClicked)
     {
         HelpTopic topic4 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Sleep");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic4.Title, topic4.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_temperatureLink.IsClicked)
     {
         HelpTopic topic5 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Temperature");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic5.Title, topic5.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_wetnessLink.IsClicked)
     {
         HelpTopic topic6 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Wetness");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic6.Title, topic6.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_strengthLink.IsClicked)
     {
         List <ComponentLevel.Factor> factors = new List <ComponentLevel.Factor>();
         float total = m_componentPlayer.ComponentLevel.CalculateStrengthFactor(factors);
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new LevelFactorDialog("Strength", "Affects melee attack power, digging speed, throwing range, and bow range.", factors, total));
     }
     if (m_resilienceLink.IsClicked)
     {
         List <ComponentLevel.Factor> factors2 = new List <ComponentLevel.Factor>();
         float total2 = m_componentPlayer.ComponentLevel.CalculateResilienceFactor(factors2);
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new LevelFactorDialog("Resilience", "Affects damage received from attacks, falls, fire, and asphyxiation.", factors2, total2));
     }
     if (m_speedLink.IsClicked)
     {
         List <ComponentLevel.Factor> factors3 = new List <ComponentLevel.Factor>();
         float total3 = m_componentPlayer.ComponentLevel.CalculateSpeedFactor(factors3);
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new LevelFactorDialog("Speed", "Affects movement speed on foot, swimming speed, jump height and stamina regeneration.", factors3, total3));
     }
     if (m_hungerLink.IsClicked)
     {
         List <ComponentLevel.Factor> factors4 = new List <ComponentLevel.Factor>();
         float total4 = m_componentPlayer.ComponentLevel.CalculateHungerFactor(factors4);
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new LevelFactorDialog("Hunger", "Affects how quickly eaten food is depleted.", factors4, total4));
     }
     if (m_experienceLink.IsClicked)
     {
         HelpTopic topic7 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Levels");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic7.Title, topic7.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_insulationLink.IsClicked)
     {
         HelpTopic topic8 = ScreensManager.FindScreen <HelpScreen>("Help").GetTopic("Clothing");
         DialogsManager.ShowDialog(m_componentPlayer.GuiWidget, new MessageDialog(topic8.Title, topic8.Text, LanguageControl.Get("Usual", "ok"), null, new Vector2(700f, 360f), null));
     }
     if (m_chokeButton.IsClicked)
     {
         m_componentPlayer.ComponentHealth.Injure(0.1f, null, ignoreInvulnerability: true, "Choked");
     }
 }