コード例 #1
0
        private void OkClickHandler(object sender, RoutedEventArgs e)
        {
            GaugeType gauges = (showClutch.IsChecked == true ? GaugeType.CLUTCH : 0)
                               | (showBrake.IsChecked == true ? GaugeType.BRAKE : 0)
                               | (showThrottle.IsChecked == true ? GaugeType.THROTTLE : 0);

            var args = new PreferencesChangeEventArgs(EVENT_PREFERENCES_CHANGED, gauges, alwaysOnTop.IsChecked == true, (byte)opacity.Value);

            DispatchEvent(args);
            DialogResult = true;
        }
コード例 #2
0
ファイル: GaugeFactory.cs プロジェクト: sn4men/imBMW
        public GaugeSettings Create(GaugeType type)
        {
            var s = new GaugeSettings {
                GaugeType = type
            };

            switch (type)
            {
            }
            return(s);
        }
コード例 #3
0
        internal GameLayer(ClientResourceLocator resourceLocator, ChartInfo chartInfo, AutoPlayTargets autoPlay = AutoPlayTargets.None)
            : base(resourceLocator, "game/main")
        {
            m_locator = resourceLocator;

            m_chartInfo = chartInfo;

            m_autoPlay  = autoPlay;
            m_gaugeType = GaugeType.Normal;

            m_background = new ScriptableBackground(m_locator);
        }
コード例 #4
0
    private void SetGaugeType(GaugeType type)
    {
        //IL_0013: Unknown result type (might be due to invalid IL or missing references)
        //IL_003c: Unknown result type (might be due to invalid IL or missing references)
        currentGaugeType = type;
        switch (type)
        {
        case GaugeType.HP:
            shieldGaugeUI.get_gameObject().SetActive(false);
            hpFocusFrame.SetActive(false);
            break;

        case GaugeType.SHIELD:
            shieldGaugeUI.get_gameObject().SetActive(true);
            hpFocusFrame.SetActive(true);
            break;
        }
    }
コード例 #5
0
        // 각 타겟에 적용된 수치 기록
        public void RecordAffect(Character target, GaugeType gaugeType, int value)
        {
            int       targetIdx;
            PartyType targetType;

            if (!FindCharacterIdx(target, out targetType, out targetIdx))
            {
                return;
            }
            var targetAffect = curTurnInfo.targets.First(chr => chr.targetIdx == targetIdx);

            targetAffect.gaugeType = gaugeType;
            targetAffect.value     = value;
            ++curAffectCount;

            if (curTurnInfo.targets.Count == curAffectCount)
            {
                turnInfos.Add(curTurnInfo);
                curAffectCount = 0;
            }
        }
コード例 #6
0
 public Gauge(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _gaugetype     = (GaugeType )info.GetValue("GaugeType", typeof(GaugeType));
     _templateindex = info.GetInt32("TemplateIndex");
     _indicatorname = info.GetString("IndicatorName");
     _needlecolor   = (Color)info.GetValue("NeedleColor", typeof(Color));
     _needlelength  = info.GetInt32("NeedleLength");
     _fontcolor     = (Color)info.GetValue("TickFontColor", typeof(Color));
     _linecolor     = (Color)info.GetValue("LineColor", typeof(Color));
     _tickcolor     = (Color)info.GetValue("TickColor", typeof(Color));
     _sectionstart  = info.GetInt32("SectionStart");
     _sectionend    = info.GetInt32("SectionEnd");
     _tickstart     = info.GetInt32("TickStart");
     _tickend       = info.GetInt32("TickEnd");
     _textloc       = info.GetInt32("TextLoc");
     _gapheight     = info.GetInt32("GapHeight");
     _maxtick       = info.GetDouble("MaxTick");
     _mintick       = info.GetDouble("MinTick");
     _bsemicircle   = info.GetBoolean("SemiCircle");
     _gaugecolor    = (Color)info.GetValue("GaugeColor", typeof(Color));
 }
コード例 #7
0
        public MapViewModel(MapData info)
        {
            this._source                  = info;
            this.MapNumber                = info.MapNumber;
            this.Name                     = info.Name;
            this.AreaName                 = info.AreaName;
            this.Current                  = info.Current?.ToString() ?? "???";
            this.Max                      = info.Max?.ToString() ?? "???";
            this.SelectedRank             = info.Eventmap?.SelectedRankText ?? "";
            this.RemainingCountTransportS = info.RemainingCountTransportS.ToString();
            this.IsCleared                = info.IsCleared == 1;
            this.IsRankSelected           = info.Eventmap == null ||
                                            info.Eventmap.SelectedRank != 0 ||
                                            info.Eventmap.NowMapHp != 9999;
            this.GaugeType = info.GaugeType;

            this.GaugeColor  = green;
            this.IsSupported = true;
            this.IsInfinity  = false;
            this.IsLoading   = true;

            this.UpdateRemainingCount(info);
        }
コード例 #8
0
 public Gauge(Gauge gauge)
     : base(gauge)
 {
     _indicatorname = gauge.IndicatorName;
     _templateindex = gauge.TemplateIndex;
     _indicator     = gauge.Indicator;
     _gaugetype     = gauge.GaugeType;
     _needlecolor   = gauge.NeedleColor;
     _needlelength  = gauge.NeedleLength;
     _fontcolor     = gauge.FontColor;
     _linecolor     = gauge.LineColor;
     _tickcolor     = gauge.TickColor;
     _sectionstart  = gauge.SectionStart;
     _sectionend    = gauge.SectionEnd;
     _tickstart     = gauge.TickStart;
     _tickend       = gauge.TickEnd;
     _textloc       = gauge.TextLoc;
     _gapheight     = gauge.GapHeight;
     _maxtick       = gauge.MaxTick;
     _mintick       = gauge.MinTick;
     _bsemicircle   = gauge.bSemiCircle;
     _gaugecolor    = gauge.GaugeColor;
 }
コード例 #9
0
        // 회복 처리
        public void Recover(GaugeType type, uint value)
        {
            switch (type)
            {
            case GaugeType.Hp:
                if (value > actualParams[(int)ParamType.maxHp] - hp)
                {
                    value = actualParams[(int)ParamType.maxHp] - hp;
                }
                hp += value;
                break;

            case GaugeType.Mp:
                if (value > actualParams[(int)ParamType.maxMp] - mp)
                {
                    value = actualParams[(int)ParamType.maxMp] - mp;
                }
                mp += value;
                break;

            case GaugeType.Sp:
                if (value > Config.MAX_CHARACTER_SP - sp)
                {
                    value = Config.MAX_CHARACTER_SP - sp;
                }
                sp += value;
                break;
            }

            #region 전투기록 : 효과 수치 기록
            if (battleInfo != null)
            {
                battleInfo.RecordAffect(this, type, (int)value);
            }
            #endregion
        }
コード例 #10
0
        // 데미지 적용
        public void Damage(GaugeType type, uint value)
        {
            switch (type)
            {
            case GaugeType.Hp:
                if (value > hp)
                {
                    value = hp;
                }
                hp -= value;
                break;

            case GaugeType.Mp:
                if (value > mp)
                {
                    value = mp;
                }
                mp -= value;
                break;

            case GaugeType.Sp:
                if (value > sp)
                {
                    value = sp;
                }
                sp -= value;
                break;
            }

            #region 전투기록 : 효과 수치 기록
            if (battleInfo != null)
            {
                battleInfo.RecordAffect(this, type, -(int)value);
            }
            #endregion
        }
コード例 #11
0
        private void BindGauge(EnergyDisplayControls.PowerGauge gauge, ActiveEvent activeEvent, GaugeType type, bool bindDescription)
        {
            gauge.DataContext = Subscriber;
            Binding binding = new Binding();
            binding.Source = activeEvent;
            binding.Path = new PropertyPath("CurrentPower");
            binding.Mode = BindingMode.TwoWay;
            gauge.SetBinding(EnergyDisplayControls.PowerGauge.Scale1ValueProperty, binding);

            binding = new Binding();
            binding.Source = Subscriber;
            if (type == GaugeType.Yield || type == GaugeType.FeedIn)
                binding.Path = new PropertyPath("MaxYield");
            else if (type == GaugeType.Consumption)
                binding.Path = new PropertyPath("MaxConsumption");
            else if (type == GaugeType.Unknown)
                binding.Path = new PropertyPath("MaxYield");
            binding.Mode = BindingMode.TwoWay;
            gauge.SetBinding(EnergyDisplayControls.PowerGauge.Scale1MaxProperty, binding);

            if (type == GaugeType.FeedIn)
            {
                binding = new Binding();
                binding.Source = Subscriber;
                binding.Path = new PropertyPath("MaxConsumptionNegative");
                binding.Mode = BindingMode.TwoWay;
                gauge.SetBinding(EnergyDisplayControls.PowerGauge.Scale1MinProperty, binding);
            }

            if (bindDescription)
            {
                binding = new Binding();
                binding.Source = activeEvent;
                binding.Path = new PropertyPath("ReadingDescription");
                binding.Mode = BindingMode.TwoWay;
                gauge.SetBinding(EnergyDisplayControls.PowerGauge.GaugeDescriptionProperty, binding);
            }
        }
コード例 #12
0
        public GaugeSettings Create(GaugeType type)
        {
            switch (type)
            {
            case GaugeType.RPM:
                return(new GaugeSettings(type)
                {
                    Name = "RPM",
                    GetDMEValue = av => av.RPM,
                    Format = "N0",
                    MinValue = 0,
                    MaxValue = 8000,
                });

            case GaugeType.Speed:
                return(new GaugeSettings(type)
                {
                    Name = "Speed",
                    GetDMEValue = av => av.Speed,
                    Format = "N0",
                    Dimension = "km/h",
                    MinValue = 0,
                    MaxValue = 300,
                });

            case GaugeType.Throttle:
                return(new GaugeSettings(type)
                {
                    Name = "Throttle",
                    GetDMEValue = av => av.Throttle,
                    Format = "N0",
                    Suffix = "°",
                    MinValue = 0,
                    MaxValue = 90,
                });

            case GaugeType.Pedal:
                return(new GaugeSettings(type)
                {
                    Name = "Pedal",
                    GetDMEValue = av => av.Pedal,
                    Format = "N0",
                    Suffix = "°",
                    MinValue = 0,
                    MaxValue = 90,
                });

            case GaugeType.AFR:
                return(new GaugeSettings(type)
                {
                    Name = "AFR",
                    GetDMEValue = av => av.AFR,
                    Format = "F1",
                    Dimension = "Air/Fuel",
                    MinValue = 7.5,
                    MaxValue = 22.5,
                    MinRed = 10,
                    MinYellow = 11,
                    MaxYellow = 14.7,
                    MaxRed = 15.5
                });

            case GaugeType.WideBandLambda:
                return(new GaugeSettings(type)
                {
                    Name = "Lambda",
                    GetDMEValue = av => av.WideBandLambda,
                    Format = "F2",
                    MinValue = 0.5,
                    MaxValue = 1.5,
                });

            case GaugeType.IntakePressure:
                return(new GaugeSettings(type)
                {
                    Name = "Boost",
                    GetDMEValue = av => av.IntakePressure,
                    Format = "F2",
                    Dimension = "Bar",
                    MinValue = -1,
                    MaxValue = 2,
                    MinYellow = -0.01,
                    MaxYellow = 0.5,
                    MaxRed = 1.0,
                    AddToValue = -1000,
                    MultiplyValue = 0.001,
                    ZeroValue = 0.01
                });

            case GaugeType.FuelPressure:
                return(new GaugeSettings(type)
                {
                    Name = "Fuel",
                    GetDMEValue = av => av.FuelPressure,
                    Format = "F2",
                    Dimension = "Bar",
                    MinValue = 0,
                    MaxValue = 6,
                    MultiplyValue = 0.001,
                    ZeroValue = 0.12
                });

            case GaugeType.OilPressure:
                return(new GaugeSettings(type)
                {
                    Name = "Oil",
                    GetDMEValue = av => av.OilPressure,
                    Format = "F2",
                    Dimension = "Bar",
                    MinValue = 0,
                    MaxValue = 10,
                    MultiplyValue = 0.001,
                    ZeroValue = 0.1
                });

            case GaugeType.IsMethanolFailsafe:
                return(new GaugeSettings(type)
                {
                    Name = "Status",
                    Dimension = "Methanol",
                    Format = "OK/Fail",
                    GetDMEValue = av => av.IsMethanolFailsafe ? 1 : 0,
                    MinValue = 0,
                    MaxValue = 1,
                    MaxRed = 0.9
                });

            case GaugeType.IsMethanolInjecting:
                return(new GaugeSettings(type)
                {
                    Name = "Injection",
                    Dimension = "Methanol",
                    Format = "Idle/Active",
                    GetDMEValue = av => av.IsMethanolInjecting ? 1 : 0,
                    MinValue = 0,
                    MaxValue = 1
                });

            case GaugeType.AirMass:
                return(new GaugeSettings(type)
                {
                    Name = "Air Mass",
                    GetDMEValue = av => av.AirMass,
                    Format = "N0",
                    MinValue = 0,
                    MaxValue = 1500,
                    MinYellow = 500
                });

            case GaugeType.AirMassPerStroke:
                return(new GaugeSettings(type)
                {
                    Name = "Load",
                    GetDMEValue = av => av.AirMassPerStroke,
                    Format = "N0",
                    Dimension = "mg/stroke",
                    MinValue = 0,
                    MaxValue = 1500,
                });

            case GaugeType.IgnitionAngle:
                return(new GaugeSettings(type)
                {
                    Name = "Ignition",
                    GetDMEValue = av => av.IgnitionAngle,
                    Format = "F1",
                    Suffix = "°",
                    Dimension = "BTDC",
                    MinValue = -24,
                    MaxValue = 72,
                });

            case GaugeType.InjectionTime:
                return(new GaugeSettings(type)
                {
                    Name = "Injection",
                    GetDMEValue = av => av.InjectionTime,
                    Format = "F2",
                    Dimension = "ms",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.OilTemperature:
                return(new GaugeSettings(type)
                {
                    Name = "Oil",
                    GetDMEValue = av => av.OilTemp,
                    Format = "N0",
                    Suffix = "°C",
                    Dimension = "Temperature",
                    MinValue = 0,
                    MaxValue = 150,
                    MinYellow = 75,
                    MaxYellow = 95,
                    MaxRed = 105
                });

            case GaugeType.IntakeTemperature:
                return(new GaugeSettings(type)
                {
                    Name = "IAT",
                    GetDMEValue = av => av.IntakeTemp,
                    Format = "N0",
                    Suffix = "°C",
                    Dimension = "Before Cooler",
                    MinValue = -30,
                    MaxValue = 100,
                    MaxYellow = 30,
                    MaxRed = 60,
                });

            case GaugeType.IntakeTemperatureAfterCooler:
                return(new GaugeSettings(type)
                {
                    Name = "IAT",
                    GetDMEValue = av => av.IntakeTempAfterCooler,
                    Format = "N0",
                    Suffix = "°C",
                    Dimension = "After Cooler",
                    MinValue = 0,
                    MaxValue = 100,
                    MaxYellow = 30,
                    MaxRed = 40
                });

            case GaugeType.CoolerInTemperature:
                return(new GaugeSettings(type)
                {
                    Name = "Inlet",
                    GetDMEValue = av => av.CoolerInTemp,
                    Format = "N0",
                    Suffix = "°C",
                    Dimension = "Liquid Intercooler",
                    MinValue = 0,
                    MaxValue = 100,
                    MaxYellow = 30,
                    MaxRed = 40
                });

            case GaugeType.CoolerOutTemperature:
                return(new GaugeSettings(type)
                {
                    Name = "Outlet",
                    GetDMEValue = av => av.CoolerOutTemp,
                    Format = "N0",
                    Suffix = "°C",
                    Dimension = "Liquid Intercooler",
                    MinValue = 0,
                    MaxValue = 100,
                    MaxYellow = 30,
                    MaxRed = 40
                });

            case GaugeType.CoolantTemperature:
                return(new GaugeSettings(type)
                {
                    Name = "Coolant",
                    GetDMEValue = av => av.CoolantTemp,
                    Format = "N0",
                    Suffix = "°C",
                    MinValue = 0,
                    MaxValue = 150,
                    MinYellow = 75,
                    MaxYellow = 95,
                    MaxRed = 105,
                });

            case GaugeType.CoolantRadiatorTemperature:
                return(new GaugeSettings(type)
                {
                    Name = "Radiator",
                    GetDMEValue = av => av.CoolantRadiatorTemp,
                    Format = "N0",
                    Suffix = "°C",
                    MinValue = 0,
                    MaxValue = 150,
                    MinYellow = 75,
                    MaxYellow = 95,
                    MaxRed = 105,
                });

            case GaugeType.ElectricFanSpeed:
                return(new GaugeSettings(type)
                {
                    Name = "Fan",
                    GetDMEValue = av => av.ElectricFanSpeed,
                    Format = "N0",
                    Suffix = "%",
                    MinValue = 0,
                    MaxValue = 100,
                    MaxYellow = 70,
                    MaxRed = 90
                });

            case GaugeType.ISAPWM_IS:
                return(new GaugeSettings(type)
                {
                    Name = "Idle PWM IS",
                    GetDMEValue = av => av.ISAPWM_IS,
                    Format = "N0",
                    Dimension = "",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.ISAPWM_ISA:
                return(new GaugeSettings(type)
                {
                    Name = "Idle PWM ISA",
                    GetDMEValue = av => av.ISAPWM_ISA,
                    Format = "N0",
                    Dimension = "",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.KnockSensor2:
                return(new GaugeSettings(type)
                {
                    Name = "Knock 2",
                    GetDMEValue = av => av.KnockSensor2,
                    Format = "F2",
                    Suffix = " V",
                    MinValue = 0,
                    MaxValue = 5,
                });

            case GaugeType.KnockSensor5:
                return(new GaugeSettings(type)
                {
                    Name = "Knock 5",
                    GetDMEValue = av => av.KnockSensor5,
                    Format = "F2",
                    Suffix = " V",
                    MinValue = 0,
                    MaxValue = 5,
                });

            case GaugeType.LambdaIntegrator1:
                return(new GaugeSettings(type)
                {
                    Name = "Lambda 1",
                    GetDMEValue = av => av.LambdaIntegrator1,
                    Format = "F2",
                    MinValue = 0.5,
                    MaxValue = 1.5,
                });

            case GaugeType.LambdaIntegrator2:
                return(new GaugeSettings(type)
                {
                    Name = "Lambda 2",
                    GetDMEValue = av => av.LambdaIntegrator2,
                    Format = "F2",
                    MinValue = 0.5,
                    MaxValue = 1.5,
                });

            case GaugeType.LambdaHeatingAfterCats1:
                return(new GaugeSettings(type)
                {
                    Name = "LHAC1",
                    GetDMEValue = av => av.LambdaHeatingAfterCats1,
                    Format = "F2",
                    Dimension = "",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.LambdaHeatingAfterCats2:
                return(new GaugeSettings(type)
                {
                    Name = "LHAC2",
                    GetDMEValue = av => av.LambdaHeatingAfterCats2,
                    Format = "F2",
                    Dimension = "",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.LambdaHeatingBeforeCats1:
                return(new GaugeSettings(type)
                {
                    Name = "LHBC1",
                    GetDMEValue = av => av.LambdaHeatingBeforeCats1,
                    Format = "F2",
                    Dimension = "",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.LambdaHeatingBeforeCats2:
                return(new GaugeSettings(type)
                {
                    Name = "LHBC2",
                    GetDMEValue = av => av.LambdaHeatingBeforeCats2,
                    Format = "F2",
                    Dimension = "",
                    MinValue = 0,
                    MaxValue = 100,
                });

            case GaugeType.VanosPositionExhaust:
                return(new GaugeSettings(type)
                {
                    Name = "VanosPositionExhaust",
                    GetDMEValue = av => av.VanosPositionExhaust,
                    Format = "F2",
                    Suffix = "°",
                    MinValue = -160,
                    MaxValue = -60,
                });

            case GaugeType.VanosPositionIntake:
                return(new GaugeSettings(type)
                {
                    Name = "VanosPositionIntake",
                    GetDMEValue = av => av.VanosPositionIntake,
                    Format = "F2",
                    Suffix = "°",
                    MinValue = 60,
                    MaxValue = 160,
                });

            case GaugeType.AtmosphericPressure:
                return(new GaugeSettings(type)
                {
                    Name = "AtmosphericPressure",
                    GetDMEValue = av => av.AtmosphericPressure,
                    Format = "F2",
                    Dimension = "Bar",
                    MinValue = 0.9,
                    MaxValue = 1.1,
                    MultiplyValue = 0.001
                });

            case GaugeType.VoltageBattery:
                return(new GaugeSettings(type)
                {
                    Name = "Battery",
                    GetDMEValue = av => av.VoltageBattery,
                    Format = "F1",
                    Suffix = " V",
                    MinValue = 9,
                    MaxValue = 16,
                    MinRed = 13.3,
                    MinYellow = 13.6,
                    MaxYellow = 14.1,
                    MaxRed = 14.5
                });

            case GaugeType.VoltageKL15:
                return(new GaugeSettings(type)
                {
                    Name = "KL15",
                    GetDMEValue = av => av.VoltageKL15,
                    Format = "F1",
                    Suffix = " V",
                    MinValue = 9,
                    MaxValue = 16,
                    MinRed = 13.3,
                    MinYellow = 13.6,
                    MaxYellow = 14.1,
                    MaxRed = 14.5
                });

            default:
                //return new GaugeSettings(type);
                throw new Exception("Not supported gauge type.");
            }
        }
コード例 #13
0
ファイル: GaugeSlot.cs プロジェクト: tevfikoguz/imBMW
 public GaugeSlot(GaugeType primaryGauge, GaugeType?secondaryGauge = null)
 {
     PrimaryGauge   = primaryGauge;
     SecondaryGauge = secondaryGauge;
 }
コード例 #14
0
ファイル: Player.cs プロジェクト: korombus/ShootingGame
    /// <summary>
    /// 弾エネルギーゲージを変更
    /// </summary>
    /// <param name="ope">演算子</param>
    void ChangeGaugeVal(Operator ope, GaugeType type = GaugeType.NONE)
    {
        // 無敵状態ならば各種ゲージを減らないようにする
        if (muteki) return;

        switch (ope) {
            case Operator.PLUS:
                // 弾ゲージ
                if (bulletGauge < parent.bulletEnergyGauge.maxValue) {
                    bulletGauge += ((YkSys.playerParam.playerEnhanceChargeSpeedPt > 0 ? YkSys.playerParam.playerEnhanceChargeSpeedPt : 1) / 10);
                }

                // オプションゲージ
                if (OptionGauge < parent.PlayerOptGauge.maxValue) {
                    OptionGauge += ((YkSys.playerParam.playerEnhanceChargeSpeedPt > 0 ? YkSys.playerParam.playerEnhanceChargeSpeedPt : 1) / 30);
                }
                break;
            case Operator.MINE:
                // 弾ゲージ
                if (bulletGauge > 0 && type == GaugeType.BULLET) {
                    bulletGauge = 0;
                }

                // オプションゲージ
                if (OptionGauge > 0 && type == GaugeType.OPTION) {
                    OptionGauge -= optionGaugeDownVal;
                }
                break;
        }

        // 各種ゲージを増減
        parent.bulletEnergyGauge.value  = bulletGauge;
        parent.PlayerOptGauge.value     = OptionGauge;
    }
コード例 #15
0
 public GaugeSettings(GaugeType type)
 {
     GaugeType = type;
 }
コード例 #16
0
 public PreferencesChangeEventArgs(int eventId, GaugeType showGauges, bool alwaysOnTop, byte opacity) : base(eventId)
 {
     ShowGauges  = showGauges;
     AlwaysOnTop = alwaysOnTop;
     Opacity     = opacity;
 }
コード例 #17
0
 private void UpdateGauge(GaugeType type, double value)
 {
     // TODO use SubscribeToUpdates
     Gauges.ForEach(g => g.Update(type, value));
 }