Пример #1
0
        void UpdateScreen()
        {
            // when your text function isn't that complex
            // you can use this method which creates a string builder
            // passes it via the specified callback function and sets the text at the end
            SetText(str =>
            {
                str.BeginCenter();
                str.MakeBar('-', SCREEN_WIDTH, 0, "ffffff10");
                str.AppendClr("Practice Mod", highlightColor).EndColor().AppendLine();
                str.AppendLine("By Graic");
                str.MakeBar('-', SCREEN_WIDTH, 0, "ffffff10");
                str.EndAlign().AppendLines(1);

                str.AppendLine($"  Jump Multiplier: {Player.Instance.jumpMultiplier}");
                str.AppendLine($"  Max Jump Speed: {Player.Instance.maxJumpSpeed}");
                str.AppendLine();

                // get the item with the prefix and suffix configured above
                // see how this results in a lot less lines and logic
                str.AppendLine(_selectionHandler.GetIndicatedText(0, $"<color={(infected ? "#"+highlightColor: "white")}>[Infected]</color>"));
                str.AppendLine(_selectionHandler.GetIndicatedText(1, $"<color={(!infected ? "#"+highlightColor: "white")}>[Survivor]</color>"));
                str.AppendLine(_selectionHandler.GetIndicatedText(2, $"Infected Count: {infectedPlayers}"));
                str.AppendLine(_selectionHandler.GetIndicatedText(3, $"Player Count: {totalPlayers}"));

                str.AppendLine();
                str.BeginColor("ffffff10").AppendLine("  ▲/▼ Select  Enter/◀/▶ Adjust").EndColor();
            });
        }
Пример #2
0
        void UpdateScreen()
        {
            // when your text function isn't that complex
            // you can use this method which creates a string builder
            // passes it via the specified callback function and sets the text at the end
            SetText(str =>
            {
                str.AppendLine(Header);
                str.Repeat("=", SCREEN_WIDTH).AppendLines(2);

                // get the item with the prefix and suffix configured above
                // see how this results in a lot less lines and logic
                str.AppendLine(_selectionHandler.GetIndicatedText(0, "[Infected Speed]"));
                str.AppendLine(_selectionHandler.GetIndicatedText(1, "[Survivor Speed]"));
            });
        }