diff --git a/HarmonySrc/Possession.cs b/HarmonySrc/Possession.cs index eb42ee3..fa358a4 100644 --- a/HarmonySrc/Possession.cs +++ b/HarmonySrc/Possession.cs @@ -147,6 +147,9 @@ namespace NecromancerTome /// (QuickMenu, по умолчанию Backquote; и CameraChange геймпада), каждое вселение начинается от третьего лица. Камера - в голове, тело - только тень /// (HideBody), положение глаз сглажено (FpSmooth) - голова зомби на ходу мотается. public static bool FirstPerson; + /// Пояс одержимого (13.10): 2 ячейки, пока пустые; выбор 1/2 или колесом, только от первого лица. + public const int BeltSlots = 2; + public static int BeltSlot; public const float FpForward = 0.12f, FpSmooth = 12f; static Vector3 _fpEye; static readonly List _hiddenRenderers = new List(); @@ -313,6 +316,7 @@ namespace NecromancerTome _nextScream = 0f; _loggedCamera = false; FirstPerson = false; + BeltSlot = 0; // Пояс одержимому питомцу ни к чему (указание 06.10); открыться заново не даёт // Patch_GUIWindowManager_openInternal_SnakeToolbelt, после выхода игра откроет его сама. if (_pet) @@ -602,6 +606,26 @@ namespace NecromancerTome } Debug.Log("[NecromancerTome] Possession: вид от " + (FirstPerson ? "первого" : "третьего") + " лица"); } + if (FirstPerson && input != null && !gui) + { + int was = BeltSlot; + if (input.InventorySlot1.WasPressed) + { + BeltSlot = 0; + } + else if (input.InventorySlot2.WasPressed) + { + BeltSlot = 1; + } + else if (input.ScrollUp.WasPressed || input.ScrollDown.WasPressed) + { + BeltSlot = (BeltSlot + 1) % BeltSlots; + } + if (BeltSlot != was) + { + Debug.Log("[NecromancerTome] Possession: пояс - ячейка " + (BeltSlot + 1)); + } + } if (input != null && !gui && input.ToggleCrouch.WasPressed) { _crouchToggled = !_crouchToggled; @@ -2417,6 +2441,10 @@ namespace NecromancerTome _style = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleLeft, clipping = TextClipping.Clip }; _style.normal.textColor = new Color(0.95f, 0.9f, 0.85f); } + if (Possession.FirstPerson) + { + DrawBelt(scale); + } Rect hr; // Справа от полосок игрока, а не поверх (указание 13.10: «можем вывести где-нибудь и здоровье игрока»): // над ними значки баффов, справа до панели предметов пусто. @@ -2493,6 +2521,30 @@ namespace NecromancerTome } } + /// Пояс одержимого от первого лица (указание 13.10: «собственный пояс на 2 ячейки», пока пустой) - на месте + /// пояса персонажа, внизу по центру; выбранная ячейка в рамке. Ячейки пустые - бьёт кулаками. + static void DrawBelt(float _scale) + { + float size = 64f * _scale, gap = 6f * _scale, frame = 3f * _scale; + float x0 = (Screen.width - (size * Possession.BeltSlots + gap * (Possession.BeltSlots - 1))) / 2f; + float y = Screen.height - 14f * _scale - size; + Color prev = GUI.color; + for (int i = 0; i < Possession.BeltSlots; i++) + { + Rect r = new Rect(x0 + i * (size + gap), y, size, size); + if (i == Possession.BeltSlot) + { + GUI.color = CdReady; + GUI.DrawTexture(new Rect(r.x - frame, r.y - frame, r.width + frame * 2f, r.height + frame * 2f), Texture2D.whiteTexture); + } + GUI.color = Back; + GUI.DrawTexture(r, Texture2D.whiteTexture); + GUI.color = prev; + GUI.Label(new Rect(r.x + 4f * _scale, r.y + 2f * _scale, r.width, 18f * _scale), (i + 1).ToString(), _style); + } + GUI.color = prev; + } + static void DrawBar(Rect _r, float _frac, Color _fill, string _text) { Color prev = GUI.color; diff --git a/NecromancerHarmony.dll b/NecromancerHarmony.dll index bea108b..fc8ada4 100644 Binary files a/NecromancerHarmony.dll and b/NecromancerHarmony.dll differ diff --git a/NecromancerHarmony.pdb b/NecromancerHarmony.pdb index a3cf634..d2070fb 100644 Binary files a/NecromancerHarmony.pdb and b/NecromancerHarmony.pdb differ