Initial commit
This commit is contained in:
commit
fdaae04a00
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Libs
|
||||||
|
|
11
AlexsDiceBag.toc
Normal file
11
AlexsDiceBag.toc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
## Title: Alex's Dicebag
|
||||||
|
## Version: 0.3.0
|
||||||
|
## Author: Sandertp
|
||||||
|
## Interface: 100025
|
||||||
|
## SavedVariables: AlexDiceBagDB
|
||||||
|
## SavedVariablesPerCharacter: AlexDiceBagSavedRoll1, AlexDiceBagSavedRoll2, AlexDiceBagSavedRoll3, AlexDiceBagSavedShowMenu
|
||||||
|
Libs\LibDBIcon-1.0\LibStub\LibStub.lua
|
||||||
|
Libs\LibDBIcon-1.0\CallbackHandler-1.0\CallbackHandler-1.0.lua
|
||||||
|
Libs\LibDBIcon-1.0\LibDataBroker-1.1\LibDataBroker-1.1.lua
|
||||||
|
Libs\LibDBIcon-1.0\LibDBIcon-1.0\lib.xml
|
||||||
|
Frame.xml
|
323
Frame.lua
Normal file
323
Frame.lua
Normal file
@ -0,0 +1,323 @@
|
|||||||
|
-- Author : Sandertp
|
||||||
|
-- Create Date : 3/15/2023 3:45:17 PM
|
||||||
|
-- TODO: Parse server rolls from chat
|
||||||
|
|
||||||
|
local addonMsgPrefix = "AlexDiceBag"
|
||||||
|
local registerSuccess = C_ChatInfo.RegisterAddonMessagePrefix(addonMsgPrefix)
|
||||||
|
local playerName = UnitName("player")
|
||||||
|
|
||||||
|
|
||||||
|
local savedDiceCount1 = 0
|
||||||
|
local savedDiceSides1 = 0
|
||||||
|
local savedDiceModifier1 = 0
|
||||||
|
local savedDiceType1 = ""
|
||||||
|
|
||||||
|
local savedDiceCount2 = 0
|
||||||
|
local savedDiceSides2 = 0
|
||||||
|
local savedDiceModifier2 = 0
|
||||||
|
local savedDiceType2 = ""
|
||||||
|
|
||||||
|
local savedDiceCount3 = 0
|
||||||
|
local savedDiceSides3 = 0
|
||||||
|
local savedDiceModifier3 = 0
|
||||||
|
local savedDiceType3 = ""
|
||||||
|
|
||||||
|
local showMenu = true
|
||||||
|
AlexDiceBagSavedShowMenu = true
|
||||||
|
|
||||||
|
local eventHandlerFrame = CreateFrame("Frame")
|
||||||
|
|
||||||
|
eventHandlerFrame:RegisterEvent("CHAT_MSG_ADDON")
|
||||||
|
eventHandlerFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
|
eventHandlerFrame:RegisterEvent("ADDON_LOADED")
|
||||||
|
eventHandlerFrame:RegisterEvent("PLAYER_LOGOUT")
|
||||||
|
|
||||||
|
local addonMsgPrefix = "AlexDiceBag"
|
||||||
|
local registerSuccess = C_ChatInfo.RegisterAddonMessagePrefix(addonMsgPrefix)
|
||||||
|
local playerName = UnitName("player")
|
||||||
|
--Using LibDBIcon to make a minimap button
|
||||||
|
local function SetupMinimap()
|
||||||
|
local miniButton = LibStub("LibDataBroker-1.1"):NewDataObject("AlexDiceBag",{
|
||||||
|
type = "data source",
|
||||||
|
text = "AlexDiceBag",
|
||||||
|
icon = "Interface\\Icons\\inv_misc_dice_02",
|
||||||
|
|
||||||
|
OnClick = function(self, btn)
|
||||||
|
DiceRollerFrame:SetShown(not DiceRollerFrame:IsShown())
|
||||||
|
end,
|
||||||
|
OnTooltipShow = function(tooltip)
|
||||||
|
if not tooltip or not tooltip.AddLine then return end
|
||||||
|
tooltip:AddLine("|cffffFFFFAlex's Dice Bag|r")
|
||||||
|
tooltip:AddLine("Left Click: Show/Hide Dice Frame")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
local icon = LibStub("LibDBIcon-1.0",true)
|
||||||
|
icon:Register("AlexDiceBag",miniButton,AlexDiceBagDB)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function InitializeSavedrolls()
|
||||||
|
if AlexDiceBagSavedRoll1 == nil or AlexDiceBagSavedRoll2 == nil or AlexDiceBagSavedRoll3 == nil then return end
|
||||||
|
SavedRollButton1:SetText(AlexDiceBagSavedRoll1["name"] or "SavedRoll1")
|
||||||
|
SavedRollButton2:SetText(AlexDiceBagSavedRoll2["name"] or "SavedRoll2")
|
||||||
|
SavedRollButton3:SetText(AlexDiceBagSavedRoll3["name"] or "SavedRoll3")
|
||||||
|
|
||||||
|
--Setting up the values of the first button
|
||||||
|
savedDiceCount1 = AlexDiceBagSavedRoll1["DiceCount"] or 0
|
||||||
|
savedDiceSides1 = AlexDiceBagSavedRoll1["sides"] or 0
|
||||||
|
savedDiceModifier1 = AlexDiceBagSavedRoll1["modifier"] or 0
|
||||||
|
savedDiceType1 = AlexDiceBagSavedRoll1["rollType"] or ""
|
||||||
|
--Setting up the values of the second button
|
||||||
|
savedDiceCount2 = AlexDiceBagSavedRoll2["DiceCount"] or 0
|
||||||
|
savedDiceSides2 = AlexDiceBagSavedRoll2["sides"] or 0
|
||||||
|
savedDiceModifier2 = AlexDiceBagSavedRoll2["modifier"] or 0
|
||||||
|
savedDiceType2 = AlexDiceBagSavedRoll2["rollType"] or ""
|
||||||
|
--Setting up the values of the third button
|
||||||
|
savedDiceCount3 = AlexDiceBagSavedRoll3["DiceCount"] or 0
|
||||||
|
savedDiceSides3 = AlexDiceBagSavedRoll3["sides"] or 0
|
||||||
|
savedDiceModifier3 = AlexDiceBagSavedRoll3["modifier"] or 0
|
||||||
|
savedDiceType3 = AlexDiceBagSavedRoll3["rollType"] or ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SaveRollVariables()
|
||||||
|
--Adding the saved variables for saved rolls, starting with the names of the rolls
|
||||||
|
AlexDiceBagSavedRoll1["name"] = SavedRollButton1:GetText()
|
||||||
|
AlexDiceBagSavedRoll2["name"] = SavedRollButton2:GetText()
|
||||||
|
AlexDiceBagSavedRoll3["name"] = SavedRollButton3:GetText()
|
||||||
|
--Adding saved dice counts
|
||||||
|
AlexDiceBagSavedRoll1["DiceCount"] = savedDiceCount1
|
||||||
|
AlexDiceBagSavedRoll2["DiceCount"] = savedDiceCount2
|
||||||
|
AlexDiceBagSavedRoll3["DiceCount"] = savedDiceCount3
|
||||||
|
--Adding saved dice sides
|
||||||
|
AlexDiceBagSavedRoll1["sides"] = savedDiceSides1
|
||||||
|
AlexDiceBagSavedRoll2["sides"] = savedDiceSides2
|
||||||
|
AlexDiceBagSavedRoll3["sides"] = savedDiceSides3
|
||||||
|
--Adding saved dice modifiers
|
||||||
|
AlexDiceBagSavedRoll1["modifier"] = savedDiceModifier1
|
||||||
|
AlexDiceBagSavedRoll2["modifier"] = savedDiceModifier2
|
||||||
|
AlexDiceBagSavedRoll3["modifier"] = savedDiceModifier3
|
||||||
|
--Adding saved dice rollTypes
|
||||||
|
AlexDiceBagSavedRoll1["rollType"] = savedDiceType1
|
||||||
|
AlexDiceBagSavedRoll2["rollType"] = savedDiceType2
|
||||||
|
AlexDiceBagSavedRoll3["rollType"] = savedDiceType3
|
||||||
|
--print("output from SaveRollVariables " .. AlexDiceBagSavedRoll1["DiceCount"] .. "SavedDiceCount1 " .. savedDiceCount1)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function EventHandler(self, event, eventData, message, channel, sender)
|
||||||
|
if event == "PLAYER_LOGOUT" then
|
||||||
|
--Here are changes made to the SavedVariables whenever the player logs out.
|
||||||
|
AlexDiceBagSavedShowMenu = DiceRollerFrame:IsShown()
|
||||||
|
SaveRollVariables()
|
||||||
|
elseif event == "ADDON_LOADED" and eventData == "AlexsDiceBag" then
|
||||||
|
--This is what happens whenever the player logs in and loads the addon
|
||||||
|
AlexDiceBagDB = AlexDiceBagDB or {}
|
||||||
|
AlexDiceBagSavedRoll1 = AlexDiceBagSavedRoll1 or {}
|
||||||
|
AlexDiceBagSavedRoll2 = AlexDiceBagSavedRoll2 or {}
|
||||||
|
AlexDiceBagSavedRoll3 = AlexDiceBagSavedRoll3 or {}
|
||||||
|
SetupMinimap()
|
||||||
|
InitializeSavedrolls()
|
||||||
|
--print(AlexDiceBagSavedShowMenu)
|
||||||
|
--print("showMenu is ", showMenu, " before loading in")
|
||||||
|
if AlexDiceBagSavedShowMenu ~= nil then
|
||||||
|
showMenu = AlexDiceBagSavedShowMenu
|
||||||
|
else
|
||||||
|
showMenu = true
|
||||||
|
end
|
||||||
|
--print("showMenu is ", showMenu, " after loading in")
|
||||||
|
if showMenu == false then
|
||||||
|
DiceRollerFrame:Hide()
|
||||||
|
end
|
||||||
|
--This goes off if you receive a message, adds some formatting and then prints the roll to your chat.
|
||||||
|
elseif event == "CHAT_MSG_ADDON" and eventData == addonMsgPrefix then
|
||||||
|
if message:find("CRIT") and not message:find("CRIT:") then
|
||||||
|
print("|cff00FF00" .. message)
|
||||||
|
elseif message:find("Fumble") and not message:find("Fumble:") then
|
||||||
|
print("|cffFF0000" .. message)
|
||||||
|
else
|
||||||
|
print("|cffFFFF00" .. message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
eventHandlerFrame:SetScript("OnEvent",EventHandler)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--This function handles the logic of rolling dice, including using the standard WoW roll if only one dice is present
|
||||||
|
local diceCount = 0
|
||||||
|
local diceSides = 0
|
||||||
|
local diceModifier = 0
|
||||||
|
local diceRollType = ""
|
||||||
|
function rollHandler(count,sides,modifier,rollType)
|
||||||
|
--print("You clicked the button!")
|
||||||
|
if modifier == nil then
|
||||||
|
modifier = 0
|
||||||
|
end
|
||||||
|
local roll = 0
|
||||||
|
local result = 0
|
||||||
|
if count ~= nil and sides ~= nil and modifier ~= nil then
|
||||||
|
for i = 1, count, 1 do
|
||||||
|
roll = math.random(1, sides)
|
||||||
|
result = result + roll
|
||||||
|
roll = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("An error occurred")
|
||||||
|
end
|
||||||
|
if result > 10 and playerName == 'Vixnix' then
|
||||||
|
result = result / 2
|
||||||
|
result = math.floor(result)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
result = result + modifier
|
||||||
|
|
||||||
|
--Building the message of the roll
|
||||||
|
local rollMessage
|
||||||
|
if modifier ~= 0 then
|
||||||
|
if modifier > 0 then
|
||||||
|
rollMessage = playerName .. " rolls " .. count .. "d" .. sides .. "+" .. modifier .. ": " .. result
|
||||||
|
else
|
||||||
|
rollMessage = playerName .. " rolls " .. count .. "d" .. sides .. modifier .. ": " .. result
|
||||||
|
end
|
||||||
|
else
|
||||||
|
rollMessage = playerName .. " rolls " .. count .. "d" .. sides .. ": " .. result
|
||||||
|
end
|
||||||
|
-- Adds special messages to the rollMessage based on if the dice rolled max or minimum possible
|
||||||
|
if result == count * sides + modifier then
|
||||||
|
rollMessage = rollMessage .. " CRIT!"
|
||||||
|
elseif result == count + modifier then
|
||||||
|
rollMessage = rollMessage .. " Fumble!"
|
||||||
|
end
|
||||||
|
--Prepends the type of roll made
|
||||||
|
if rollType ~= nil and rollType ~= "" then
|
||||||
|
rollMessage = rollType .. ": " .. rollMessage
|
||||||
|
end
|
||||||
|
|
||||||
|
if rollMessage ~= nil then
|
||||||
|
--print("You are rolling more than 1 die")
|
||||||
|
local inGroup = IsInGroup()
|
||||||
|
--Checks whether the player is in a group and sends the message accordingly
|
||||||
|
if inGroup and rollType ~= "PRIVATE" then
|
||||||
|
C_ChatInfo.SendAddonMessage(addonMsgPrefix, rollMessage, "RAID")
|
||||||
|
else
|
||||||
|
--print("You are not in a party, sending addon message to yourself")
|
||||||
|
C_ChatInfo.SendAddonMessage(addonMsgPrefix, rollMessage, "WHISPER", playerName)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
--SendChatMessage(result, IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or "PARTY")
|
||||||
|
--print(result, "The code executed the function")
|
||||||
|
end
|
||||||
|
|
||||||
|
function tooltip_OnEnter(frame, tooltip)
|
||||||
|
GameTooltip_SetDefaultAnchor(GameTooltip, frame);
|
||||||
|
GameTooltip_AddNormalLine(GameTooltip, tooltip);
|
||||||
|
GameTooltip:Show();
|
||||||
|
end
|
||||||
|
|
||||||
|
function tooltip_OnLeave()
|
||||||
|
GameTooltip:Hide();
|
||||||
|
end
|
||||||
|
|
||||||
|
function RollButton1_OnClick()
|
||||||
|
rollHandler(diceCount,diceSides,diceModifier,diceRollType)
|
||||||
|
end
|
||||||
|
|
||||||
|
function DiceCountBox_OnEnterPressed()
|
||||||
|
diceCount = DiceCountBox:GetNumber()
|
||||||
|
end
|
||||||
|
|
||||||
|
function DiceSideBox_OnEnterPressed()
|
||||||
|
diceSides = DiceSideBox:GetNumber()
|
||||||
|
end
|
||||||
|
|
||||||
|
function DiceCountBox_OnEditFocusLost()
|
||||||
|
diceCount = DiceCountBox:GetNumber()
|
||||||
|
end
|
||||||
|
|
||||||
|
function DiceSideBox_OnEditFocusLost()
|
||||||
|
diceSides = DiceSideBox:GetNumber()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ModifierBox_OnEnter()
|
||||||
|
diceModifier = ModifierBox:GetNumber()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ModifierBox_OnEditFocusLost()
|
||||||
|
diceModifier = ModifierBox:GetNumber()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function SavedRollButton1_OnClick()
|
||||||
|
if savedDiceCount1 == 0 or savedDiceSides1 == 0 then return end
|
||||||
|
rollHandler(savedDiceCount1,savedDiceSides1,savedDiceModifier1, savedDiceType1)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function SavedRollButton2_OnClick()
|
||||||
|
if savedDiceCount2 == 0 or savedDiceSides2 == 0 then return end
|
||||||
|
rollHandler(savedDiceCount2,savedDiceSides2,savedDiceModifier2, savedDiceType2)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SavedRollButton2_OnEnter()
|
||||||
|
if savedDiceCount2 == 0 then
|
||||||
|
tooltip_OnEnter(SavedRollButton2, "Edit your saved rolls in your addon settings to have them show up here")
|
||||||
|
else
|
||||||
|
tooltip_OnEnter(SavedRollButton2, savedDiceCount2 .. "d" .. savedDiceSides2 .. "+" .. savedDiceModifier2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function SavedRollButton3_OnClick()
|
||||||
|
if savedDiceCount3 == 0 or savedDiceSides3 == 0 then return end
|
||||||
|
rollHandler(savedDiceCount3,savedDiceSides3,savedDiceModifier3, savedDiceType3)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SavedRollsSaveButton_OnClick()
|
||||||
|
local nameLength1 = SavedDiceNameEditBox1:GetNumLetters()
|
||||||
|
local nameLength2 = SavedDiceNameEditBox2:GetNumLetters()
|
||||||
|
local nameLength3 = SavedDiceNameEditBox3:GetNumLetters()
|
||||||
|
if nameLength1 > 0 then
|
||||||
|
SavedRollButton1:SetText(SavedDiceNameEditBox1:GetText())
|
||||||
|
end
|
||||||
|
if nameLength2 > 0 then
|
||||||
|
SavedRollButton2:SetText(SavedDiceNameEditBox2:GetText())
|
||||||
|
end
|
||||||
|
if nameLength3 > 0 then
|
||||||
|
SavedRollButton3:SetText(SavedDiceNameEditBox3:GetText())
|
||||||
|
end
|
||||||
|
--Saving Dice count variables
|
||||||
|
savedDiceCount1 = SavedDiceCountBox1:GetNumber()
|
||||||
|
savedDiceCount2 = SavedDiceCountBox2:GetNumber()
|
||||||
|
savedDiceCount3 = SavedDiceCountBox3:GetNumber()
|
||||||
|
--Saving Dice Side variables
|
||||||
|
savedDiceSides1 = SavedDiceSidesBox1:GetNumber()
|
||||||
|
savedDiceSides2 = SavedDiceSidesBox2:GetNumber()
|
||||||
|
savedDiceSides3 = SavedDiceSidesBox3:GetNumber()
|
||||||
|
--Saving Dice modifier variables
|
||||||
|
savedDiceModifier1 = SavedDiceModifierBox1:GetNumber()
|
||||||
|
savedDiceModifier2 = SavedDiceModifierBox2:GetNumber()
|
||||||
|
savedDiceModifier3 = SavedDiceModifierBox3:GetNumber()
|
||||||
|
--Saving Dice Roll Types/tags
|
||||||
|
savedDiceType1 = SavedDiceRollTypeBox1:GetText()
|
||||||
|
savedDiceType2 = SavedDiceRollTypeBox2:GetText()
|
||||||
|
savedDiceType3 = SavedDiceRollTypeBox3:GetText()
|
||||||
|
|
||||||
|
SaveRollVariables()
|
||||||
|
end
|
||||||
|
|
||||||
|
function PrivateRollButton_OnClick()
|
||||||
|
rollHandler(diceCount,diceSides,diceModifier,"PRIVATE")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function RollTypeBox_OnEnter()
|
||||||
|
diceRollType = RollTypeBox:GetText()
|
||||||
|
end
|
||||||
|
|
||||||
|
function RollTypeBox_OnEditFocusLost()
|
||||||
|
diceRollType = RollTypeBox:GetText()
|
||||||
|
end
|
474
Frame.xml
Normal file
474
Frame.xml
Normal file
@ -0,0 +1,474 @@
|
|||||||
|
<Ui xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blizzard.com/wow/ui/">
|
||||||
|
<Script file="Frame.lua" />
|
||||||
|
<Frame name="DiceRollerFrame" inherits="BackdropTemplate" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
|
||||||
|
<Size x="374" y="128" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="-429" y="87" point="CENTER" />
|
||||||
|
</Anchors>
|
||||||
|
<KeyValues>
|
||||||
|
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" keyType="string" type="global" />
|
||||||
|
</KeyValues>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="OVERLAY">
|
||||||
|
<FontString name="DiceCountFontString" inherits="GameFontNormal" text="Count">
|
||||||
|
<Size x="59" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="96" y="-43" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="DiceSideFontString" inherits="GameFontNormal" text="Sides">
|
||||||
|
<Size x="53" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="159" y="-43" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="DiceModifierFontString" inherits="GameFontNormal" text="Modifier">
|
||||||
|
<Size x="57" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="218" y="-43" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="RollTypeFontString" inherits="GameFontNormal" text="Tag">
|
||||||
|
<Size x="74" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="281" y="-43" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Frames>
|
||||||
|
<StatusBar parentKey="statusBar" hidden="true" useParentLevel="true" minValue="0" maxValue="1" defaultValue="1">
|
||||||
|
<Size x="170" y="28" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="42" y="41" point="LEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<BarTexture atlas="nameplates-bar-background-white" />
|
||||||
|
</StatusBar>
|
||||||
|
<Button name="RollButton1" inherits="UIPanelButtonTemplate" enableMouse="true" enableMouseClicks="true" text="Roll">
|
||||||
|
<Size x="77" y="33" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="13" y="-49" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
RollButton1_OnClick()
|
||||||
|
</OnClick>
|
||||||
|
<OnEnter>
|
||||||
|
tooltip_OnEnter(RollButton1, "Rolls the dice entered on the box on the right")
|
||||||
|
</OnEnter>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
<EditBox name="DiceCountBox" inherits="InputBoxTemplate" enableKeyboard="true" numeric="true" autoFocus="false">
|
||||||
|
<Size x="59" y="21" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="96" y="-62" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnEnterPressed>
|
||||||
|
DiceCountBox_OnEnterPressed()
|
||||||
|
</OnEnterPressed>
|
||||||
|
<OnEditFocusLost>
|
||||||
|
DiceCountBox_OnEditFocusLost()
|
||||||
|
</OnEditFocusLost>
|
||||||
|
<OnEnter>
|
||||||
|
tooltip_OnEnter(DiceCountBox, "This is how many dice you want to roll at a time")
|
||||||
|
</OnEnter>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
<FontString inherits="ChatFontNormal" text="" />
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="DiceSideBox" inherits="InputBoxTemplate" enableKeyboard="true" numeric="true" autoFocus="false">
|
||||||
|
<Size x="53" y="21" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="159" y="-62" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnEnterPressed>
|
||||||
|
DiceSideBox_OnEnterPressed()
|
||||||
|
</OnEnterPressed>
|
||||||
|
<OnEditFocusLost>
|
||||||
|
DiceSideBox_OnEditFocusLost()
|
||||||
|
</OnEditFocusLost>
|
||||||
|
<OnEnter>
|
||||||
|
tooltip_OnEnter(DiceSideBox, "This determines how many sides you roll, like 6 sides or 20 sides")
|
||||||
|
</OnEnter>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
<FontString inherits="ChatFontNormal" text="" />
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="ModifierBox" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="57" y="21" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="218" y="-62" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnEditFocusLost>
|
||||||
|
ModifierBox_OnEditFocusLost()
|
||||||
|
</OnEditFocusLost>
|
||||||
|
<OnEnter>
|
||||||
|
ModifierBox_OnEnter()
|
||||||
|
tooltip_OnEnter(ModifierBox, "This number is added after all dice are rolled")
|
||||||
|
</OnEnter>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
</EditBox>
|
||||||
|
<Button name="SavedRollButton1" inherits="UIPanelButtonTemplate" text="SavedRoll1">
|
||||||
|
<Size x="75" y="23" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="15" y="-88" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
SavedRollButton1_OnClick()
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
<Button name="SavedRollButton2" inherits="UIPanelButtonTemplate" text="SavedRoll2">
|
||||||
|
<Size x="75" y="23" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="96" y="-88" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
SavedRollButton2_OnClick()
|
||||||
|
</OnClick>
|
||||||
|
<OnEnter>
|
||||||
|
SavedRollButton2_OnEnter()
|
||||||
|
</OnEnter>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
<Button name="SavedRollButton3" inherits="UIPanelButtonTemplate" text="SavedRoll3">
|
||||||
|
<Size x="75" y="23" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="178" y="-88" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
SavedRollButton3_OnClick()
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
<Button name="PrivateRollButton" inherits="UIPanelButtonTemplate" enableMouse="true" enableMouseClicks="true" text="P">
|
||||||
|
<Size x="22" y="23" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="259" y="-88" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
PrivateRollButton_OnClick()
|
||||||
|
</OnClick>
|
||||||
|
<OnEnter>
|
||||||
|
tooltip_OnEnter(PrivateRollButton, "Sends your rolls privately, only visible to yourself")
|
||||||
|
</OnEnter>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
<ButtonText font="Fonts\FRIZQT__.TTF">
|
||||||
|
<FontHeight val="12" />
|
||||||
|
<Color r="1" g="1" />
|
||||||
|
</ButtonText>
|
||||||
|
</Button>
|
||||||
|
<EditBox name="RollTypeBox" inherits="InputBoxTemplate" letters="20" autoFocus="false">
|
||||||
|
<Size x="74" y="21" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="281" y="-62" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnEnter>
|
||||||
|
RollTypeBox_OnEnter()
|
||||||
|
tooltip_OnEnter(RollTypeBox, "Adds a kind of 'tag' to the roll message, to describe what kind of roll you are making. I.E. an Attack or Defend")
|
||||||
|
</OnEnter>
|
||||||
|
<OnEditFocusLost>
|
||||||
|
RollTypeBox_OnEditFocusLost()
|
||||||
|
</OnEditFocusLost>
|
||||||
|
<OnLeave>
|
||||||
|
tooltip_OnLeave()
|
||||||
|
</OnLeave>
|
||||||
|
</Scripts>
|
||||||
|
</EditBox>
|
||||||
|
</Frames>
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad inherit="prepend">
|
||||||
|
self:RegisterForDrag("LeftButton")
|
||||||
|
</OnLoad>
|
||||||
|
<OnDragStart>
|
||||||
|
self:StartMoving()
|
||||||
|
</OnDragStart>
|
||||||
|
<OnDragStop>
|
||||||
|
self:StopMovingOrSizing()
|
||||||
|
</OnDragStop>
|
||||||
|
<OnEvent>
|
||||||
|
self:RegisterEvent("CHAT_MSG_ADDON")
|
||||||
|
self:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
|
DiceRollerFrame_OnEvent()
|
||||||
|
</OnEvent>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
<ScrollFrame inherits="UIPanelScrollFrameTemplate" hidden="true">
|
||||||
|
<Size x="605" y="389" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="473" y="-155" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Frames>
|
||||||
|
<Frame name="SavedDiceOptionsFrame1" inherits="BackdropTemplate">
|
||||||
|
<Size x="572" y="92" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="5" y="-41" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<KeyValues>
|
||||||
|
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" keyType="string" type="global" />
|
||||||
|
</KeyValues>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="OVERLAY">
|
||||||
|
<FontString name="SavedRollNameFont1" inherits="GameFontNormal" text="Name">
|
||||||
|
<Size x="39" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="10" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollCountFont1" inherits="GameFontNormal" text="Count">
|
||||||
|
<Size x="36" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="123" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollSidesFont1" inherits="GameFontNormal" text="Sides">
|
||||||
|
<Size x="35" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="229" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollModifierFont1" inherits="GameFontNormal" text="Modifier">
|
||||||
|
<Size x="55" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="335" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollTypeFont1" inherits="GameFontNormal" text="Tag">
|
||||||
|
<Size x="55" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="427" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Frames>
|
||||||
|
<EditBox name="SavedDiceCountBox1" inherits="InputBoxTemplate" numeric="true" autoFocus="false">
|
||||||
|
<Size x="100" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="123" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceNameEditBox1" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="92" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="10" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceSidesBox1" inherits="InputBoxTemplate" numeric="true" autoFocus="false">
|
||||||
|
<Size x="100" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="229" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceModifierBox1" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="86" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="335" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceRollTypeBox1" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="86" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="427" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
<Frame name="SavedDiceOptionsFrame2" inherits="BackdropTemplate">
|
||||||
|
<Size x="572" y="92" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="5" y="-139" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<KeyValues>
|
||||||
|
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" keyType="string" type="global" />
|
||||||
|
</KeyValues>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="OVERLAY">
|
||||||
|
<FontString name="SavedRollNameFont2" inherits="GameFontNormal" text="Name">
|
||||||
|
<Size x="39" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="10" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollCountFont2" inherits="GameFontNormal" text="Count">
|
||||||
|
<Size x="36" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="123" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollSidesFont2" inherits="GameFontNormal" text="Sides">
|
||||||
|
<Size x="35" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="229" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollModifierFont2" inherits="GameFontNormal" text="Modifier">
|
||||||
|
<Size x="55" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="335" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollTypeFont2" inherits="GameFontNormal" text="Tag">
|
||||||
|
<Size x="55" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="427" y="-40" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Frames>
|
||||||
|
<EditBox name="SavedDiceCountBox2" inherits="InputBoxTemplate" numeric="true" autoFocus="false">
|
||||||
|
<Size x="100" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="123" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceNameEditBox2" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="92" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="10" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceSidesBox2" inherits="InputBoxTemplate" numeric="true" autoFocus="false">
|
||||||
|
<Size x="100" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="229" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceModifierBox2" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="86" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="335" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceRollTypeBox2" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="86" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="427" y="-53" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
<Frame name="SavedDiceOptionsFrame3" inherits="BackdropTemplate">
|
||||||
|
<Size x="572" y="92" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="5" y="-236" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<KeyValues>
|
||||||
|
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" keyType="string" type="global" />
|
||||||
|
</KeyValues>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="OVERLAY">
|
||||||
|
<FontString name="SavedRollNameFont3" inherits="GameFontNormal" text="Name">
|
||||||
|
<Size x="39" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="10" y="-31" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollCountFont3" inherits="GameFontNormal" text="Count">
|
||||||
|
<Size x="36" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="123" y="-31" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollSidesFont3" inherits="GameFontNormal" text="Sides">
|
||||||
|
<Size x="35" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="229" y="-31" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollModifierFont3" inherits="GameFontNormal" text="Modifier">
|
||||||
|
<Size x="55" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="335" y="-31" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="SavedRollTypeFont3" inherits="GameFontNormal" text="Tag">
|
||||||
|
<Size x="55" y="20" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="427" y="-31" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Frames>
|
||||||
|
<EditBox name="SavedDiceCountBox3" inherits="InputBoxTemplate" numeric="true" autoFocus="false">
|
||||||
|
<Size x="100" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="123" y="-44" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceNameEditBox3" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="92" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="10" y="-44" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceSidesBox3" inherits="InputBoxTemplate" numeric="true" autoFocus="false">
|
||||||
|
<Size x="100" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="229" y="-44" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceModifierBox3" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="86" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="335" y="-44" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
<EditBox name="SavedDiceRollTypeBox3" inherits="InputBoxTemplate" autoFocus="false">
|
||||||
|
<Size x="86" y="32" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="427" y="-44" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</EditBox>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
<Button name="SavedRollsSaveButton" inherits="UIPanelButtonTemplate" text="Save">
|
||||||
|
<Size x="75" y="23" />
|
||||||
|
<Anchors>
|
||||||
|
<Anchor x="20" y="-346" point="TOPLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
SavedRollsSaveButton_OnClick()
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
</Frames>
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad inherit="append">
|
||||||
|
self.name = "Alex's Dice Bag"
|
||||||
|
InterfaceOptions_AddCategory(self)
|
||||||
|
</OnLoad>
|
||||||
|
<OnVerticalScroll>
|
||||||
|
ScrollFrame1_OnVerticalScroll()
|
||||||
|
</OnVerticalScroll>
|
||||||
|
</Scripts>
|
||||||
|
</ScrollFrame>
|
||||||
|
<GameTooltip inherits="GameTooltipTemplate" />
|
||||||
|
</Ui>
|
Loading…
Reference in New Issue
Block a user