/// <summary>
        /// Cleans up the HudManager and Disposes all windows that are
        /// being managed by this HudManager. Use this function when the
        /// plugin is shutting down. Also be sure to unregister
        /// <see cref="GraphicsReset()"/> from the GraphicsReset event.
        /// </summary>
        public void Dispose()
        {
            if (Disposed)
            {
                return;
            }

            if (mRepaintHeartbeat.Running)
            {
                mRepaintHeartbeat.Stop();
            }
            mRepaintHeartbeat.Timeout -= RepaintHeartbeatDispatch;
            mRepaintHeartbeat          = null;

            //Core.WindowMessage -= WindowMessageDispatch;

            // Need to use a copy of the list because the Dispose() method of
            // windows modifies mWindowList.
            UpdateHudsListCopy();
            foreach (IManagedHud hud in mHudsListCopy)
            {
                hud.Dispose();
            }
            mHudsOnTopList.Clear();
            mHudsList.Clear();
            mHudsListCopy.Clear();

            mHost              = null;
            mCore              = null;
            mDefaultView       = null;
            mDefaultViewActive = null;

            mDisposed = true;
        }
Ejemplo n.º 2
0
        public static void ViewInit()
        {
            //Create view here
            View    = MyClasses.MetaViewWrappers.ViewSystemSelector.CreateViewResource(PluginCore.MyHost, "ExamplePlugin.ViewXML.testlayout.xml");
            bTest   = (MyClasses.MetaViewWrappers.IButton)View["bTest"];
            txtTest = (MyClasses.MetaViewWrappers.ITextBox)View["txtTest"];
            sldTest = (MyClasses.MetaViewWrappers.ISlider)View["sldTest"];

            sldTest.Change += new EventHandler(sldTest_Change);
            bTest.Hit      += new EventHandler(bTest_Hit);
        }
Ejemplo n.º 3
0
 void InitView()
 {
     View            = MyClasses.MetaViewWrappers.ViewSystemSelector.CreateViewResource(Host, "VirindiReporter.ViewXML.mainView.xml");
     cmdReset        = (MyClasses.MetaViewWrappers.IButton)View["cmdReset"];
     cmdReport       = (MyClasses.MetaViewWrappers.IButton)View["cmdReport"];
     cmdReportA      = (MyClasses.MetaViewWrappers.IButton)View["cmdReportA"];
     cmdReportF      = (MyClasses.MetaViewWrappers.IButton)View["cmdReportF"];
     cmdReset.Hit   += new EventHandler(cmdReset_Hit);
     cmdReport.Hit  += new EventHandler(cmdReport_Hit);
     cmdReportA.Hit += new EventHandler(cmdReportA_Hit);
     cmdReportF.Hit += new EventHandler(cmdReportF_Hit);
 }
        /// <summary>
        /// Constructs a new instance of a HudManager. You <b>must</b> also register
        ///  the GraphicsReset() function for the PluginBase.GraphicsReset event.
        /// </summary>
        /// <param name="host">PluginBase.Host</param>
        /// <param name="core">PluginBase.Core</param>
        /// <param name="startHeartbeatNow">If this is true, the heartbeat
        ///		timer will start ticking right away. This is generally
        ///		undesirable if this HudManager is created in the Startup()
        ///		method of the plugin. If this is false, you must call
        ///		<see cref="StartHeartbeat()"/> at a later time, such as during
        ///		the PlayerLogin event.</param>
        public HudManager(PluginHost host, CoreManager core, MyClasses.MetaViewWrappers.IView defaultView, DefaultViewActiveDelegate defaultViewActive, bool startHeartbeatNow)
        {
            mHost              = host;
            mCore              = core;
            mDefaultView       = defaultView;
            mDefaultViewActive = defaultViewActive;

            mToolTip = new ToolTipHud(this);

            mRepaintHeartbeat          = new DecalTimer();
            mRepaintHeartbeat.Timeout += new Decal.Interop.Input.ITimerEvents_TimeoutEventHandler(RepaintHeartbeatDispatch);
            if (startHeartbeatNow)
            {
                StartHeartbeat();
            }

            //Core.WindowMessage += new EventHandler<WindowMessageEventArgs>(WindowMessageDispatch);
        }
Ejemplo n.º 5
0
        void InitView()
        {
            // initialize view @TODO: does this actually do the initialization? figure out what this does
            View = MyClasses.MetaViewWrappers.ViewSystemSelector.CreateViewResource(Host, "DucasTest.ViewXML.mainView.xml");

            // *************************************************************
            //logger tab buttons
            cmdLogOnPk       = (MyClasses.MetaViewWrappers.IButton)View["cmdLogOnPk"];
            cmdLogOnUnknown  = (MyClasses.MetaViewWrappers.IButton)View["cmdLogOnUnknown"];
            cmdLogOnFriendly = (MyClasses.MetaViewWrappers.IButton)View["cmdLogOnFriendly"];
            cmdLogOnAll      = (MyClasses.MetaViewWrappers.IButton)View["cmdLogOnAll"];
            // logger tab handlers
            cmdLogOnPk.Hit       += new EventHandler(cmdLogOnPk_Hit);
            cmdLogOnUnknown.Hit  += new EventHandler(cmdLogOnUnknown_Hit);
            cmdLogOnFriendly.Hit += new EventHandler(cmdLogOnFriendly_Hit);
            cmdLogOnAll.Hit      += new EventHandler(cmdLogOnAll_Hit);
            // /////////////////////////////////////////////////////////////
            // *************************************************************

            // *************************************************************
            // spell tab buttons
            cmdClearAllSpellTabs           = (MyClasses.MetaViewWrappers.IButton)View["cmdClearAllSpellTabs"];
            cmdLoadMissileSpellTabs        = (MyClasses.MetaViewWrappers.IButton)View["cmdLoadMissileSpellTabs"];
            cmdLoadMageSpellTabs           = (MyClasses.MetaViewWrappers.IButton)View["cmdLoadMageSpellTabs"];
            cmdLoadHeavyWeaponsSpellTabs   = (MyClasses.MetaViewWrappers.IButton)View["cmdLoadHeavyWeaponsSpellTabs"];
            cmdLoadFinesseWeaponsSpellTabs = (MyClasses.MetaViewWrappers.IButton)View["cmdLoadFinesseWeaponsSpellTabs"];
            cmdLoadLightWeaponsSpellTabs   = (MyClasses.MetaViewWrappers.IButton)View["cmdLoadLightWeaponsSpellTabs"];
            //// spell tab handlers
            cmdClearAllSpellTabs.Hit           += new EventHandler(cmdClearAllSpellTabs_Hit);
            cmdLoadMissileSpellTabs.Hit        += new EventHandler(cmdLoadMissileSpellTabs_Hit);
            cmdLoadMageSpellTabs.Hit           += new EventHandler(cmdLoadMageSpellTabs_Hit);
            cmdLoadHeavyWeaponsSpellTabs.Hit   += new EventHandler(cmdLoadHeavyWeaponsSpellTabs_Hit);
            cmdLoadFinesseWeaponsSpellTabs.Hit += new EventHandler(cmdLoadFinesseWeaponsSpellTabs_Hit);
            cmdLoadLightWeaponsSpellTabs.Hit   += new EventHandler(cmdLoadLightWeaponsSpellTabs_Hit);
            // /////////////////////////////////////////////////////////////
            // *************************************************************


            mFS = (FileService)Core.FileService;
        }
Ejemplo n.º 6
0
        void ViewInit()
        {
            //Create view here
            View     = MyClasses.MetaViewWrappers.ViewSystemSelector.CreateViewResource(Host, "SkunkVision_CSharp.MainView.xml");
            chkSlope = (MyClasses.MetaViewWrappers.ICheckBox)View["chkSlope"];
            chkWater = (MyClasses.MetaViewWrappers.ICheckBox)View["chkWater"];
            chkLight = (MyClasses.MetaViewWrappers.ICheckBox)View["chkLight"];

            chkSlope.Checked = Render.SlopeEnabled;
            chkWater.Checked = Render.WaterEnabled;
            chkLight.Checked = Render.LightEnabled;

            chkSlope.Change += new EventHandler <MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs>(chkSlope_Change);
            chkWater.Change += new EventHandler <MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs>(chkWater_Change);
            chkLight.Change += new EventHandler <MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs>(chkLight_Change);

            bSetSlope = (MyClasses.MetaViewWrappers.IButton)View["bSetSlope"];
            bSetWater = (MyClasses.MetaViewWrappers.IButton)View["bSetWater"];
            bSetLight = (MyClasses.MetaViewWrappers.IButton)View["bSetLight"];

            bSetSlope.Click += new EventHandler <MyClasses.MetaViewWrappers.MVControlEventArgs>(bSetSlope_Click);
            bSetWater.Click += new EventHandler <MyClasses.MetaViewWrappers.MVControlEventArgs>(bSetWater_Click);
            bSetLight.Click += new EventHandler <MyClasses.MetaViewWrappers.MVControlEventArgs>(bSetLight_Click);
        }