Example #1
0
        private void UpdateLabel()
        {
            DisplayLabel.Clear();
            DisplayLabel.PushTable(2);
            AddText("Name", Colors.White);
            AddText("Value", Colors.White);

            foreach (string key in DebugInfoList.Keys)
            {
                string text = "";
                try
                {
                    text = DebugInfoList[key].InfoFunction.Invoke();
                    AddText(key, DebugInfoList[key].Color);
                    AddText(text, DebugInfoList[key].Color);
                }
                catch (Exception ex)
                {
                    // Something went wrong
                    MDLog.Debug(LOG_CAT, ex.ToString());
                }
            }

            DisplayLabel.Pop();
        }
 public void Clear()
 {
     lock (Contents)
     {
         Contents.Clear();
         firstLine = true;
     }
 }
Example #3
0
    public override void _Process(float delta)
    {
        int camX = int.Parse(Mathf.Stepify(Camera.Transform.origin.x / ChunkSize.x, 1).ToString());
        int camZ = int.Parse(Mathf.Stepify(Camera.Transform.origin.z / ChunkSize.z, 1).ToString());

        for (int x = -RenderDistance; x <= RenderDistance; x++)
        {
            for (int y = -RenderDistance; y <= RenderDistance; y++)
            {
                var pos = new Vector2(x + camX, y + camZ);
                if (!PreloadedChunks.ContainsKey(pos) && !LoadedChunks.ContainsKey(pos) && !toRenderPos.Contains(pos))
                {
                    toRenderPos.Enqueue(pos);
                }
            }
        }

        var temp = TemperatureManager.GetTemperature((int)(Camera.Transform.origin.x), (int)(Camera.Transform.origin.z));
        var hum  = TemperatureManager.GetHumidity((int)(Camera.Transform.origin.x), (int)(Camera.Transform.origin.z));

        InfoLabel.Clear();
        //InfoLabel.Text += "FPS: " + Engine.GetFramesPerSecond() + "\n";
        InfoLabel.Text += "PreloadedCount: " + PreloadedChunks.Count.ToString() + "\n";
        InfoLabel.Text += "LoadedChunksCount: " + LoadedChunks.Count.ToString() + "\n";
        InfoLabel.Text += "ToRenderCount: " + toRenderPos.Count.ToString() + "\n";
        InfoLabel.Text += "CamPosition: " + "X: " + camX + " Z: " + camZ + "\n";
        InfoLabel.Text += "Current Temperature: " + temp + "\n";
        InfoLabel.Text += "Current Humidity: " + hum + "% \n";
        InfoLabel.Text += "Current biome: " + BiomeManager.FindMatchingBiome(temp, hum).ToString();

        foreach (var item in LoadedChunks.Keys)
        {
            if (DistanceToChunk(item) >= RenderDistance * 2)
            {
                Chunk chunk = LoadedChunks[item];
                if (!HasNode("item.ToString()"))
                {
                    continue;
                }
                var node = GetNode(item.ToString());
                node.CallDeferred("free");
                LoadedChunks.TryRemove(item, out chunk);
            }
        }
    }
Example #4
0
        private void UpdateLabel()
        {
            DisplayLabel.Clear();
            DisplayLabel.PushTable(2);

            foreach (string Category in OnScreenDebugManager.DebugInfoCategoryMap.Keys)
            {
                if (OnScreenDebugManager.HiddenCategories.Contains(Category))
                {
                    continue;
                }

                AddCateogryTitle(Category);

                Dictionary <string, OnScreenDebugInfo> DebugInfoList = OnScreenDebugManager.DebugInfoCategoryMap[Category];

                foreach (string key in DebugInfoList.Keys)
                {
                    try
                    {
                        string text = DebugInfoList[key].InfoFunction.Invoke();
                        AddTextCell(key, DebugInfoList[key].Color);
                        AddTextCell(text, DebugInfoList[key].Color);
                    }
                    catch (Exception ex)
                    {
                        // Something went wrong
                        GD.Print(ex.ToString());
                    }
                }

                AddEmptyLine();
            }

            DisplayLabel.Pop();
        }
Example #5
0
File: HUD.cs Project: theowiik/tdws
 /// <summary>
 ///   Clears the chat.
 /// </summary>
 private void ClearChat()
 {
     _chat.Clear();
 }
Example #6
0
 /// <summary>
 /// Initialises the paper log
 /// </summary>
 public void Setup()
 {
     _label = GetNode <RichTextLabel>("Text");
     _label.Clear();
 }
Example #7
0
 private void _on_DeleteLog_pressed()
 {
     testConsole.Clear();
 }