示例#1
0
        public CombatTrackerGUI(CombatTracker combatTracker, HudList monsterList, HudList damageInfoList)
        {
            try
            {
                if (combatTracker == null)
                {
                    return;
                }

                this.combatTracker = combatTracker;
                this.monsterList   = monsterList;

                combatTrackerGUIInfo = new CombatTrackerGUIInfo(damageInfoList);

                monsterList.ClearColumnsAndRows();

                // Each character is a max of 6 pixels wide
                monsterList.AddColumn(typeof(HudStaticText), 5, null);
                monsterList.AddColumn(typeof(HudStaticText), 111, null);
                monsterList.AddColumn(typeof(HudStaticText), 37, null);
                monsterList.AddColumn(typeof(HudStaticText), 55, null);                 // This cannot go any smaller without pruning text
                monsterList.AddColumn(typeof(HudStaticText), 77, null);

                HudList.HudListRowAccessor newRow = monsterList.AddRow();
                ((HudStaticText)newRow[2]).Text          = "KB's";
                ((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[3]).Text          = "Dmg Rcvd";
                ((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[4]).Text          = "Dmg Givn";
                ((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right;

                newRow = monsterList.AddRow();
                ((HudStaticText)newRow[0]).Text          = "*";
                ((HudStaticText)newRow[1]).Text          = "All";
                ((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right;

                selectedRow = 1;

                monsterList.Click += new HudList.delClickedControl(monsterList_Click);

                combatTracker.InfoCleared         += new Action <bool>(combatTracker_InfoCleared);
                combatTracker.StatsLoaded         += new Action <List <CombatInfo> >(combatTracker_StatsLoaded);
                combatTracker.CombatInfoUpdated   += new Action <CombatInfo>(combatTracker_CombatInfoUpdated);
                combatTracker.AetheriaInfoUpdated += new Action <AetheriaInfo>(combatTracker_AetheriaInfoUpdated);
                combatTracker.CloakInfoUpdated    += new Action <CloakInfo>(combatTracker_CloakInfoUpdated);
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
示例#2
0
		public CombatTrackerGUI(CombatTracker combatTracker, HudList monsterList, HudList damageInfoList)
		{
			try
			{
				if (combatTracker == null)
					return;

				this.combatTracker = combatTracker;
				this.monsterList = monsterList;

				combatTrackerGUIInfo = new CombatTrackerGUIInfo(damageInfoList);

				monsterList.ClearColumnsAndRows();

				// Each character is a max of 6 pixels wide
				monsterList.AddColumn(typeof(HudStaticText), 5, null);
				monsterList.AddColumn(typeof(HudStaticText), 111, null);
				monsterList.AddColumn(typeof(HudStaticText), 37, null);
				monsterList.AddColumn(typeof(HudStaticText), 55, null); // This cannot go any smaller without pruning text
				monsterList.AddColumn(typeof(HudStaticText), 77, null);

				HudList.HudListRowAccessor newRow = monsterList.AddRow();
				((HudStaticText)newRow[2]).Text = "KB's";
				((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
				((HudStaticText)newRow[3]).Text = "Dmg Rcvd";
				((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
				((HudStaticText)newRow[4]).Text = "Dmg Givn";
				((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right;

				newRow = monsterList.AddRow();
				((HudStaticText)newRow[0]).Text = "*";
				((HudStaticText)newRow[1]).Text = "All";
				((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
				((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
				((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
				
				selectedRow = 1;

				monsterList.Click += new HudList.delClickedControl(monsterList_Click);

				combatTracker.InfoCleared += new Action<bool>(combatTracker_InfoCleared);
				combatTracker.StatsLoaded += new Action<List<CombatInfo>>(combatTracker_StatsLoaded);
				combatTracker.CombatInfoUpdated += new Action<CombatInfo>(combatTracker_CombatInfoUpdated);
				combatTracker.AetheriaInfoUpdated += new Action<AetheriaInfo>(combatTracker_AetheriaInfoUpdated);
				combatTracker.CloakInfoUpdated += new Action<CloakInfo>(combatTracker_CloakInfoUpdated);
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}