Exemple #1
0
        /// <summary>
        /// Register an addon class from outside of HKMP.
        /// </summary>
        /// <param name="clientAddon">The client addon instance.</param>
        public static void RegisterAddon(ClientAddon clientAddon)
        {
            if (_hasLoaded)
            {
                throw new InvalidOperationException("Addon can not be registered at this moment");
            }

            RegisteredAddons.Add(clientAddon);
        }
Exemple #2
0
        /// <summary>
        /// Register a client addon to be initialized and managed by HKMP.
        /// This method can only be called during the initialization of mods.
        /// After all mods have been initialized, this will throw an exception.
        /// </summary>
        /// <param name="clientAddon">The client addon to be registered.</param>
        /// <exception cref="ArgumentException">Thrown if the given addon is null.</exception>
        public static void RegisterAddon(ClientAddon clientAddon)
        {
            if (clientAddon == null)
            {
                throw new ArgumentException("Client addon can not be null");
            }

            ClientAddonManager.RegisterAddon(clientAddon);
        }