Added an expiremental Vehicle Bar module with an exit button and the pitch buttons

This commit is contained in:
Hendrik Leppkes
2008-11-17 14:46:17 +01:00
parent dbff34e960
commit b5b8dc9479
14 changed files with 184 additions and 0 deletions
+1
View File
@@ -52,6 +52,7 @@ PetBar.lua
StanceBar.lua
MicroMenu.lua
RepXPBar.lua
VehicleBar.lua
## Options ##
Options\Options.xml
+1
View File
@@ -12,4 +12,5 @@
<Script file="PetBar.lua"/>
<Script file="StanceBar.lua"/>
<Script file="RepXPBar.lua"/>
<Script file="VehicleBar.lua"/>
</Ui>
+45
View File
@@ -0,0 +1,45 @@
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
local VehicleBarMod = Bartender4:GetModule("Vehicle")
-- fetch upvalues
local ButtonBar = Bartender4.ButtonBar.prototype
function VehicleBarMod:SetupOptions()
if not self.options then
self.optionobject = ButtonBar:GetOptionObject()
self.optionobject.table.general.args.rows.max = self.button_count
local enabled = {
type = "toggle",
order = 1,
name = L["Enabled"],
desc = L["Enable the Vehicle Bar"],
get = function() return self.db.profile.enabled end,
set = "ToggleModule",
handler = self,
}
self.optionobject:AddElement("general", "enabled", enabled)
self.disabledoptions = {
general = {
type = "group",
name = L["General Settings"],
cmdInline = true,
order = 1,
args = {
enabled = enabled,
}
}
}
self.options = {
order = 30,
type = "group",
name = L["VehicleBar"],
desc = L["Configure the VehicleBar"],
childGroups = "tab",
}
self.optionobject.table.general.args.padding.min = -30
Bartender4:RegisterBarOptions("Vehicle", self.options)
end
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
end
+99
View File
@@ -0,0 +1,99 @@
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
-- register module
local VehicleBarMod = Bartender4:NewModule("Vehicle")
-- fetch upvalues
local ButtonBar = Bartender4.ButtonBar.prototype
-- create prototype information
local VehicleBar = setmetatable({}, {__index = ButtonBar})
local table_insert = table.insert
local defaults = { profile = Bartender4:Merge({
enabled = true,
visibility = {
custom = true,
customdata = "[target=vehicle,exists]show;hide"
},
}, Bartender4.ButtonBar.defaults) }
function VehicleBarMod:OnInitialize()
self.db = Bartender4.db:RegisterNamespace("Vehicle", defaults)
self:SetEnabledState(self.db.profile.enabled)
end
function VehicleBarMod:OnEnable()
if not self.bar then
self.bar = setmetatable(Bartender4.ButtonBar:Create("Vehicle", self.db.profile, L["Vehicle Bar"], true), {__index = VehicleBar})
local buttons = {VehicleMenuBarLeaveButton, VehicleMenuBarPitchUpButton, VehicleMenuBarPitchDownButton}
self.bar.buttons = buttons
VehicleBarMod.button_count = 3
for i,v in pairs(buttons) do
v:SetParent(self.bar)
v:Show()
v.ClearSetPoint = self.bar.ClearSetPoint
end
self.bar:SetScript("OnEvent", self.bar.OnEvent)
self.bar:RegisterEvent("UNIT_ENTERED_VEHICLE")
-- setup button skins
VehicleMenuBarPitchUpButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Pitch-Up]])
VehicleMenuBarPitchUpButton:GetNormalTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
VehicleMenuBarPitchUpButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Pitch-Down]])
VehicleMenuBarPitchUpButton:GetPushedTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
VehicleMenuBarPitchDownButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-PitchDown-Up]])
VehicleMenuBarPitchDownButton:GetNormalTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
VehicleMenuBarPitchDownButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-PitchDown-Down]])
VehicleMenuBarPitchDownButton:GetPushedTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
VehicleMenuBarLeaveButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Exit-Up]])
VehicleMenuBarLeaveButton:GetNormalTexture():SetTexCoord(0.140625, 0.859375, 0.140625, 0.859375)
VehicleMenuBarLeaveButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Exit-Down]])
VehicleMenuBarLeaveButton:GetPushedTexture():SetTexCoord(0.140625, 0.859375, 0.140625, 0.859375)
end
self.bar:Enable()
self:ToggleOptions()
self:ApplyConfig()
end
function VehicleBarMod:ApplyConfig()
self.bar:ApplyConfig(self.db.profile)
end
VehicleBar.button_width = 30
VehicleBar.button_height = 30
VehicleBar.LBFOverride = true
function VehicleBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config)
if not self.config.position then
self:ClearSetPoint("CENTER", -105, 27)
self:SavePosition()
end
self:UpdateButtonLayout()
end
function VehicleBar:OnEvent(event, arg1)
if event == "UNIT_ENTERED_VEHICLE" then
if arg1 == "player" then
self:UpdateButtonVisibility()
end
end
end
function VehicleBar:UpdateButtonVisibility()
if IsVehicleAimAngleAdjustable() then
_G["VehicleMenuBarPitchUpButton"]:Show()
_G["VehicleMenuBarPitchDownButton"]:Show()
else
_G["VehicleMenuBarPitchUpButton"]:Hide()
_G["VehicleMenuBarPitchDownButton"]:Hide()
end
_G["VehicleMenuBarLeaveButton"]:Show()
end
+2
View File
@@ -29,6 +29,7 @@ local files = {
"PetButton.lua",
"RepXPBar.lua",
"StanceBar.lua",
"VehicleBar.lua",
--
"Options/ActionBar.lua",
"Options/ActionBarStates.lua",
@@ -40,6 +41,7 @@ local files = {
"Options/RepXPBar.lua",
"Options/StanceBar.lua",
"Options/Options.lua",
"Options/VehicleBar.lua",
}
--[[
+4
View File
@@ -33,6 +33,7 @@ if not L then return end
-- L["Configure the Micro Menu"] = true
-- L["Configure the Pet Bar"] = true
-- L["Configure the Reputation Bar"] = true
-- L["Configure the VehicleBar"] = true
-- L["Configure the XP Bar"] = true
-- L["Configure the alpha of the bar."] = true
-- L["Configure the padding of the buttons."] = true
@@ -52,6 +53,7 @@ if not L then return end
-- L["Enable the PetBar"] = true
-- L["Enable the Reputation Bar"] = true
-- L["Enable the StanceBar"] = true
-- L["Enable the Vehicle Bar"] = true
-- L["Enable the XP Bar"] = true
-- L["Enable the use of a custom condition, disabling all of the above."] = true
-- L["Enable/Disable the bar."] = true
@@ -129,6 +131,8 @@ if not L then return end
-- L["Toggle the use of the modifier-based self-cast functionality."] = true
-- L["Toggle the use of the right-click self-cast functionality."] = true
-- L["Use Custom Condition"] = true
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
-- L["Visibility"] = true
-- L["XP Bar"] = true
-- L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = true
+4
View File
@@ -33,6 +33,7 @@ L["Configure the Button Tooltip."] = true
L["Configure the Micro Menu"] = true
L["Configure the Pet Bar"] = true
L["Configure the Reputation Bar"] = true
L["Configure the VehicleBar"] = true
L["Configure the XP Bar"] = true
L["Configure the alpha of the bar."] = true
L["Configure the padding of the buttons."] = true
@@ -52,6 +53,7 @@ L["Enable the Micro Menu"] = true
L["Enable the PetBar"] = true
L["Enable the Reputation Bar"] = true
L["Enable the StanceBar"] = true
L["Enable the Vehicle Bar"] = true
L["Enable the XP Bar"] = true
L["Enable the use of a custom condition, disabling all of the above."] = true
L["Enable/Disable the bar."] = true
@@ -129,6 +131,8 @@ L["Toggle the use of the modifier-based focus-cast functionality."] = true
L["Toggle the use of the modifier-based self-cast functionality."] = true
L["Toggle the use of the right-click self-cast functionality."] = true
L["Use Custom Condition"] = true
L["Vehicle Bar"] = true
L["VehicleBar"] = true
L["Visibility"] = true
L["XP Bar"] = true
L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = true
+4
View File
@@ -33,6 +33,7 @@ if not L then return end
-- L["Configure the Micro Menu"] = true
-- L["Configure the Pet Bar"] = true
-- L["Configure the Reputation Bar"] = true
-- L["Configure the VehicleBar"] = true
-- L["Configure the XP Bar"] = true
-- L["Configure the alpha of the bar."] = true
-- L["Configure the padding of the buttons."] = true
@@ -52,6 +53,7 @@ if not L then return end
-- L["Enable the PetBar"] = true
-- L["Enable the Reputation Bar"] = true
-- L["Enable the StanceBar"] = true
-- L["Enable the Vehicle Bar"] = true
-- L["Enable the XP Bar"] = true
-- L["Enable the use of a custom condition, disabling all of the above."] = true
-- L["Enable/Disable the bar."] = true
@@ -129,6 +131,8 @@ if not L then return end
-- L["Toggle the use of the modifier-based self-cast functionality."] = true
-- L["Toggle the use of the right-click self-cast functionality."] = true
-- L["Use Custom Condition"] = true
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
-- L["Visibility"] = true
-- L["XP Bar"] = true
-- L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = true
+4
View File
@@ -33,6 +33,7 @@ if not L then return end
-- L["Configure the Micro Menu"] = true
-- L["Configure the Pet Bar"] = true
-- L["Configure the Reputation Bar"] = true
-- L["Configure the VehicleBar"] = true
-- L["Configure the XP Bar"] = true
-- L["Configure the alpha of the bar."] = true
-- L["Configure the padding of the buttons."] = true
@@ -52,6 +53,7 @@ if not L then return end
-- L["Enable the PetBar"] = true
-- L["Enable the Reputation Bar"] = true
-- L["Enable the StanceBar"] = true
-- L["Enable the Vehicle Bar"] = true
-- L["Enable the XP Bar"] = true
-- L["Enable the use of a custom condition, disabling all of the above."] = true
-- L["Enable/Disable the bar."] = true
@@ -129,6 +131,8 @@ if not L then return end
-- L["Toggle the use of the modifier-based self-cast functionality."] = true
-- L["Toggle the use of the right-click self-cast functionality."] = true
-- L["Use Custom Condition"] = true
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
-- L["Visibility"] = true
-- L["XP Bar"] = true
-- L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = true
+4
View File
@@ -33,6 +33,7 @@ L["Configure the Button Tooltip."] = "Configure la bulle d'aide des boutons."
L["Configure the Micro Menu"] = "Configure le micro menu."
L["Configure the Pet Bar"] = "Configure la barre du familier."
L["Configure the Reputation Bar"] = "Configure la barre de réputation."
-- L["Configure the VehicleBar"] = true
L["Configure the XP Bar"] = "Configure la barre d'expérience."
L["Configure the alpha of the bar."] = "Configure la transparence de la barre."
L["Configure the padding of the buttons."] = "Configure l'espacement entre les boutons."
@@ -52,6 +53,7 @@ L["Enable the Micro Menu"] = "Active le micro menu."
L["Enable the PetBar"] = "Active la barre du familier."
L["Enable the Reputation Bar"] = "Active la barre de réputation."
L["Enable the StanceBar"] = "Active la barre des postures."
-- L["Enable the Vehicle Bar"] = true
L["Enable the XP Bar"] = "Active la barre d'expérience."
L["Enable the use of a custom condition, disabling all of the above."] = "Active l'utilisation d'une condition personnalisée, désactivant tout ce qui se trouve ci-dessus."
L["Enable/Disable the bar."] = "Active/Désactive la barre."
@@ -129,6 +131,8 @@ L["Toggle the use of the modifier-based focus-cast functionality."] = "Utilise o
L["Toggle the use of the modifier-based self-cast functionality."] = "Utilise ou non la fonctionnalité d'auto-ciblage basée sur les modificateurs."
L["Toggle the use of the right-click self-cast functionality."] = "Utilise ou non la fonctionnalité d'auto-ciblage au clic droit."
L["Use Custom Condition"] = "Condition perso."
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
L["Visibility"] = "Visibilité"
L["XP Bar"] = "Barre d'expérience"
L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = "Vous pouvez configurer la barre afin qu'elle soit toujours cachée si vous ne souhaitez y accéder que via des raccourcis claviers."
+4
View File
@@ -33,6 +33,7 @@ L["Configure the Button Tooltip."] = "버튼 툴팁을 설정합니다."
L["Configure the Micro Menu"] = "게임 메뉴 설정"
L["Configure the Pet Bar"] = "소환수 바 설정"
-- L["Configure the Reputation Bar"] = true
-- L["Configure the VehicleBar"] = true
-- L["Configure the XP Bar"] = true
L["Configure the alpha of the bar."] = "바의 투명도를 변경합니다."
L["Configure the padding of the buttons."] = "버튼 간격을 변경합니다."
@@ -52,6 +53,7 @@ L["Enable the Micro Menu"] = "게임 메뉴를 사용합니다."
L["Enable the PetBar"] = "소환수바를 사용합니다."
-- L["Enable the Reputation Bar"] = true
L["Enable the StanceBar"] = "태세바를 사용합니다."
-- L["Enable the Vehicle Bar"] = true
-- L["Enable the XP Bar"] = true
L["Enable the use of a custom condition, disabling all of the above."] = "사용자 설정 상태를 적용하면, 위의 모든 것을 사용할 수 없게 됩니다."
L["Enable/Disable the bar."] = "바를 사용하거나 사용하지 않습니다."
@@ -129,6 +131,8 @@ L["Toggle the button grid."] = "버튼 무늬를 전환합니다."
L["Toggle the use of the modifier-based self-cast functionality."] = "기능키-기반 자신에게 시전 기능의 사용을 전환합니다."
L["Toggle the use of the right-click self-cast functionality."] = "우-클릭시 자신에게 시전 기능의 사용을 전환합니다."
L["Use Custom Condition"] = "사용자 설정 사용"
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
L["Visibility"] = "보이기"
-- L["XP Bar"] = true
L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = "단축키로 지정해서 사용한다면 모든 바를 숨길 수 있습니다."
+4
View File
@@ -33,6 +33,7 @@ L["Configure the Button Tooltip."] = "Отображение всплывающ
L["Configure the Micro Menu"] = "Настройка Микроменю"
L["Configure the Pet Bar"] = "Настройка панели питомца"
-- L["Configure the Reputation Bar"] = true
-- L["Configure the VehicleBar"] = true
-- L["Configure the XP Bar"] = true
L["Configure the alpha of the bar."] = "Настройка степени прозрачности панели (1 - непрозрачная)."
L["Configure the padding of the buttons."] = "Настройка ширины промежутков между кнопками."
@@ -52,6 +53,7 @@ L["Enable the Micro Menu"] = "Включить Микроменю"
L["Enable the PetBar"] = "Включить панель питомца"
-- L["Enable the Reputation Bar"] = true
L["Enable the StanceBar"] = "Включить панель стоек"
-- L["Enable the Vehicle Bar"] = true
-- L["Enable the XP Bar"] = true
-- L["Enable the use of a custom condition, disabling all of the above."] = true
L["Enable/Disable the bar."] = "Включить/Отключить панель"
@@ -129,6 +131,8 @@ L["Toggle the button grid."] = "Переключение отображения
L["Toggle the use of the modifier-based self-cast functionality."] = "Переключение использования функции Чтение на себя по умолчанию."
L["Toggle the use of the right-click self-cast functionality."] = "Переключение использования функции ПКМ Чтение на себя."
-- L["Use Custom Condition"] = true
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
-- L["Visibility"] = true
-- L["XP Bar"] = true
-- L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = true
+4
View File
@@ -33,6 +33,7 @@ L["Configure the Button Tooltip."] = "设置按钮的鼠标提示。"
L["Configure the Micro Menu"] = "配置微型主菜单"
L["Configure the Pet Bar"] = "配置宠物栏"
L["Configure the Reputation Bar"] = "配置声望条"
-- L["Configure the VehicleBar"] = true
L["Configure the XP Bar"] = "配置经验条"
L["Configure the alpha of the bar."] = "设置动作条的透明度。"
L["Configure the padding of the buttons."] = "配置按钮之间的距离"
@@ -52,6 +53,7 @@ L["Enable the Micro Menu"] = "开启微型主菜单"
L["Enable the PetBar"] = "开启宠物栏"
L["Enable the Reputation Bar"] = "启用声望条"
L["Enable the StanceBar"] = "开启姿态栏"
-- L["Enable the Vehicle Bar"] = true
L["Enable the XP Bar"] = "启用经验条"
L["Enable the use of a custom condition, disabling all of the above."] = "启用自定义条件, 禁用以上所有设置."
L["Enable/Disable the bar."] = "开启/关闭 该动作条。"
@@ -129,6 +131,8 @@ L["Toggle the use of the modifier-based focus-cast functionality."] = "关闭/
L["Toggle the use of the modifier-based self-cast functionality."] = "关闭/开启 自我施法功能。"
L["Toggle the use of the right-click self-cast functionality."] = "关闭/开启 使用右键点击对自己施法功能。"
L["Use Custom Condition"] = "使用自定义条件"
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
L["Visibility"] = "垂直"
L["XP Bar"] = "经验条"
L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = "你能设置动作条一直隐藏,仅用按键绑定来使用动作条."
+4
View File
@@ -33,6 +33,7 @@ L["Configure the Button Tooltip."] = "設定按紐說明提示"
L["Configure the Micro Menu"] = "設定微型按鈕"
L["Configure the Pet Bar"] = "設定寵物列"
-- L["Configure the Reputation Bar"] = true
-- L["Configure the VehicleBar"] = true
-- L["Configure the XP Bar"] = true
L["Configure the alpha of the bar."] = "設定動作條透明度"
L["Configure the padding of the buttons."] = "設定按鈕間距"
@@ -52,6 +53,7 @@ L["Enable the Micro Menu"] = "開啟微型選單"
L["Enable the PetBar"] = "開啟寵物列"
-- L["Enable the Reputation Bar"] = true
L["Enable the StanceBar"] = "開啟姿勢列"
-- L["Enable the Vehicle Bar"] = true
-- L["Enable the XP Bar"] = true
-- L["Enable the use of a custom condition, disabling all of the above."] = true
L["Enable/Disable the bar."] = "開啟/關閉動作條"
@@ -129,6 +131,8 @@ L["Toggle the button grid."] = "顯示空白按鈕"
L["Toggle the use of the modifier-based self-cast functionality."] = "切換使用自我施法功能"
L["Toggle the use of the right-click self-cast functionality."] = "切換使用右鍵自我施法功能"
-- L["Use Custom Condition"] = true
-- L["Vehicle Bar"] = true
-- L["VehicleBar"] = true
-- L["Visibility"] = true
-- L["XP Bar"] = true
-- L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."] = true