Exemplo n.º 1
0
        public ManualTransmission()
        {
            IniFile ini = new IniFile(path);

            animdict = ini.Read("animdict", "MTSupport");
            anim     = ini.Read("anim", "MTSupport");

            Tick += OnTick;
            mtlib = Dll.GetModuleHandle(@"Gears.asi");
            if (mtlib == IntPtr.Zero)
            {
                Logger.Write(logpath, "Process not found!");
            }
            else
            {
                Logger.Write(logpath, "Process present!");
            }

            IsActive         = CheckAddr <FnBool>(mtlib, "MT_IsActive");
            AddIgnoreVehicle = CheckAddr <SetInt>(mtlib, "MT_AddIgnoreVehicle");
            NeutralGear      = CheckAddr <FnBool>(mtlib, "MT_NeutralGear");
            ShiftMode        = CheckAddr <GetInt>(mtlib, "MT_GetShiftMode");

            if (IsActive == null || AddIgnoreVehicle == null || NeutralGear == null)
            {
                mtPresent = false;
                Logger.Write(logpath, "MTSupport disabled!");
            }
            else
            {
                mtPresent = true;
                Logger.Write(logpath, "MTSupport initialized!");
            }
        }
Exemplo n.º 2
0
        public TDInt(object obj, PropertyInfo info)
            : base()
        {
            MemberInfo get = info.GetGetMethod();

            _get = Delegate.CreateDelegate(typeof(TDInt.GetInt), obj, info.GetGetMethod()) as TDInt.GetInt;
            _set = Delegate.CreateDelegate(typeof(TDInt.SetInt), obj, info.GetSetMethod()) as TDInt.SetInt;
        }
Exemplo n.º 3
0
        //Note the degree of internal coupling
        void ReportProgress(int value)
        {
            ISynchronizeInvoke synchronizer = m_ProgressBar;

            if (synchronizer.InvokeRequired == false)
            {
                SetProgress(value);
                return;
            }
            SetInt del = new SetInt(SetProgress);

            try
            {
                synchronizer.Invoke(del, new object[] { value });
            }
            catch
            {}
        }
Exemplo n.º 4
0
 public void SetValue(int progress)
 {
     if (InvokeRequired)
     {
         SetInt setInt = delegate(int value)
         {
             base.Value = value;
         };
         try
         {
             Invoke(setInt, new object[] { progress });
         }
         catch
         {}
     }
     else
     {
         base.Value = progress;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Progresbar Table
 /// </summary>
 /// <param name="val"></param>
 void ReportProgressTable(int val)
 {
     ISynchronizeInvoke synchronizer = progressBar2;
     if (synchronizer.InvokeRequired == false)
     {
         SetProgressTable(val);
         return;
     }
     SetInt delProg = new SetInt(SetProgressTable);
     try
     {
         synchronizer.Invoke(delProg, new object[] { val });
     }
     catch
     {
     }
 }
Exemplo n.º 6
0
 public TDInt(GetInt get, SetInt set)
     : base()
 {
     _get = get;
     _set = set;
 }
Exemplo n.º 7
0
 public static void Start()
 {
     var setInt = new SetInt();
 }