Skip to content

Commit

Permalink
Merge pull request #24 from midraal/feature/show_levels
Browse files Browse the repository at this point in the history
add show level option
  • Loading branch information
Crowdedlight committed Aug 25, 2014
2 parents cf8306a + ef02353 commit 03f27a8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
38 changes: 27 additions & 11 deletions VikingGroupDisplay.lua
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ local ktSmallInvitePathIcons = -- NOTE: ID's are zero-indexed in CPP
[PlayerPathLib.PlayerPathType_Explorer] = "Icon_Windows_UI_CRB_Explorer_Small"
}

local ktInviteClassIcons =
{
[GameLib.CodeEnumClass.Warrior] = "VikingSprites:ClassWarrior",
[GameLib.CodeEnumClass.Engineer] = "VikingSprites:ClassEngineer",
[GameLib.CodeEnumClass.Esper] = "VikingSprites:ClassEsper",
[GameLib.CodeEnumClass.Medic] = "VikingSprites:ClassMedic",
[GameLib.CodeEnumClass.Stalker] = "VikingSprites:ClassStalker",
[GameLib.CodeEnumClass.Spellslinger] = "VikingSprites:ClassSpellslinger",
}
local ktInviteClassIcons = {
[GameLib.CodeEnumClass.Warrior] = "VikingSprites:Icon_Class_Warrior_12",
[GameLib.CodeEnumClass.Engineer] = "VikingSprites:Icon_Class_Engineer_12",
[GameLib.CodeEnumClass.Esper] = "VikingSprites:Icon_Class_Esper_12",
[GameLib.CodeEnumClass.Medic] = "VikingSprites:Icon_Class_Medic_12",
[GameLib.CodeEnumClass.Stalker] = "VikingSprites:Icon_Class_Stalker_12",
[GameLib.CodeEnumClass.Spellslinger] = "VikingSprites:Icon_Class_Spellslinger_12"
}

local karMessageIconString =
{
Expand Down Expand Up @@ -240,6 +239,9 @@ function VikingGroupDisplay:GetDefaults()
InviteTimerStart = nil,
MentorTimerStart = nil,
InviterName = "",
display = {
ShowLevels = false,
}
}
}

Expand Down Expand Up @@ -316,7 +318,7 @@ function VikingGroupDisplay:OnDocumentReady()
self.db = VikingLib.Settings.RegisterSettings(self, "VikingGroupDisplay", self:GetDefaults(), "Group Frames")
self.generalDb = self.db.parent
end

self.wndGroupHud = Apollo.LoadForm(self.xmlDoc, "GroupHud", "FixedHudStratum", self)
self.wndGroupHud:Show(false, true)
self.wndLeaveGroup = self.wndGroupHud:FindChild("GroupHudLeaveDialog")
Expand Down Expand Up @@ -440,7 +442,8 @@ function VikingGroupDisplay:LoadPortrait(idx)
wndLowHealthFlash = wndHud:FindChild("LowHealthFlash"),
wndPathIcon = wndHud:FindChild("PathIcon"),
wndOffline = wndHud:FindChild("Offline"),
wndMark = wndHud:FindChild("Mark")
wndMark = wndHud:FindChild("Mark"),
wndLevel = wndHud:FindChild("Level"),
}

self.tGroupWndPortraits[idx].wndHud:Show(false)
Expand Down Expand Up @@ -880,6 +883,13 @@ function VikingGroupDisplay:DrawMemberPortrait(tPortrait, tMemberInfo)
if tMemberInfo.nMarkerId ~= 0 then
tPortrait.wndMark:SetSprite(kstrRaidMarkerToSprite[tMemberInfo.nMarkerId])
end

if self.db.char.display["ShowLevels"] then
tPortrait.wndLevel:SetText(tMemberInfo.nLevel)
else
tPortrait.wndLevel:SetText("")
end

end

function VikingGroupDisplay:HelperUpdateHealth(tPortrait, tMemberInfo, unitMember)
Expand Down Expand Up @@ -1633,6 +1643,12 @@ end
-- VikingSettings Functions
--------------------------------------------------------------------------------------------------
function VikingGroupDisplay:UpdateSettingsForm(wndContainer)
-- Display
wndContainer:FindChild("Display:Content:ShowLevels"):SetCheck(self.db.char.display["ShowLevels"])
end

function VikingGroupDisplay:OnSettingsDisplay(wndHandler, wndControl, eMouseButton)
self.db.char.display[wndControl:GetName()] = wndControl:IsChecked()
end
---------------------------------------------------------------------------------------------------
-- VikingGroupDisplay instance
Expand Down
17 changes: 15 additions & 2 deletions VikingGroupDisplay.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<Control Class="Window" LAnchorPoint="1" LAnchorOffset="-236" TAnchorPoint="0" TAnchorOffset="-3" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="1" BAnchorOffset="3" RelativeToClient="1" Font="Default" Text="" Template="Default" Name="DeadIndicator" BGColor="white" TextColor="white" Picture="1" IgnoreMouse="1" Sprite="CRB_GroupFrame:sprGroup_HealthWarn_Dead" Visible="0" HideInEditor="1" NoClip="1" NewWindowDepth="1" TooltipColor=""/>
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="-12" TAnchorPoint="0" TAnchorOffset="-5" RAnchorPoint="0" RAnchorOffset="31" BAnchorPoint="0" BAnchorOffset="36" RelativeToClient="1" Font="Default" Text="" Template="Default" Name="Offline" BGColor="white" TextColor="white" Sprite="sprGroup_Disconnected" Picture="1" IgnoreMouse="1" NewWindowDepth="1" HideInEditor="1" Visible="0" TooltipColor="" Tooltip=""/>
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="3" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="32" RelativeToClient="1" Font="Default" Text="" Template="Default" Name="GroupPortraitArrangeVert" BGColor="white" TextColor="white" NewControlDepth="1" TooltipColor="" Tooltip="">
<Control Class="Window" Name="Name" Sprite="" BGColor="white" Font="CRB_InterfaceSmall_O" TextColor="UI_TextHoloTitle" LAnchorPoint="0" LAnchorOffset="20" TAnchorPoint="0" TAnchorOffset="-2" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="18" TextId="Challenges_NoProgress" Text="" IgnoreMouse="1" DT_VCENTER="1" TooltipColor="" Tooltip="" DT_BOTTOM="0"/>
<Control Class="Window" Name="Name" Sprite="" BGColor="white" Font="CRB_InterfaceSmall_O" TextColor="UI_TextHoloTitle" LAnchorPoint="0" LAnchorOffset="70" TAnchorPoint="0" TAnchorOffset="-2" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="18" TextId="Challenges_NoProgress" Text="" IgnoreMouse="1" DT_VCENTER="1" TooltipColor="" Tooltip="" DT_BOTTOM="0"/>
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="18" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="1" BAnchorOffset="5" RelativeToClient="1" Font="Default" Text="" Template="Default" Name="GroupPortraitHealthBG" BGColor="white" TextColor="white" Sprite="kitIProgBar_Inlay_Base" Picture="0" IgnoreMouse="1" TooltipColor="">
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="10" RelativeToClient="1" Font="Default" Text="" Template="Default" Name="HealthShieldsContainer" BGColor="99141122" TextColor="white" Sprite="BasicSprites:WhiteFill" Picture="1" IgnoreMouse="1" TooltipColor="">
<Control Class="ProgressBar" Name="Health" Text="" SetTextToProgress="0" UseValues="0" DT_CENTER="0" DT_VCENTER="1" DT_RIGHT="1" ProgressEmpty="" ProgressFull="BasicSprites:WhiteFill" BGColor="white" TextColor="white" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="1" BAnchorOffset="0" ProgressEdgeGlow="" IgnoreMouse="1" Picture="0" RelativeToClient="1" NoClip="1" TooltipColor="" BarColor="" Sprite=""/>
Expand All @@ -77,6 +77,7 @@
</Control>
</Control>
<Control Class="Window" Name="Mark" Sprite="Icon_Windows_UI_CRB_Marker_Bomb" Picture="1" BGColor="white" TextColor="white" LAnchorPoint="1" LAnchorOffset="3" TAnchorPoint="0" TAnchorOffset="3" RAnchorPoint="1" RAnchorOffset="33" BAnchorPoint="0" BAnchorOffset="33" IgnoreMouse="1" RelativeToClient="1" NewControlDepth="1" TooltipColor="" Visible="1" HideInEditor="0" NoClip="1"/>
<Control Class="Window" Name="Level" Sprite="" BGColor="white" Font="CRB_InterfaceSmall_O" TextColor="UI_TextHoloTitle" LAnchorPoint="0" LAnchorOffset="20" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="0" RAnchorOffset="70" BAnchorPoint="0" BAnchorOffset="20" TextId="Challenges_NoProgress" Text="" IgnoreMouse="1" DT_VCENTER="0" TooltipColor="" Tooltip="" DT_BOTTOM="1"/>
</Form>
<Form Class="Window" Name="GroupInviteDialog" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint=".5" TAnchorOffset="-266" RAnchorPoint="0" RAnchorOffset="459" BAnchorPoint=".5" BAnchorOffset="133" Border="1" Template="Holo_Small" Picture="0" Visible="0" BGColor="white" TextColor="white" SwallowMouseClicks="1" Overlapped="1" UseTemplateBG="1" Moveable="1" TooltipColor="" Tooltip="">
<Control Class="Window" Name="TimerLabel" LAnchorPoint="1" LAnchorOffset="-59" TAnchorPoint="1" TAnchorOffset="-85" RAnchorPoint="1" RAnchorOffset="-32" BAnchorPoint="1" BAnchorOffset="-52" DT_CENTER="1" DT_VCENTER="1" RelativeToClient="1" TextColor="UI_WindowTitleGray" BGColor="white" TextId="" Font="CRB_InterfaceLarge_B" DT_RIGHT="0" Text="44" TooltipColor="" Visible="0" HideInEditor="1" Tooltip=""/>
Expand Down Expand Up @@ -160,5 +161,17 @@
</Control>
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="70" TAnchorPoint="0" TAnchorOffset="37" RAnchorPoint="1" RAnchorOffset="-70" BAnchorPoint="0" BAnchorOffset="81" RelativeToClient="1" Font="CRB_HeaderLarge" Sprite="" Template="" Name="Title" BGColor="white" TextColor="UI_WindowTitleYellow" DT_CENTER="1" DT_RIGHT="0" DT_VCENTER="1" DT_WORDBREAK="1" TextId="CRB_Are_you_really_sure" TooltipColor="" Tooltip=""/>
</Form>
<Form Class="Window" LAnchorPoint="0" LAnchorOffset="10" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="-10" BAnchorPoint="1" BAnchorOffset="0" RelativeToClient="1" Font="Default" Text="" BGColor="UI_WindowBGDefault" TextColor="UI_WindowTextDefault" Template="Default" TooltipType="OnCursor" Name="VikingSettings" Border="0" Picture="0" SwallowMouseClicks="1" Moveable="0" Escapable="0" Overlapped="1" TooltipColor="" Tooltip="" Sprite="" IgnoreMouse="0" VScroll="1" Visible="1"/>
<Form Class="Window" LAnchorPoint="0" LAnchorOffset="10" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="-10" BAnchorPoint="1" BAnchorOffset="0" RelativeToClient="1" Font="Default" Text="" BGColor="UI_WindowBGDefault" TextColor="UI_WindowTextDefault" Template="Default" TooltipType="OnCursor" Name="VikingSettings" Border="0" Picture="0" SwallowMouseClicks="1" Moveable="0" Escapable="0" Overlapped="1" TooltipColor="" Tooltip="" Sprite="" IgnoreMouse="0" VScroll="1" Visible="1">
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="105" RelativeToClient="1" Font="Default" Text="" BGColor="11000000" TextColor="ffffffff" Template="CRB_InnerWindow" TooltipType="OnCursor" Name="Display" TooltipColor="" Sprite="BasicSprites:WhiteFill" Picture="0" IgnoreMouse="1" Tooltip="" LeftEdgeControlsAnchor="" BottomEdgeControlsAnchor="STYLE_BOTTOM">
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="32" RelativeToClient="1" Font="CRB_Dialog_Heading_Small" Text="Display Settings" BGColor="99000000" TextColor="ffbcb7da" Template="Default" TooltipType="OnCursor" Name="Header" TooltipColor="" DT_CENTER="0" DT_VCENTER="1" TextId="" Sprite="" Picture="1" IgnoreMouse="1">
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="1" TAnchorOffset="0" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="1" BAnchorOffset="1" RelativeToClient="1" Font="Default" Text="" BGColor="90645f7e" TextColor="UI_WindowTextDefault" Template="Default" TooltipType="OnCursor" Name="Line" TooltipColor="" Sprite="BasicSprites:WhiteFill" Picture="1" IgnoreMouse="1" NoClip="1"/>
</Control>
<Control Class="Window" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="36" RAnchorPoint="1" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="125" RelativeToClient="1" Font="Default" Text="" BGColor="ffffffff" TextColor="ffffffff" Template="Default" TooltipType="OnCursor" Name="Content" TooltipColor="" Tooltip="">
<Control Class="Button" Base="VikingSprites:CheckBoxbtn" Font="CRB_Header10" ButtonType="Check" RadioGroup="" LAnchorPoint="0" LAnchorOffset="0" TAnchorPoint="0" TAnchorOffset="4" RAnchorPoint=".5" RAnchorOffset="0" BAnchorPoint="0" BAnchorOffset="28" DT_VCENTER="1" DT_CENTER="0" BGColor="ffffffff" TextColor="ffbcb7da" NormalTextColor="ffffffff" PressedTextColor="ffffffff" FlybyTextColor="ffffffff" PressedFlybyTextColor="ffffffff" DisabledTextColor="ffffffff" TooltipType="OnCursor" Name="ShowLevels" TooltipColor="ff4fbfff" Template="CRB_NormalFramedThin" DrawAsCheckbox="1" Text="Show Levels" TooltipFont="CRB_Interface9" Tooltip="" TooltipId="" CheckboxRight="0" TextId="" GlobalRadioGroup="" RadioDisallowNonSelection="1">
<Event Name="ButtonCheck" Function="OnSettingsDisplay"/>
<Event Name="ButtonUncheck" Function="OnSettingsDisplay"/>
</Control>
</Control>
</Control>
</Form>
</Forms>

0 comments on commit 03f27a8

Please sign in to comment.