示例#1
0
 public WeaponInfoPanel(UICommChannel ui, string id)
     : base(ui, id)
 {
     this._contentPanelID   = this.UI.Path(id, "content");
     this._damageGraph      = new WeaponDamageGraphPanel(this.UI, this.UI.Path(this._contentPanelID, "graphGroup.damGraphFrame.damGraph"));
     this._deviationGraph   = new WeaponDeviationGraphPanel(this.UI, this.UI.Path(this._contentPanelID, "graphGroup.devGraphFrame.devGraph"));
     this._scalarStats      = new WeaponScalarStats(this.UI, this.UI.Path(this._contentPanelID, "scalarStats"));
     this._primaryGroup     = new WeaponInfoPanel.Group(this.UI, this._contentPanelID, "1", string.Empty);
     this._comparativeGroup = new WeaponInfoPanel.Group(this.UI, this._contentPanelID, "2", AssetDatabase.CommonStrings.Localize("@UI_COMPARATIVE_WEAPON_VERSUS") + " ");
 }
示例#2
0
        public void SetWeapons(LogicalWeapon primary, LogicalWeapon comparative)
        {
            bool flag = primary != null;

            this._rateOfFireLabel.Label.SetVisible(flag);
            this._popDamageLabel.Label.SetVisible(flag);
            this._infraDamageLabel.Label.SetVisible(flag);
            this._terraDamageLabel.Label.SetVisible(flag);
            if (primary == null)
            {
                return;
            }
            float num1         = primary.GetRateOfFire() * 60f;
            float popDamage1   = primary.PopDamage;
            float num2         = primary.InfraDamage * 100f;
            float terraDamage1 = primary.TerraDamage;

            if (comparative != null)
            {
                float num3         = comparative.GetRateOfFire() * 60f;
                float popDamage2   = comparative.PopDamage;
                float num4         = comparative.InfraDamage * 100f;
                float terraDamage2 = comparative.TerraDamage;
                float delta1       = num1 - num3;
                float delta2       = popDamage1 - popDamage2;
                float delta3       = num2 - num4;
                float delta4       = terraDamage1 - terraDamage2;
                this._rateOfFireLabel.Label.SetText(num1.ToString("N1") + WeaponScalarStats.GetSignSuffix(delta1));
                this._popDamageLabel.Label.SetText(popDamage1.ToString("N0") + WeaponScalarStats.GetSignSuffix(delta2));
                this._infraDamageLabel.Label.SetText(num2.ToString("N3") + WeaponScalarStats.GetSignSuffix(delta3));
                this._terraDamageLabel.Label.SetText(terraDamage1.ToString("N2") + WeaponScalarStats.GetSignSuffix(delta4));
            }
            else
            {
                this._rateOfFireLabel.Label.SetText(num1.ToString("N1"));
                this._popDamageLabel.Label.SetText(popDamage1.ToString("N0"));
                this._infraDamageLabel.Label.SetText(num2.ToString("N5"));
                this._terraDamageLabel.Label.SetText(terraDamage1.ToString("N2"));
            }
        }