Exemplo n.º 1
0
        // Token: 0x06005675 RID: 22133 RVA: 0x001CE734 File Offset: 0x001CC934
        public override bool GroupsWith(Gizmo other)
        {
            if (!base.GroupsWith(other))
            {
                return(false);
            }
            Command_ReloadableDual command_Reloadable = other as Command_ReloadableDual;

            return(command_Reloadable != null && this.comp.parent.def == command_Reloadable.comp.parent.def);
        }
        // Token: 0x06005665 RID: 22117 RVA: 0x001CE210 File Offset: 0x001CC410
        private Command_ReloadableDual CreateVerbTargetCommand(Thing gear, Verb verb)
        {
            bool Primary = verb.verbProps.label == this.Props.chargeNoun;
            Command_ReloadableDual command_Reloadable = new Command_ReloadableDual(this);

            command_Reloadable.defaultDesc  = gear.def.description;
            command_Reloadable.hotKey       = Primary ? this.Props.hotKey : this.Props.hotKeySecondry;
            command_Reloadable.defaultLabel = verb.verbProps.label;
            command_Reloadable.verb         = verb;
            if (verb.verbProps.defaultProjectile != null && verb.verbProps.commandIcon == null)
            {
                command_Reloadable.icon          = verb.verbProps.defaultProjectile.uiIcon;
                command_Reloadable.iconAngle     = verb.verbProps.defaultProjectile.uiIconAngle;
                command_Reloadable.iconOffset    = verb.verbProps.defaultProjectile.uiIconOffset;
                command_Reloadable.overrideColor = new Color?(verb.verbProps.defaultProjectile.graphicData.color);
            }
            else
            {
                command_Reloadable.icon             = ((verb.UIIcon != BaseContent.BadTex) ? verb.UIIcon : gear.def.uiIcon);
                command_Reloadable.iconAngle        = gear.def.uiIconAngle;
                command_Reloadable.iconOffset       = gear.def.uiIconOffset;
                command_Reloadable.defaultIconColor = gear.DrawColor;
            }
            if (!this.Wearer.IsColonistPlayerControlled)
            {
                command_Reloadable.Disable(null);
            }
            else if (verb.verbProps.violent && this.Wearer.WorkTagIsDisabled(WorkTags.Violent))
            {
                command_Reloadable.Disable("IsIncapableOfViolenceLower".Translate(this.Wearer.LabelShort, this.Wearer).CapitalizeFirst() + ".");
            }
            else if (!this.CanBeUsed)
            {
                string r = Primary ? this.DisabledReason(this.MinAmmoNeeded(false), this.MaxAmmoNeeded(false)) : this.DisabledReasonSecondry(this.MinAmmoNeededSecondry(false), this.MaxAmmoNeededSecondry(false));
                command_Reloadable.Disable(r);
            }
            return(command_Reloadable);
        }