diff --git a/BuildSkillsUI.lua b/BuildSkillsUI.lua index d8e7f8f..c102705 100755 --- a/BuildSkillsUI.lua +++ b/BuildSkillsUI.lua @@ -340,7 +340,7 @@ function AltSystem:CreateBuildSkillsContent(parentFrame) local sectionHeader = parentFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") sectionHeader:SetPoint("TOPLEFT", parentFrame, "TOPLEFT", PADDING, yPos) sectionHeader:SetText("Skill list") - --sectionHeader:SetTextColor(1, 1, 1) + sectionHeader:SetTextColor(1, 1, 1) yPos = yPos - 24 diff --git a/Data.lua b/Data.lua index d1a1ae2..6706c49 100755 --- a/Data.lua +++ b/Data.lua @@ -249,18 +249,18 @@ for _, skill in ipairs(DEFAULT_SKILLS) do table.insert(AltSystem.Data.Skills, { name = skill.name, level = skill.level, modifier = skill.modifier }) end --- Item options: name, label (used in roll messages), and modifier (first entry = no item) +-- Item options: name and modifier (first entry = no item) AltSystem.Data.Items = { - { name = "No item", label = "No item", modifier = 0 }, - { name = "Rare", label = "Rare item", modifier = 3 }, - { name = "Epic", label = "Epic item", modifier = 5 }, + { name = "No item", modifier = 0 }, + { name = "Rare", modifier = 3 }, + { name = "Epic", modifier = 5 }, } --- Defense / Armor options: name, label (used in roll messages), and modifier +-- Defense / Armor options: name and modifier AltSystem.Data.Defenses = { - { name = "None", label = "No armor", modifier = 0 }, - { name = "Partial", label = "Extra armor", modifier = 1 }, - { name = "Full", label = "Extra armor", modifier = 2 }, + { name = "None", modifier = 0 }, + { name = "Partial", modifier = 1 }, + { name = "Full", modifier = 2 }, } -- Shield modifier diff --git a/Roll.lua b/Roll.lua index 036a680..29d9190 100755 --- a/Roll.lua +++ b/Roll.lua @@ -198,7 +198,7 @@ function AltSystem:CalculateAndDisplayResult(rollType, rollValue, petRollValue) table.insert(modifiers, { name = skill and skill.name or "Skill", value = skillMod }) end if itemMod ~= 0 then - table.insert(modifiers, { name = item and (item.label or item.name) or "Item", value = itemMod }) + table.insert(modifiers, { name = item and item.name or "Item", value = itemMod }) end if petMod ~= 0 then table.insert(modifiers, { name = "Pet", value = petMod }) @@ -216,10 +216,10 @@ function AltSystem:CalculateAndDisplayResult(rollType, rollValue, petRollValue) table.insert(modifiers, { name = skill and skill.name or "Skill", value = skillMod }) end if itemMod ~= 0 then - table.insert(modifiers, { name = item and (item.label or item.name) or "Item", value = itemMod }) + table.insert(modifiers, { name = item and item.name or "Item", value = itemMod }) end if defenseMod ~= 0 then - table.insert(modifiers, { name = defense and (defense.label or defense.name) or "Armor", value = defenseMod }) + table.insert(modifiers, { name = defense and defense.name or "Armor", value = defenseMod }) end if shieldMod ~= 0 then table.insert(modifiers, { name = "Shield", value = shieldMod }) diff --git a/UI.lua b/UI.lua index 534d061..bfc7013 100755 --- a/UI.lua +++ b/UI.lua @@ -5,17 +5,13 @@ AltSystem = AltSystem or {} -local WINDOW_WIDTH = 720 -local WINDOW_HEIGHT = 520 -local CONTROLS_WIDTH = 360 -local LOG_WIDTH = 360 +local WINDOW_WIDTH = 700 +local WINDOW_HEIGHT = 500 +local CONTROLS_WIDTH = 350 +local LOG_WIDTH = 350 local PADDING = 12 -local PADDING_HEADER = 6 local ROW_HEIGHT = 26 -local LABEL_HEIGHT = 14 -- approximate height of GameFontNormal text -local LABEL_GAP = 4 -- gap between a sub-label and its input -local ITEM_GAP = 10 -- gap between inputs within the same section -local SECTION_GAP = 22 -- gap between major sections +local SECTION_GAP = 10 -- Helper: Build the skill option list from current AltSystem.Data.Skills local function BuildSkillOptions() @@ -33,32 +29,26 @@ local function BuildSkillOptions() return options end --- Helper: Create a flat dark dropdown with label on top (reuses shared CreateFlatDropdown) +-- Helper: Create a flat dark dropdown with optional label (reuses shared CreateFlatDropdown) local function CreateDropdown(parent, name, labelText, options, defaultIndex, onSelect, labelFont) - local hasLabel = labelText and labelText ~= "" - local containerHeight = hasLabel and (LABEL_HEIGHT + LABEL_GAP + 28) or ROW_HEIGHT - local container = CreateFrame("Frame", nil, parent) - container:SetHeight(containerHeight) + container:SetHeight(ROW_HEIGHT) local label - if hasLabel then + if labelText and labelText ~= "" then label = container:CreateFontString(nil, "OVERLAY", labelFont or "GameFontNormal") - label:SetPoint("TOPLEFT", container, "TOPLEFT", 0, 0) + label:SetPoint("LEFT", container, "LEFT", 0, 0) label:SetText(labelText) label:SetJustifyH("LEFT") - label:SetTextColor(0.9, 0.75, 0.2) end local selectedIndex = defaultIndex or 1 local dropdown = AltSystem.CreateFlatDropdown(name, container, 190) - if hasLabel then - dropdown:SetPoint("TOPLEFT", container, "TOPLEFT", 0, -(LABEL_HEIGHT + LABEL_GAP)) - dropdown:SetPoint("TOPRIGHT", container, "TOPRIGHT", 0, -(LABEL_HEIGHT + LABEL_GAP)) + if label then + dropdown:SetPoint("RIGHT", container, "RIGHT", 0, 0) else dropdown:SetPoint("LEFT", container, "LEFT", 0, 0) - dropdown:SetPoint("RIGHT", container, "RIGHT", 0, 0) end -- Set initial label text @@ -101,35 +91,22 @@ local function CreateRadioButton(parent, name, text, x, y, isChecked, onClick) btn:SetSize(size, size) btn:SetPoint("TOPLEFT", parent, "TOPLEFT", x, y) - -- Outer grey circle (always visible, acts as border) - local border = btn:CreateTexture(nil, "BACKGROUND") - border:SetAllPoints() - border:SetColorTexture(0.3, 0.3, 0.3, 1) - local borderMask = btn:CreateMaskTexture() - borderMask:SetAllPoints() - borderMask:SetTexture("Interface\\CharacterFrame\\TempPortraitAlphaMask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE") - border:AddMaskTexture(borderMask) - - -- Inner yellow circle (shown when selected, slightly smaller to reveal grey border) - local inner = btn:CreateTexture(nil, "BORDER") - local inset = 3 - inner:SetPoint("TOPLEFT", btn, "TOPLEFT", inset, -inset) - inner:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -inset, inset) - inner:SetColorTexture(0.9, 0.75, 0.2, 1) - local innerMask = btn:CreateMaskTexture() - innerMask:SetPoint("TOPLEFT", btn, "TOPLEFT", inset, -inset) - innerMask:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -inset, inset) - innerMask:SetTexture("Interface\\CharacterFrame\\TempPortraitAlphaMask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE") - inner:AddMaskTexture(innerMask) - inner:Hide() + -- Background (grey when unselected, yellow when selected) — circular via mask + local bg = btn:CreateTexture(nil, "BACKGROUND") + bg:SetAllPoints() + bg:SetColorTexture(0.3, 0.3, 0.3, 1) + local mask = btn:CreateMaskTexture() + mask:SetAllPoints() + mask:SetTexture("Interface\\CharacterFrame\\TempPortraitAlphaMask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE") + bg:AddMaskTexture(mask) btn.checkTex = nil -- unused, kept for compatibility local function UpdateVisual() if btn:GetChecked() then - inner:Show() + bg:SetColorTexture(0.9, 0.75, 0.2, 1) else - inner:Hide() + bg:SetColorTexture(0.3, 0.3, 0.3, 1) end end @@ -192,38 +169,32 @@ function AltSystem:CreateMainFrame() -- TAB BUTTONS (span full window width) --------------------- local contentTop = -24 - local tabHeight = 36 + local tabHeight = 28 local contentWidth = WINDOW_WIDTH - 8 -- 4px inset on each side local tabWidth = contentWidth / 2 local tabUseSkills = CreateFrame("Button", "AltSystemTabUseSkills", f) tabUseSkills:SetSize(tabWidth, tabHeight) tabUseSkills:SetPoint("TOPLEFT", f, "TOPLEFT", 4, contentTop) - tabUseSkills:SetNormalFontObject("GameFontNormalLarge") - tabUseSkills:SetHighlightFontObject("GameFontNormalLarge") + tabUseSkills:SetNormalFontObject("GameFontHighlight") + tabUseSkills:SetHighlightFontObject("GameFontHighlight") tabUseSkills:SetText("Use Skills") local tabUseSkillsBg = tabUseSkills:CreateTexture(nil, "BACKGROUND") tabUseSkillsBg:SetAllPoints() - tabUseSkillsBg:SetColorTexture(0, 0, 0, 0) - - local tabUseSkillsText = tabUseSkills:GetFontString() - tabUseSkillsText:SetTextColor(0.9, 0.75, 0.2, 1) + tabUseSkillsBg:SetColorTexture(0.15, 0.15, 0.15, 1) local tabBuildSkills = CreateFrame("Button", "AltSystemTabBuildSkills", f) tabBuildSkills:SetSize(tabWidth, tabHeight) tabBuildSkills:SetPoint("TOPLEFT", tabUseSkills, "TOPRIGHT", 0, 0) - tabBuildSkills:SetNormalFontObject("GameFontNormalLarge") - tabBuildSkills:SetHighlightFontObject("GameFontNormalLarge") + tabBuildSkills:SetNormalFontObject("GameFontHighlight") + tabBuildSkills:SetHighlightFontObject("GameFontHighlight") tabBuildSkills:SetText("Build Skills") local tabBuildSkillsBg = tabBuildSkills:CreateTexture(nil, "BACKGROUND") tabBuildSkillsBg:SetAllPoints() tabBuildSkillsBg:SetColorTexture(0.3, 0.3, 0.3, 1) - local tabBuildSkillsText = tabBuildSkills:GetFontString() - tabBuildSkillsText:SetTextColor(1, 1, 1, 1) - --------------------- -- TAB CONTENT FRAMES --------------------- @@ -247,17 +218,13 @@ function AltSystem:CreateMainFrame() if tabIndex == 1 then useSkillsContent:Show() buildSkillsContent:Hide() - tabUseSkillsBg:SetColorTexture(0, 0, 0, 0) + tabUseSkillsBg:SetColorTexture(0.15, 0.15, 0.15, 1) tabBuildSkillsBg:SetColorTexture(0.3, 0.3, 0.3, 1) - tabUseSkillsText:SetTextColor(0.9, 0.75, 0.2, 1) - tabBuildSkillsText:SetTextColor(1, 1, 1, 1) else useSkillsContent:Hide() buildSkillsContent:Show() tabUseSkillsBg:SetColorTexture(0.3, 0.3, 0.3, 1) - tabBuildSkillsBg:SetColorTexture(0, 0, 0, 0) - tabUseSkillsText:SetTextColor(1, 1, 1, 1) - tabBuildSkillsText:SetTextColor(0.9, 0.75, 0.2, 1) + tabBuildSkillsBg:SetColorTexture(0.15, 0.15, 0.15, 1) AltSystem:RefreshBuildSkillsList() end end @@ -280,12 +247,12 @@ function AltSystem:CreateMainFrame() local yPos = -PADDING -- Section: Define Your Base Roll - CreateSectionHeader(content, "Base Roll", PADDING_HEADER, yPos) - yPos = yPos - 26 + CreateSectionHeader(content, "Define Your Base Roll", PADDING, yPos) + yPos = yPos - 20 -- Roll Type label CreateSubLabel(content, "Roll Type", PADDING, yPos) - yPos = yPos - (LABEL_HEIGHT + LABEL_GAP) + yPos = yPos - 20 -- Roll Type radio buttons local attackRadio, defenseRadio @@ -315,7 +282,7 @@ function AltSystem:CreateMainFrame() UpdateRollTypeSelection("defense") end) - yPos = yPos - ROW_HEIGHT - ITEM_GAP + yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Skill dropdown local skillOptions = BuildSkillOptions() @@ -371,11 +338,11 @@ function AltSystem:CreateMainFrame() AltSystem.SetSkillIndex = setSkillIndex AltSystem.UpdateSkillWarning = UpdateSkillWarning - yPos = yPos - (LABEL_HEIGHT + LABEL_GAP + 28) - ITEM_GAP + yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Armor label CreateSubLabel(content, "Extra Armor", PADDING, yPos) - yPos = yPos - (LABEL_HEIGHT + LABEL_GAP) + yPos = yPos - 20 -- Armor radio buttons local armorRadios = {} @@ -406,8 +373,8 @@ function AltSystem:CreateMainFrame() yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Section: Modifiers (optional) - CreateSectionHeader(content, "Modifiers (optional)", PADDING_HEADER, yPos) - yPos = yPos - 26 + CreateSectionHeader(content, "Modifiers (optional)", PADDING, yPos) + yPos = yPos - 28 --CreateSubLabel(content, "Label", PADDING, yPos) --yPos = yPos - 22 @@ -483,11 +450,11 @@ function AltSystem:CreateMainFrame() UpdatePetVisual() end) - yPos = yPos - ROW_HEIGHT - ITEM_GAP + yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Item label CreateSubLabel(content, "Item", PADDING, yPos) - yPos = yPos - (LABEL_HEIGHT + LABEL_GAP) + yPos = yPos - 20 -- Item radio buttons local itemRadios = {} @@ -518,8 +485,8 @@ function AltSystem:CreateMainFrame() yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Section: Roll Dice - CreateSectionHeader(content, "Roll Mode", PADDING_HEADER, yPos) - yPos = yPos - 26 + CreateSectionHeader(content, "Roll Dice", PADDING, yPos) + yPos = yPos - 22 -- Announce Roll dropdown (Self Roll + channels) local announceOptions = { { text = "Self Roll" } } @@ -528,7 +495,7 @@ function AltSystem:CreateMainFrame() end local announceContainer, announceDropdown = CreateDropdown( - content, "AltSystemAnnounceDropdown", "", announceOptions, + content, "AltSystemAnnounceDropdown", "Announce Roll", announceOptions, AltSystem.State.announceOptionIndex, function(index) AltSystem.State.announceOptionIndex = index @@ -544,7 +511,7 @@ function AltSystem:CreateMainFrame() announceContainer:SetPoint("TOPLEFT", content, "TOPLEFT", PADDING, yPos) announceContainer:SetWidth(CONTROLS_WIDTH - PADDING * 2) - yPos = yPos - ROW_HEIGHT - ITEM_GAP + yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Roll button local rollLabel = AltSystem.State.rollType == "attack" and "Roll Attack" or "Roll Defense" @@ -565,12 +532,15 @@ function AltSystem:CreateMainFrame() logPanel:SetSize(LOG_WIDTH, tabContentHeight) -- Log header - local logHeader = CreateSectionHeader(logPanel, "Log", 0, -PADDING) + local logHeader = logPanel:CreateFontString(nil, "OVERLAY", "GameFontNormal") + logHeader:SetPoint("TOPLEFT", logPanel, "TOPLEFT", PADDING, -4) + logHeader:SetText("Log") + logHeader:SetTextColor(0.9, 0.75, 0.2) -- Log scroll area background local logBg = CreateFrame("Frame", nil, logPanel, "InsetFrameTemplate") - logBg:SetPoint("TOPLEFT", logPanel, "TOPLEFT", 4, -38) - logBg:SetPoint("BOTTOMRIGHT", logPanel, "BOTTOMRIGHT", -PADDING, 4) + logBg:SetPoint("TOPLEFT", logPanel, "TOPLEFT", 4, -22) + logBg:SetPoint("BOTTOMRIGHT", logPanel, "BOTTOMRIGHT", -4, 4) -- Scroll frame for log entries local scrollFrame = CreateFrame("ScrollFrame", "AltSystemLogScrollFrame", logBg, "UIPanelScrollFrameTemplate") diff --git a/docs/roll_tab_design.png b/docs/roll_tab_design.png old mode 100644 new mode 100755 index c80f5dc..3ebb626 Binary files a/docs/roll_tab_design.png and b/docs/roll_tab_design.png differ