public override IEnumerable <Command> CompGetGizmosExtra() { var ammoStatusGizmo = new GizmoAmmoStatus { compAmmo = this }; yield return(ammoStatusGizmo); if ((this.wielder != null && wielder.Faction == Faction.OfPlayer) || (turret != null && turret.Faction == Faction.OfPlayer)) { Action action = null; if (wielder != null) { action = TryStartReload; } else if (turret != null && turret.GetMannableComp() != null) { action = turret.OrderReload; } var reloadCommandGizmo = new Command_Reload { compAmmo = this, action = action, defaultLabel = hasMagazine ? "CR_ReloadLabel".Translate() : "", defaultDesc = "CR_ReloadDesc".Translate(), icon = this.currentAmmo == null ? ContentFinder <Texture2D> .Get("UI/Buttons/Reload", true) : CommunityCoreLibrary.Def_Extensions.IconTexture(this.selectedAmmo) }; yield return(reloadCommandGizmo); } }
public override IEnumerable <Command> CompGetGizmosExtra() { var ammoStat = new GizmoAmmoStatus { compAmmo = this }; yield return(ammoStat); if (this.Wielder != null) { var com = new Command_Action { action = StartReload, defaultLabel = "CR_ReloadLabel".Translate(), defaultDesc = "CR_ReloadDesc".Translate(), icon = ContentFinder <Texture2D> .Get("UI/Buttons/Reload", true) }; yield return(com); } }