public IEnumerable <Command> GenerateGizmos() { Command_Action toggleFireModeGizmo = new Command_Action { action = ToggleFireMode, defaultLabel = ("CE_" + currentFireModeInt.ToString() + "Label").Translate(), defaultDesc = "CE_ToggleFireModeDesc".Translate(), icon = ContentFinder <Texture2D> .Get(("UI/Buttons/" + currentFireModeInt.ToString()), true), tutorTag = availableFireModes.Count > 1 ? "CE_FireModeToggle" : null }; if (availableFireModes.Count > 1) { // Teach about fire modes toggleFireModeGizmo.tutorTag = "CE_FireModeToggle"; LessonAutoActivator.TeachOpportunity(CE_ConceptDefOf.CE_FireModes, parent, OpportunityType.GoodToKnow); } yield return(toggleFireModeGizmo); Command_Action toggleAimModeGizmo = new Command_Action { action = ToggleAimMode, defaultLabel = ("CE_" + currentAimModeInt.ToString() + "Label").Translate(), defaultDesc = "CE_ToggleAimModeDesc".Translate(), icon = ContentFinder <Texture2D> .Get(("UI/Buttons/" + currentAimModeInt.ToString()), true), }; if (availableAimModes.Count > 1) { // Teach about aim modes toggleAimModeGizmo.tutorTag = "CE_AimModeToggle"; LessonAutoActivator.TeachOpportunity(CE_ConceptDefOf.CE_AimModes, parent, OpportunityType.GoodToKnow); } yield return(toggleAimModeGizmo); }
public void UpdateHook(On.RoR2.UI.SkillIcon.orig_Update orig, SkillIcon self) { orig.Invoke(self); if (self.targetSkill && self.targetSkillSlot == SkillSlot.Primary) { if (self.targetSkill.characterBody.baseNameToken == "BANDIT2_BODY_NAME") { if (!modeLabel) { var pos = self.stockText.transform.position; modeLabel = CreateLabel( self.stockText.transform.parent, "ModeLabel", fireMode.ToString(), new Vector2(pos.x - 7.5f, pos.y + 20f) ); modeLabel.transform.rotation = self.stockText.transform.rotation; modeLabel.color = self.stockText.color; modeLabel.alignment = self.stockText.alignment; } modeLabel.SetText(fireMode.ToString()); } } }
private void ProcessFireModeSwitching() { if (Input.GetKeyDown("x")) { if (SwitchFireMode()) { print("Switch firemode to " + currentFireMode.ToString()); } else { print("No other firemode. Current: " + currentFireMode.ToString()); } } }
public void UpdateHook(On.RoR2.UI.SkillIcon.orig_Update orig, SkillIcon self) { orig.Invoke(self); if (self.targetSkill && self.targetSkillSlot == SkillSlot.Primary) { if (self.targetSkill.characterBody.baseNameToken == "CAPTAIN_BODY_NAME") { self.stockText.gameObject.SetActive(true); self.stockText.fontSize = 12f; self.stockText.SetText(fireMode.ToString()); } } }
public void UpdateHook(On.RoR2.UI.SkillIcon.orig_Update orig, SkillIcon self) { orig.Invoke(self); if (self.targetSkill && self.targetSkillSlot == SkillSlot.Primary) { SurvivorIndex survivorIndex = SurvivorCatalog.GetSurvivorIndexFromBodyIndex(self.targetSkill.characterBody.bodyIndex); if (survivorIndex == SurvivorIndex.Captain) { self.stockText.gameObject.SetActive(true); self.stockText.fontSize = 12f; self.stockText.SetText(fireMode.ToString()); } } }
public override string ToString() { return($"{base.ToString()}, Barrel: {Barrel?.AttachmentId ?? 0}, Sight: {Sight?.AttachmentId ?? 0}, " + $"Grip: {Grip?.AttachmentId ?? 0}, Tactical: {Tactical?.AttachmentId ?? 0}, Magazine: {Magazine?.AttachmentId ?? 0}, " + $"FireMode: {FireMode?.ToString() ?? "None"}, Ammo: {Ammo?.ToString() ?? "None"}"); }
/// <summary> /// Sets the fire mode that should be shown on HUD. /// </summary> /// <param name="firemode">Firemode as selectable from enum</param> public static void SetFireMode(FireMode firemode) { fireMode.text = Convert.ToString(firemode.ToString()[0].ToString()); }