private string ActualTyreCompound()
        {
            if (ActualCompoundMap.Count > 0)
            {
                return(ActualCompoundMap[Base.GetProp(ActualCompoundProperty)]);
            }

            return("N/A");
        }
Пример #2
0
        private void ChangeOptimalTyreTemperature(int change)
        {
            var game     = (string)Base.PluginManager.GetPropertyValue("DataCorePlugin.CurrentGame");
            var carid    = (string)Base.PluginManager.GetPropertyValue("DataCorePlugin.GameData.CarId");
            var newValue = Base.Settings.OptimalTyreTemps["Default"]["Default"] + change;

            // If we're playing F1, append the current tyre compound to the carid, as they have different optimal temps
            if (null != carid && Base.PluginManager.GameName == "F12020")
            {
                carid = carid + "__" + (int)Base.GetProp("PlayerCarStatusData.m_actualTyreCompound");
            }

            if (Base.Settings.OptimalTyreTemps[game].ContainsKey("Default"))
            {
                Base.Settings.OptimalTyreTemps[game]["Default"] = newValue;
            }

            if (null != carid)
            {
                if (Base.Settings.OptimalTyreTemps[game].ContainsKey(carid))
                {
                    Base.Settings.OptimalTyreTemps[game][carid] = newValue;
                }
                else
                {
                    Base.Settings.OptimalTyreTemps[game].Add(carid, newValue);
                }
            }

            // Update the default setting to match
            Base.Settings.OptimalTyreTemps["Default"]["Default"] = newValue;

            Base.End(Base.PluginManager);
        }