static void Postfix(UnitViewHandSlotData __instance) { try { if (!Main.enabled) { return; } if (!__instance.Owner.IsPlayerFaction) { return; } var characterSettings = Main.settings.GetCharacterSettings(__instance.Owner); if (characterSettings == null) { return; } if (characterSettings.hideWeapons) { if (!__instance.IsActiveSet) { __instance.ShowItem(false); } } } catch (Exception ex) { Main.Error(ex); } }
static void ShowUnitViewHandSlotData(UnitViewHandSlotData handData) { var ownerScale = handData.Owner.View.GetSizeScale() * Game.Instance.BlueprintRoot.WeaponModelSizing.GetCoeff(handData.Owner.Descriptor.OriginalSize); var visualScale = handData.VisualModel?.transform.localScale ?? Vector3.zero; var visualPosition = handData.VisualModel?.transform.localPosition ?? Vector3.zero; var sheathScale = handData.SheathVisualModel?.transform.localScale ?? Vector3.zero; var sheathPosition = handData.SheathVisualModel?.transform.localPosition ?? Vector3.zero; GUILayout.Label(string.Format($"weapon {ownerScale:0.#}, scale {visualScale} position {visualPosition}"), GUILayout.Width(500)); GUILayout.Label(string.Format($"sheath {ownerScale:0.#}, scale {sheathScale} position {sheathPosition}"), GUILayout.Width(500)); GUILayout.BeginHorizontal(); GUILayout.Label(string.Format("Data {0} Slot {1} Active {2}", handData?.VisibleItem?.Name, handData?.VisualSlot, handData?.IsActiveSet), GUILayout.Width(500)); if (GUILayout.Button("Unequip", GUILayout.Width(200f))) { handData.Unequip(); } if (GUILayout.Button("Swap Slot", GUILayout.Width(200f))) { handData.VisualSlot += 1; if (handData.VisualSlot == UnitEquipmentVisualSlotType.Quiver) { handData.VisualSlot = 0; } handData.Owner.View.HandsEquipment.UpdateAll(); } if (GUILayout.Button("ShowItem 0", GUILayout.Width(200f))) { handData.ShowItem(false); } if (GUILayout.Button("ShowItem 1", GUILayout.Width(200f))) { handData.ShowItem(true); } GUILayout.EndHorizontal(); }