void OnAddCustomGui(object theSender, EventArgs theArgs) { KGFAccessor.KGFAccessorEventargs anEventArgs = theArgs as KGFAccessor.KGFAccessorEventargs; if (anEventArgs != null) { KGFICustomGUI aCustomGui = anEventArgs.GetObject() as KGFICustomGUI; if (aCustomGui != null) { Add(aCustomGui); } } }
/// <summary> /// Removes destroyed KGFIGui2D objects from the itsGUIs list /// </summary> /// <param name="theSender"></param> /// <param name="theArgs"></param> private void OnUnregisterKGFIGui2D(object theSender, EventArgs theArgs) { KGFAccessor.KGFAccessorEventargs anEventArgs = theArgs as KGFAccessor.KGFAccessorEventargs; if (anEventArgs != null) { KGFIGui2D aGui2D = anEventArgs.GetObject() as KGFIGui2D; if (aGui2D != null && itsGUIs.Contains(aGui2D)) { itsGUIs.Remove(aGui2D); } } }
/// <summary> /// Add registering KGFIGui2D objets to the itsGUIs list /// </summary> /// <param name="theSender"></param> /// <param name="theArgs"></param> private void OnRegisterKGFIGui2D(object theSender, EventArgs theArgs) { KGFAccessor.KGFAccessorEventargs anEventArgs = theArgs as KGFAccessor.KGFAccessorEventargs; if (anEventArgs != null) { KGFIGui2D aGui2D = anEventArgs.GetObject() as KGFIGui2D; if (aGui2D != null) { itsGUIs.Add(aGui2D); itsGUIs.Sort(CompareKGFIGui2D); } } }
void OnMapSystemRegistered(object theSender, EventArgs theArgs) { KGFAccessor.KGFAccessorEventargs anArgs = (KGFAccessor.KGFAccessorEventargs)theArgs; miniMap = (KGFMapSystem)anArgs.GetObject(); //全屏变换 miniMap.EventFullscreenModeChanged += OnFullscreenModeChanged; //鼠标进入小地图 miniMap.EventMouseMapEntered += OnMouseMapEntered; //鼠标退出小地图 miniMap.EventMouseMapLeft += OnMouseMapLeft; //鼠标点击小地图图标 miniMap.EventMouseMapIconClicked += OnMouseMapIconClicked; //鼠标点击小地图 miniMap.EventClickedOnMinimap += OnClickedOnMinimap; //在小地图创建标志 miniMap.EventUserFlagCreated += OnUserFlagCreated; //标志状态改变 miniMap.EventVisibilityOnMinimapChanged += OnVisibilityOnMinimapChanged; }