Esempio n. 1
0
        /// <summary>
        /// Initializes the libReloaded bindings used for internal Reloaded Mod Loader functions
        /// such as printing to buffers, logging and other functions.
        /// </summary>
        static void InitBindings()
        {
            // Set local game process.
            Program.GameProcess = ReloadedProcess.GetCurrentProcess();

            // Set up Reloaded Mod Loader bindings.
            Bindings.PrintText    += Client.Print;
            Bindings.PrintError   += Client.PrintError;
            Bindings.PrintInfo    += Client.PrintInfo;
            Bindings.PrintWarning += Client.PrintWarning;
            Bindings.TargetProcess = Program.GameProcess;
        }
        /// <summary>
        /// Initializes the libReloaded bindings used for internal Reloaded Mod Loader functions
        /// such as printing to buffers, logging and other functions.
        /// </summary>
        static void InitBindings()
        {
            // Set local game process.
            Program.GameProcess           = ReloadedProcess.GetCurrentProcess();
            Program.ExecutingGameLocation = Environment.GetCommandLineArgs()[0];
            Program.ModDirectory          = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            // For our libraries in a separate AppDomain executing main.dll
            if (Program.ModDirectory.EndsWith("Libraries"))
            {
                Program.ModDirectory = Path.GetDirectoryName(Program.ModDirectory);
            }

            // Set up Reloaded Mod Loader bindings.
            Bindings.PrintText    += Client.Print;
            Bindings.PrintError   += Client.PrintError;
            Bindings.PrintInfo    += Client.PrintInfo;
            Bindings.PrintWarning += Client.PrintWarning;
            Bindings.TargetProcess = Program.GameProcess;
        }