Compare commits
2 commits
09ed752532
...
7a12abeda3
Author | SHA1 | Date | |
---|---|---|---|
7a12abeda3 | |||
d90715c2cc |
11 changed files with 153 additions and 244 deletions
|
@ -15,6 +15,12 @@ local function CreateCzechFont(frame, name, size, flags)
|
||||||
end
|
end
|
||||||
addon.API.CreateCzechFont = CreateCzechFont
|
addon.API.CreateCzechFont = CreateCzechFont
|
||||||
|
|
||||||
|
local function UpdateCzechFont(FontString, name, size)
|
||||||
|
local _, _, flags = FontString:GetFont()
|
||||||
|
FontString:SetFont(FontPath .. name, size, flags)
|
||||||
|
end
|
||||||
|
addon.API.UpdateCzechFont = UpdateCzechFont
|
||||||
|
|
||||||
local function GetFontContainer()
|
local function GetFontContainer()
|
||||||
local container = Settings.CreateControlTextContainer()
|
local container = Settings.CreateControlTextContainer()
|
||||||
container:Add("morpheus_cz.ttf", "Morpheus (cz)")
|
container:Add("morpheus_cz.ttf", "Morpheus (cz)")
|
||||||
|
|
|
@ -110,6 +110,10 @@ local function InitSpeeches()
|
||||||
addon.SpeechFrame:UpdateSettings()
|
addon.SpeechFrame:UpdateSettings()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
CreateButton('Zobrazit testovaci zpravu', "Zobrazit", function()
|
||||||
|
addon.API.AddSpeechMessage("Test", "Text message")
|
||||||
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function InitOthers()
|
local function InitOthers()
|
||||||
|
|
|
@ -49,6 +49,9 @@ local function ShowQuestTranslation(event)
|
||||||
if data then
|
if data then
|
||||||
local title = GetQuestTitle(data.title, questId)
|
local title = GetQuestTitle(data.title, questId)
|
||||||
local xOffset = hasModel and 210 or 10
|
local xOffset = hasModel and 210 or 10
|
||||||
|
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
||||||
|
xOffset = -20
|
||||||
|
end
|
||||||
if event == "QUEST_PROGRESS" then
|
if event == "QUEST_PROGRESS" then
|
||||||
frame:SetData(title, data.progress, "", "", QuestFrame, -20, xOffset)
|
frame:SetData(title, data.progress, "", "", QuestFrame, -20, xOffset)
|
||||||
elseif event == "QUEST_COMPLETE" then
|
elseif event == "QUEST_COMPLETE" then
|
||||||
|
@ -109,13 +112,21 @@ local function InitQuests()
|
||||||
if event == "PLAYER_LOGIN" then
|
if event == "PLAYER_LOGIN" then
|
||||||
-- classic
|
-- classic
|
||||||
if QuestLogFrame then
|
if QuestLogFrame then
|
||||||
QuestLogFrame:SetScript("OnEnter", function() ShowQuestTranslation() end)
|
QuestLogFrame:SetScript("OnEnter", function()
|
||||||
QuestLogFrame:SetScript("OnLeave", function() frame:Hide() end)
|
ShowQuestTranslation()
|
||||||
|
end)
|
||||||
|
QuestLogFrame:SetScript("OnLeave", function()
|
||||||
|
frame:Hide()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
-- retail
|
-- retail
|
||||||
if QuestMapDetailsScrollFrame then
|
if QuestMapDetailsScrollFrame then
|
||||||
QuestMapDetailsScrollFrame:SetScript("OnEnter", function() ShowQuestTranslation() end)
|
QuestMapDetailsScrollFrame:SetScript("OnEnter", function()
|
||||||
QuestMapDetailsScrollFrame:SetScript("OnLeave", function() frame:Hide() end)
|
ShowQuestTranslation()
|
||||||
|
end)
|
||||||
|
QuestMapDetailsScrollFrame:SetScript("OnLeave", function()
|
||||||
|
frame:Hide()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
frame:Init()
|
frame:Init()
|
||||||
|
|
|
@ -35,30 +35,43 @@ function QuestFrame:Init()
|
||||||
self.Texture:SetAllPoints(true)
|
self.Texture:SetAllPoints(true)
|
||||||
self.Texture:SetHorizTile(true)
|
self.Texture:SetHorizTile(true)
|
||||||
|
|
||||||
-- Load settings
|
-- Create fonts
|
||||||
self:UpdateSettings()
|
|
||||||
end
|
|
||||||
|
|
||||||
function QuestFrame:UpdateSettings()
|
|
||||||
self.Title = self:CreateHeader()
|
self.Title = self:CreateHeader()
|
||||||
self.Text1 = self:CreateText()
|
self.Text1 = self:CreateText()
|
||||||
self.Header = self:CreateHeader()
|
self.Header = self:CreateHeader()
|
||||||
self.Text2 = self:CreateText()
|
self.Text2 = self:CreateText()
|
||||||
|
|
||||||
self:ApplyTheme()
|
-- Load settings
|
||||||
|
self:UpdateSettings()
|
||||||
|
end
|
||||||
|
|
||||||
|
function QuestFrame:UpdateSettings()
|
||||||
|
addon.API.UpdateCzechFont(
|
||||||
|
self.Title,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_NAME,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_SIZE
|
||||||
|
)
|
||||||
|
addon.API.UpdateCzechFont(
|
||||||
|
self.Text1,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_NAME,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_SIZE
|
||||||
|
)
|
||||||
|
addon.API.UpdateCzechFont(
|
||||||
|
self.Header,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_NAME,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_SIZE
|
||||||
|
)
|
||||||
|
addon.API.UpdateCzechFont(
|
||||||
|
self.Text2,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_NAME,
|
||||||
|
CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_SIZE
|
||||||
|
)
|
||||||
|
|
||||||
if not CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA_ONLY_MOVING then
|
if not CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA_ONLY_MOVING then
|
||||||
self.Texture:SetAlpha(CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA / 100)
|
self.Texture:SetAlpha(CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA / 100)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function QuestFrame:ResetText()
|
|
||||||
self.Title:SetText("")
|
|
||||||
self.Header:SetText("")
|
|
||||||
self.Text1:SetText("")
|
|
||||||
self.Text2:SetText("")
|
|
||||||
end
|
|
||||||
|
|
||||||
function QuestFrame:SetTextColor(r, g, b, a)
|
function QuestFrame:SetTextColor(r, g, b, a)
|
||||||
self.Title:SetTextColor(r, g, b, a)
|
self.Title:SetTextColor(r, g, b, a)
|
||||||
self.Header:SetTextColor(r, g, b, a)
|
self.Header:SetTextColor(r, g, b, a)
|
||||||
|
@ -69,29 +82,76 @@ end
|
||||||
function QuestFrame:ApplyTheme()
|
function QuestFrame:ApplyTheme()
|
||||||
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
||||||
self.Texture:SetTexture("Interface/QUESTFRAME/QuestBG");
|
self.Texture:SetTexture("Interface/QUESTFRAME/QuestBG");
|
||||||
self.Texture:SetTexCoord(0, .58, 0.005, 0.66)
|
|
||||||
self:SetTextColor(0, 0, 0, 1)
|
|
||||||
if CzechQuestsAddon_Store.config.QUEST_DARK_MODE then
|
if CzechQuestsAddon_Store.config.QUEST_DARK_MODE then
|
||||||
self:SetBackdropColor(0, 0, 0, 1)
|
self:SetBackdropColor(0, 0, 0, 1)
|
||||||
self.Texture:SetColorTexture(0, 0, 0, 1)
|
self.Texture:SetColorTexture(0, 0, 0, 1)
|
||||||
self:SetTextColor(255, 255, 255, 1)
|
self:SetTextColor(255, 255, 255, 1)
|
||||||
|
else
|
||||||
|
self.Texture:SetTexCoord(0, .58, 0.005, 0.66)
|
||||||
|
self:SetTextColor(0, 0, 0, 1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.Texture:SetTexture("Interface/QUESTFRAME/QuestBackgroundParchment");
|
self.Texture:SetTexture("Interface/QUESTFRAME/QuestBackgroundParchment");
|
||||||
self.Texture:SetTexCoord(0, .01, 0, 0.4)
|
self.Texture:SetTexCoord(0, .01, 0, 0.4)
|
||||||
self:SetTextColor(0, 0, 0, 1)
|
self:SetTextColor(0, 0, 0, 1)
|
||||||
local questTextContrast = C_CVar.GetCVar("questTextContrast")
|
local questTextContrast = C_CVar.GetCVar("questTextContrast")
|
||||||
if questTextContrast == "1" then -- Brown
|
if questTextContrast == "1" then
|
||||||
|
-- Brown
|
||||||
self.Texture:SetTexCoord(0, .01, .4, .8)
|
self.Texture:SetTexCoord(0, .01, .4, .8)
|
||||||
elseif questTextContrast == "2" or questTextContrast == "3" then -- Gray
|
elseif questTextContrast == "2" or questTextContrast == "3" then
|
||||||
|
-- Gray
|
||||||
self.Texture:SetColorTexture(255, 255, 255, 1)
|
self.Texture:SetColorTexture(255, 255, 255, 1)
|
||||||
elseif questTextContrast == "4" then -- Black
|
elseif questTextContrast == "4" then
|
||||||
|
-- Black
|
||||||
self.Texture:SetColorTexture(0, 0, 0, 1)
|
self.Texture:SetColorTexture(0, 0, 0, 1)
|
||||||
self:SetTextColor(0, 0, 0, 1)
|
self:SetTextColor(255, 255, 255, 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function QuestFrame:ResetFontText()
|
||||||
|
self.Title:SetText("")
|
||||||
|
self.Text1:SetText("")
|
||||||
|
self.Header:SetText("")
|
||||||
|
self.Text2:SetText("")
|
||||||
|
end
|
||||||
|
|
||||||
|
function QuestFrame:SetData(name, text1, header, text2, parentFrame, yOffset, xOffset)
|
||||||
|
-- Reset previously values
|
||||||
|
self:ResetFontText()
|
||||||
|
self:ApplyTheme()
|
||||||
|
|
||||||
|
-- Set parent
|
||||||
|
self:SetParent(parentFrame)
|
||||||
|
|
||||||
|
-- set text to labels
|
||||||
|
self.Title:SetText(name or "")
|
||||||
|
self.Text1:SetText(text1 or "")
|
||||||
|
self.Header:SetText(header or "")
|
||||||
|
self.Text2:SetText(text2 or "")
|
||||||
|
|
||||||
|
-- apply text positions
|
||||||
|
self.Title:SetPoint("TOPLEFT", self, "TOPLEFT", 10, -10)
|
||||||
|
self.Text1:SetPoint("TOPLEFT", self.Title, "BOTTOMLEFT", 0, -5)
|
||||||
|
self.Header:SetPoint("TOPLEFT", self.Text1, "BOTTOMLEFT", 0, -20)
|
||||||
|
self.Text2:SetPoint("TOPLEFT", self.Header, "BOTTOMLEFT", 0, -5)
|
||||||
|
|
||||||
|
-- apply frame position
|
||||||
|
self:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", xOffset, yOffset)
|
||||||
|
|
||||||
|
self:Show()
|
||||||
|
|
||||||
|
-- wait for font render before calculate height
|
||||||
|
local height = self.Title:GetStringHeight()
|
||||||
|
if height == 0 then
|
||||||
|
C_Timer.After(0.5, function()
|
||||||
|
self:CalculateHeight()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
self:CalculateHeight()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function QuestFrame:CalculateHeight()
|
function QuestFrame:CalculateHeight()
|
||||||
local height = 0;
|
local height = 0;
|
||||||
local heights = {
|
local heights = {
|
||||||
|
@ -106,42 +166,3 @@ function QuestFrame:CalculateHeight()
|
||||||
end
|
end
|
||||||
self:SetHeight(height)
|
self:SetHeight(height)
|
||||||
end
|
end
|
||||||
|
|
||||||
function QuestFrame:SetData(name, text1, header, text2, parentFrame, yOffset, xOffset)
|
|
||||||
-- Reset previously values
|
|
||||||
self:ResetText()
|
|
||||||
|
|
||||||
-- Set parent
|
|
||||||
self:SetParent(parentFrame)
|
|
||||||
|
|
||||||
-- set text to labels
|
|
||||||
self.Title:SetText(name)
|
|
||||||
self.Text1:SetText(text1)
|
|
||||||
self.Header:SetText(header)
|
|
||||||
self.Text2:SetText(text2)
|
|
||||||
|
|
||||||
-- apply text positions
|
|
||||||
self.Title:SetPoint("TOPLEFT", self, "TOPLEFT", 10, -10)
|
|
||||||
self.Text1:SetPoint("TOPLEFT", self.Title, "BOTTOMLEFT", 0, -5)
|
|
||||||
self.Header:SetPoint("TOPLEFT", self.Text1, "BOTTOMLEFT", 0, -20)
|
|
||||||
self.Text2:SetPoint("TOPLEFT", self.Header, "BOTTOMLEFT", 0, -5)
|
|
||||||
|
|
||||||
-- apply frame position
|
|
||||||
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
|
||||||
self:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", xOffset, yOffset)
|
|
||||||
else
|
|
||||||
self:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", xOffset, yOffset)
|
|
||||||
end
|
|
||||||
|
|
||||||
self:Show()
|
|
||||||
|
|
||||||
-- wait for font render before calculate height
|
|
||||||
local height = self.Title:GetStringHeight()
|
|
||||||
if height == 0 then
|
|
||||||
C_Timer.After(0.5, function()
|
|
||||||
self:CalculateHeight()
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
self:CalculateHeight()
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -73,6 +73,7 @@ local function AddMessage(sender, message)
|
||||||
RemoveMessage(MessageFrame)
|
RemoveMessage(MessageFrame)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
addon.API.AddSpeechMessage = AddMessage
|
||||||
|
|
||||||
local function ShowSpeechTranslation(sender, message)
|
local function ShowSpeechTranslation(sender, message)
|
||||||
local text = CzechQuestsAddon:GetData("speech", message)
|
local text = CzechQuestsAddon:GetData("speech", message)
|
||||||
|
|
|
@ -28,6 +28,7 @@ function SpeechFrame:UpdateSettings()
|
||||||
self:SetWidth(CzechQuestsAddon_Store.config.SPEECH_FRAME_WIDTH)
|
self:SetWidth(CzechQuestsAddon_Store.config.SPEECH_FRAME_WIDTH)
|
||||||
|
|
||||||
-- Set position
|
-- Set position
|
||||||
|
self:ClearAllPoints()
|
||||||
self:SetPoint(
|
self:SetPoint(
|
||||||
"BOTTOMLEFT", UIParent, "BOTTOMLEFT",
|
"BOTTOMLEFT", UIParent, "BOTTOMLEFT",
|
||||||
CzechQuestsAddon_Store.config.SPEECH_FRAME_POSITION_X,
|
CzechQuestsAddon_Store.config.SPEECH_FRAME_POSITION_X,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
## Title: CzechQuests
|
## Title: CzechQuests
|
||||||
## Notes: Addon displays texts of quests in Czech language
|
## Notes: Addon displays texts of quests in Czech language
|
||||||
## Author: Roman Jaroš
|
## Author: Roman Jaroš
|
||||||
## Version: 0.2.14
|
## Version: 1.0.0
|
||||||
## SavedVariables: CzechQuestsAddon_Store
|
## SavedVariables: CzechQuestsAddon_Store
|
||||||
## Category: Translations
|
## Category: Translations
|
||||||
## IconTexture: Interface\AddOns\CzechQuests\Assets\Icons\Logo
|
## IconTexture: Interface\AddOns\CzechQuests\Assets\Icons\Logo
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
## Title: CzechQuests
|
## Title: CzechQuests
|
||||||
## Notes: Addon displays texts of quests in Czech language as tooltip
|
## Notes: Addon displays texts of quests in Czech language as tooltip
|
||||||
## Author: Roman Jaroš
|
## Author: Roman Jaroš
|
||||||
## Version: 0.1.13
|
## Version: 1.0.0
|
||||||
## SavedVariables: CzechQuestsAddon_Store
|
## SavedVariables: CzechQuestsAddon_Store
|
||||||
|
|
||||||
CzechQuests.lua
|
CzechQuests.lua
|
||||||
|
|
116
Jenkinsfile
vendored
116
Jenkinsfile
vendored
|
@ -7,25 +7,22 @@ def SKIP = "skip"
|
||||||
properties([parameters([
|
properties([parameters([
|
||||||
choice(
|
choice(
|
||||||
name: 'RELEASE',
|
name: 'RELEASE',
|
||||||
choices: ['patch', 'minor', 'major'],
|
choices: [SKIP, 'patch', 'minor', 'major'],
|
||||||
description: 'Release new version'
|
description: 'Next new version'
|
||||||
),
|
),
|
||||||
choice(
|
|
||||||
name: 'GAME',
|
|
||||||
choices: [SKIP, 'classic_era', 'retail', 'all'],
|
|
||||||
description: 'Create build with manual tag',
|
|
||||||
)
|
|
||||||
])])
|
])])
|
||||||
|
|
||||||
def outputFolder = "CzechQuests"
|
def output = "Output"
|
||||||
|
def addon = "CzechQuests"
|
||||||
|
|
||||||
def tocFiles = [
|
def tocFiles = [
|
||||||
"classic_era": "CzechQuests_Vanilla.toc",
|
"classic_era": "CzechQuests_Vanilla.toc",
|
||||||
"retail" : "CzechQuests_Mainline.toc"
|
"retail" : "CzechQuests_Mainline.toc"
|
||||||
]
|
]
|
||||||
|
|
||||||
def readToCVersion = { String tocFile ->
|
def readToCVersion = { ->
|
||||||
return sh(
|
return sh(
|
||||||
script: "grep '## Version:' $tocFile | cut -d ' ' -f 3",
|
script: "grep '## Version:' ${tocFiles['classic_era']} | cut -d ' ' -f 3",
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
}
|
}
|
||||||
|
@ -36,80 +33,77 @@ def writeToCVersion = { String tocFile, String current, String next ->
|
||||||
writeFile(file: tocFile, text: content)
|
writeFile(file: tocFile, text: content)
|
||||||
}
|
}
|
||||||
|
|
||||||
def generateOutput = { String game ->
|
def increaseVersion = { ->
|
||||||
// prepare output folder
|
def currentVersion = readToCVersion()
|
||||||
sh "mkdir -p $outputFolder"
|
def newVersion = ReleaseUtils.increaseVersion(currentVersion, params.RELEASE)
|
||||||
|
writeToCVersion(tocFiles['classic_era'], currentVersion, newVersion)
|
||||||
// copy toc file
|
writeToCVersion(tocFiles['retail'], currentVersion, newVersion)
|
||||||
def tocFile = tocFiles[game]
|
|
||||||
sh "cp $tocFile $outputFolder"
|
|
||||||
|
|
||||||
// copy files
|
|
||||||
sh "find . -name '*.lua' -exec rsync -av {} $outputFolder \\;"
|
|
||||||
sh "find . -name '*.tga' -exec rsync -av {} $outputFolder \\;"
|
|
||||||
sh "find . -name '*.ttf' -exec rsync -av {} $outputFolder \\;"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def createReleaseFile = { String game ->
|
def createZipFile = { String game ->
|
||||||
def tocFile = tocFiles[game]
|
def tocFile = tocFiles[game]
|
||||||
|
def version = readToCVersion()
|
||||||
|
|
||||||
// get version
|
// prepare output folder
|
||||||
def currentVersion = readToCVersion(tocFile)
|
sh "mkdir -p $output/$addon/Addon/Data"
|
||||||
def newVersion = ReleaseUtils.increaseVersion(currentVersion, params.RELEASE)
|
|
||||||
|
// copy toc file
|
||||||
|
sh "cp $tocFile $output/$addon"
|
||||||
|
|
||||||
|
// copy lue files
|
||||||
|
sh "rsync -av './CzechQuests.lua' ./$output/$addon"
|
||||||
|
sh "rsync -av './Addon/Data/other.lua' ./$output/$addon/Addon/Data"
|
||||||
|
sh "find ./Addon/Data/$game/ -name '*.lua' -exec rsync -av {} ./$output/$addon/Addon/Data/ \\;"
|
||||||
|
sh "find ./Addon/Code/ -name '*.lua' -exec rsync -av {} ./$output/$addon/Addon/Code/ \\;"
|
||||||
|
|
||||||
|
// copy assets
|
||||||
|
sh "find . -name '*.tga' -exec rsync -avR {} $output/$addon \\;"
|
||||||
|
sh "find . -name '*.ttf' -exec rsync -avR {} $output/$addon \\;"
|
||||||
|
|
||||||
// create zip
|
// create zip
|
||||||
def zipFileName = "czech-quests-$game-v${newVersion}.zip"
|
def zipFileName = "czech-quests-$game-v${version}.zip"
|
||||||
zip zipFile: zipFileName, archive: false, dir: outputFolder
|
zip zipFile: zipFileName, archive: false, dir: output
|
||||||
|
|
||||||
// remove build folder
|
// remove build folder
|
||||||
sh "rm -r $outputFolder"
|
sh "rm -r $output"
|
||||||
|
}
|
||||||
|
|
||||||
// save version
|
def pushToGit = { ->
|
||||||
writeToCVersion(tocFile, currentVersion, newVersion)
|
def version = readToCVersion()
|
||||||
|
|
||||||
// commit new version
|
|
||||||
def tag = "v$newVersion"
|
|
||||||
sh "git checkout ${BRANCH_NAME}"
|
sh "git checkout ${BRANCH_NAME}"
|
||||||
sh "git add $tocFile"
|
sh "git add *.toc"
|
||||||
sh "git commit -m 'Release ${tag}'"
|
sh "git commit -m 'Release $version'"
|
||||||
sh "git push"
|
sh "git push"
|
||||||
sh "git tag ${tag}"
|
sh "git tag $version"
|
||||||
sh "git push origin ${tag}"
|
sh "git push origin $version"
|
||||||
|
}
|
||||||
|
|
||||||
|
def uploadToForgejo = { ->
|
||||||
|
def version = readToCVersion()
|
||||||
|
ForgejoRelease('czech-quests', 'addon', version)
|
||||||
}
|
}
|
||||||
|
|
||||||
MasterJob [:], { ->
|
MasterJob [:], { ->
|
||||||
if (game == SKIP) {
|
def version = params.RELEASE
|
||||||
|
if (version == SKIP) {
|
||||||
currentBuild.result = 'SUCCESS'
|
currentBuild.result = 'SUCCESS'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
|
stageWhen("version") {
|
||||||
|
increaseVersion()
|
||||||
|
}
|
||||||
|
|
||||||
stageWhen('build') {
|
stageWhen('build') {
|
||||||
def game = params.GAME
|
createZipFile("classic_era")
|
||||||
if (game == "all") {
|
createZipFile("retail")
|
||||||
generateOutput("classic_era")
|
|
||||||
generateOutput("retail")
|
|
||||||
} else {
|
|
||||||
generateOutput(game)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stageWhen('make release') {
|
|
||||||
def game = params.GAME
|
|
||||||
forgejoGit()
|
forgejoGit()
|
||||||
if (game == "all") {
|
pushToGit()
|
||||||
createReleaseFile("classic_era")
|
|
||||||
createReleaseFile("retail")
|
|
||||||
} else {
|
|
||||||
createReleaseFile(game)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stageWhen('upload release') {
|
stageWhen('release') {
|
||||||
def game = params.GAME
|
uploadToForgejo()
|
||||||
def tocFile = tocFiles[game]
|
|
||||||
def version = readToCVersion(tocFile)
|
|
||||||
ForgejoRelease('czech-quests', 'addon', version)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
129
release.sh
129
release.sh
|
@ -1,129 +0,0 @@
|
||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
output_directory="CzechQuests"
|
|
||||||
|
|
||||||
wow_versions=(
|
|
||||||
"Classic ERA" # 1 - classic_era
|
|
||||||
"Retail" # 2 - retail
|
|
||||||
)
|
|
||||||
|
|
||||||
toc_files=(
|
|
||||||
"CzechQuests_Vanilla.toc"
|
|
||||||
"CzechQuests_Mainline.toc"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
read_toc_version() {
|
|
||||||
local wow_version=$1
|
|
||||||
local toc_file=${toc_files[$wow_version]}
|
|
||||||
local current_version=0
|
|
||||||
if [[ -f "$toc_file" ]]; then
|
|
||||||
current_version=$(grep "## Version:" "$toc_file" | cut -d ' ' -f 3)
|
|
||||||
fi
|
|
||||||
echo "$current_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
write_toc_version() {
|
|
||||||
local wow_version=$1
|
|
||||||
local next_version=$2
|
|
||||||
local toc_file=${toc_files[$wow_version]}
|
|
||||||
if [[ -f "$toc_file" ]]; then
|
|
||||||
sed -i '' "s/## Version: $current_version/## Version: $next_version/" "$toc_file"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
make_zip() {
|
|
||||||
local wow_version=$1
|
|
||||||
local current_version=$2
|
|
||||||
|
|
||||||
local zip_filename=""
|
|
||||||
local files_to_zip=()
|
|
||||||
|
|
||||||
# prepare output directory
|
|
||||||
mkdir -p $output_directory
|
|
||||||
mkdir -p "${output_directory}/Addon/Data/"
|
|
||||||
|
|
||||||
# Includes classic era continents
|
|
||||||
if [ "$wow_version" = "1" ]; then
|
|
||||||
cp -r "./Addon/Data/classic_era/" "${output_directory}/Addon/Data/"
|
|
||||||
cp "./CzechQuests_Vanilla.toc" "${output_directory}"
|
|
||||||
zip_filename="czech-quests-classic_era-v$current_version.zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Includes retail continents
|
|
||||||
if [ "$wow_version" = "2" ]; then
|
|
||||||
cp -r "./Addon/Data/retail/" "${output_directory}/Addon/Data/"
|
|
||||||
cp "./CzechQuests_Mainline.toc" "${output_directory}"
|
|
||||||
zip_filename="czech-quests-retail-v$current_version.zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# includes frames
|
|
||||||
while IFS= read -r line; do
|
|
||||||
files_to_zip+=("$line")
|
|
||||||
done < <(find . -name "*.lua" -path "./Addon/Frames/*")
|
|
||||||
|
|
||||||
# includes code
|
|
||||||
while IFS= read -r line; do
|
|
||||||
files_to_zip+=("$line")
|
|
||||||
done < <(find . -name "*.lua" -path "./Addon/Code/*")
|
|
||||||
|
|
||||||
# includes assets
|
|
||||||
while IFS= read -r line; do
|
|
||||||
files_to_zip+=("$line")
|
|
||||||
done < <(find . -name "*" -path "./Assets/*")
|
|
||||||
|
|
||||||
# includes other files
|
|
||||||
files_to_zip+=("./Addon/Data/other.lua" "./Addon/Addon.lua" "./CzechQuests.lua")
|
|
||||||
|
|
||||||
# prepare output directory
|
|
||||||
for file in "${files_to_zip[@]}"; do
|
|
||||||
rsync -R "$file" "$output_directory"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove invalid files
|
|
||||||
find "$output_directory" -name ".DS_Store" -type f -delete
|
|
||||||
|
|
||||||
# create zip file
|
|
||||||
zip -r "$zip_filename" $output_directory
|
|
||||||
|
|
||||||
# remove output directory
|
|
||||||
rm -r $output_directory
|
|
||||||
}
|
|
||||||
|
|
||||||
release_wow() {
|
|
||||||
local wow_version=$1
|
|
||||||
|
|
||||||
# Read current version from file for wow version
|
|
||||||
current_version=$(read_toc_version "$wow_version")
|
|
||||||
|
|
||||||
# Increase version
|
|
||||||
new_version="$current_version"
|
|
||||||
vared -p "Choose version: " new_version
|
|
||||||
|
|
||||||
# Write to file
|
|
||||||
write_toc_version "$wow_version" "$new_version"
|
|
||||||
|
|
||||||
# Generate zip
|
|
||||||
make_zip $wow_version $new_version
|
|
||||||
}
|
|
||||||
|
|
||||||
init() {
|
|
||||||
echo "Choose Wow:"
|
|
||||||
select opt in "${wow_versions[@]}"
|
|
||||||
do
|
|
||||||
case $opt in
|
|
||||||
"Classic ERA")
|
|
||||||
echo "You chose Classic ERA"
|
|
||||||
release_wow 1
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
"Retail")
|
|
||||||
echo "You chose Retail"
|
|
||||||
release_wow 2
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
init
|
|
10
sync.sh
10
sync.sh
|
@ -1,19 +1,19 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
wow_source_folder="retail"
|
#wow_source_folder="retail"
|
||||||
wow_destiny_folder="retail"
|
#wow_destiny_folder="retail"
|
||||||
|
|
||||||
#wow_destiny_folder="retail"
|
#wow_destiny_folder="retail"
|
||||||
#wow_destiny_folder="beta"
|
#wow_destiny_folder="beta"
|
||||||
|
|
||||||
#wow_source_folder="classic_era"
|
wow_source_folder="classic_era"
|
||||||
#wow_destiny_folder="classic_era"
|
wow_destiny_folder="classic_era"
|
||||||
|
|
||||||
src_folder="."
|
src_folder="."
|
||||||
dest_folder="/Applications/World of Warcraft/_${wow_destiny_folder}_/Interface/AddOns/CzechQuests"
|
dest_folder="/Applications/World of Warcraft/_${wow_destiny_folder}_/Interface/AddOns/CzechQuests"
|
||||||
|
|
||||||
fswatch -o "$src_folder" | while read -r change; do
|
fswatch -o "$src_folder" | while read -r change; do
|
||||||
rsync -avu --delete "$src_folder" "$dest_folder" --exclude={'.*','*.png','*.sh','*.md','Addon/Data/**','downloader/**'}
|
rsync -avu --delete "$src_folder" "$dest_folder" --exclude={'.*','*.png','*.sh','*.md','Addon/Data/**','downloader/**',"lib/**","Jenkinsfile"}
|
||||||
rsync -au --delete "$src_folder/Addon/Data/$wow_source_folder/" "$dest_folder/Addon/Data/"
|
rsync -au --delete "$src_folder/Addon/Data/$wow_source_folder/" "$dest_folder/Addon/Data/"
|
||||||
echo "Dest: $dest_folder"
|
echo "Dest: $dest_folder"
|
||||||
cp "$src_folder/Addon/Data/other.lua" "$dest_folder/Addon/Data/"
|
cp "$src_folder/Addon/Data/other.lua" "$dest_folder/Addon/Data/"
|
||||||
|
|
Loading…
Add table
Reference in a new issue