Fix first Speech Message size

This commit is contained in:
Roman Jaroš 2025-03-08 08:48:11 +01:00
parent b17f37ee42
commit 45c722e271
5 changed files with 39 additions and 297 deletions

View file

@ -3,18 +3,39 @@ local messages = {}
local GAP = 2 local GAP = 2
local function ReflowMessages() local function ShowSpeech(Frame, offsetY)
Frame:ClearAllPoints()
Frame:SetPoint("BOTTOMLEFT", addon.SpeechFrame, "BOTTOMLEFT", 0, offsetY)
Frame:SetHeight(Frame.Message:GetStringHeight() + 10)
return Frame
end
local function ReflowMessages(requery)
local offsetY = 0 local offsetY = 0
for i = #messages, 1, -1 do
local Frame = messages[i]
Frame:ClearAllPoints()
Frame:SetPoint("BOTTOMLEFT", addon.SpeechFrame, "BOTTOMLEFT", 0, offsetY)
Frame:Show()
offsetY = offsetY + Frame:GetHeight() + GAP
end
if #messages == 0 then if #messages == 0 then
addon.SpeechFrame:Hide() addon.SpeechFrame:Hide()
return
end
if #messages == 1 then
local Frame = messages[1]
ShowSpeech(Frame, offsetY)
Frame:Show()
local height = Frame.Message:GetStringHeight()
if height == 0 and not requery then
Frame:Hide()
C_Timer.After(0.5, function()
ReflowMessages(true)
end)
return
end
end
for i = #messages, 1, -1 do
local Frame = messages[i]
ShowSpeech(Frame, offsetY)
offsetY = offsetY + Frame:GetHeight() + GAP
end end
end end
@ -39,14 +60,15 @@ local function RemoveMessage(frame)
end end
local function AddMessage(sender, message) local function AddMessage(sender, message)
local text = string.format("|cffffd200%s|r\n%s", sender, message) addon.SpeechFrame:Show()
local MessageFrame = addon.SpeechFrame:CreateMessage(text)
local text = string.format("|cffffd200%s|r\n%s", sender, message)
local MessageFrame = addon.SpeechFrame:CreateMessage()
MessageFrame.Message:SetText(text)
-- put into table and rerender while queue
table.insert(messages, MessageFrame) table.insert(messages, MessageFrame)
ReflowMessages() ReflowMessages()
-- hide after timeout
C_Timer.After(20, function() C_Timer.After(20, function()
RemoveMessage(MessageFrame) RemoveMessage(MessageFrame)
end) end)
@ -58,7 +80,6 @@ local function ShowSpeechTranslation(sender, message)
text = message text = message
end end
if text ~= nil then if text ~= nil then
addon.SpeechFrame:Show()
AddMessage(sender, text) AddMessage(sender, text)
end end
end end

View file

@ -35,7 +35,7 @@ function SpeechFrame:UpdateSettings()
) )
end end
function SpeechFrame:CreateMessage(message) function SpeechFrame:CreateMessage()
local frame = self local frame = self
local MessageFrame = CreateFrame("Frame", nil, frame) local MessageFrame = CreateFrame("Frame", nil, frame)
@ -58,8 +58,5 @@ function SpeechFrame:CreateMessage(message)
MessageFrame.Texture:SetPoint("TOPLEFT", MessageFrame ,"TOPLEFT", 0, 0) MessageFrame.Texture:SetPoint("TOPLEFT", MessageFrame ,"TOPLEFT", 0, 0)
MessageFrame.Texture:SetPoint("BOTTOMRIGHT", MessageFrame ,"BOTTOMRIGHT", 0, 0) MessageFrame.Texture:SetPoint("BOTTOMRIGHT", MessageFrame ,"BOTTOMRIGHT", 0, 0)
MessageFrame.Message:SetText(message)
MessageFrame:SetHeight(MessageFrame.Message:GetHeight() + 10)
return MessageFrame return MessageFrame
end end

View file

@ -1,73 +0,0 @@
# Czech Quests
This addon aims to offer players the possibility to play the part of game in Czech language while also having access to
the texts in English language.
It can offer players who don't understood English quest description some help to understand how complete quests.
## Description
Display unofficial translations for quests in the player's quest log, as well as on the quest frames.
The translation is automatically visible next to the original text as tooltip.
In case Quest Log, you need to hover over the quest text itself. It works only when quest is translated. Check the progress of translations below.
## Contribution
Translations can be reported at [this link](https://czquests.romanjaros.cz) (only czech language).
## Financial support
[![co-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G210Y1M7)
If you like my work, I would be very happy for consider financial support.
By supporting, you can also help to speed up the translation of the remaining parts + possible expand to other game
expansions.
---
# České Questy
Cílem tohoto addonu je nabídnout hráčům možnost hrát část hry v češtině a zároveň mít přístup k textům v angličtině.
Hráčům, kteří nerozumějí anglickému popisu úkolů, může nabídnout určitou pomoc, aby pochopili, jak úkoly plnit.
## Popisek
Zobrazení neoficiálních překladů úkolů v Quest logu hráče a vedle standartního zobrazení detailu úkolu.
Překlad se automaticky zobrazí vedle originálního textu jako nápověda.
V případě deníku úkolů je třeba vybrat úkol a následně najet myší na samotný text úkolu. Funguje to pouze v případě, že quest je přeložen. Níže je popsán stav překladu.
## Pomoc s překladem
Pokud narazíte na chybný překlad, mužete se přihlásit [tomto odkazu](https://czquests.romanjaros.cz) pomocí Battle.net
účtu (jako do wowka) a nahlásit co je špatně.
## Finanční podpora
[![co-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G210Y1M7)
Pokud se vám moje práce líbí, budu velmi rád, když zvážíte finanční podporu.
Podporou také pomůžete urychlit překlad zbývajících dílů + případné rozšíření na další rozšíření hry.
---
# Progress of translations
##### Verified translation still may contain errors
#### TWW:
| name | verified | translated |
|-------------------|----------|------------|
| azj kahet | x | |
| city of threads | x | |
| dornogal | x | |
| hallowfall | x | |
| isle of dorn | x | |
| the ringing deeps | x | |
| warbands | x | |
| dalaran | x | |
| silithus | x | |
| harbinger | x | |
| earthen | x | |
| items (quest) | x | |

View file

@ -1,203 +0,0 @@
# Czech Quests
This addon aims to offer players the possibility to play the part of game in Czech language while also having access to
the texts in English language.
It can offer players who don't understood English quest description some help to understand how complete quests.
## Description
Display unofficial translations for quests in the player's quest log, as well as on the quest frames.
The translation is automatically visible next to the original text as tooltip.
In case Quest Log, you need to hover over the quest text itself.
## Contribution
Translations can be reported at [this link](https://czquests.romanjaros.cz) (only czech language).
## Financial support
[![co-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G210Y1M7)
If you like my work, I would be very happy for consider financial support.
By supporting, you can also help to speed up the translation of the remaining parts + possible expand to other game
expansions.
---
# České Questy
Cílem tohoto addonu je nabídnout hráčům možnost hrát část hry v češtině a zároveň mít přístup k textům v angličtině.
Hráčům, kteří nerozumějí anglickému popisu úkolů, může nabídnout určitou pomoc, aby pochopili, jak úkoly plnit.
## Popisek
Zobrazení neoficiálních překladů úkolů v Quest logu hráče a vedle standartního zobrazení detailu úkolu.
Překlad se automaticky zobrazí vedle originálního textu jako nápověda.
V případě deníku úkolů je třeba vybrat úkol a následně najet myší na samotný text úkolu.
## Pomoc s překladem
Pokud narazíte na chybný překlad, mužete se přihlásit [tomto odkazu](https://czquests.romanjaros.cz) pomocí Battle.net
účtu (jako do wowka) a nahlásit co je špatně.
## Finanční podpora
[![co-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G210Y1M7)
Pokud se vám moje práce líbí, budu velmi rád, když zvážíte finanční podporu.
Podporou také pomůžete urychlit překlad zbývajících dílů + případné rozšíření na další rozšíření hry.
---
# Current progress of translations
#### Kalimdor:
| name | verified | translated |
|----------------------|----------|------------|
| darkshore | x | |
| durotar | x | |
| darnassus | x | |
| moonglade | x | |
| mulgore | x | |
| thunder bluff | x | |
| teldrassil | x | |
| ashenvale | | |
| azshara | | |
| desolace | | |
| dustwallow marsh | | |
| felwood | | |
| feralas | | |
| ratchet | | |
| ruttheran village | | |
| silithus | | |
| stonetalon mountains | | |
| tanaris | | |
| the barrens | | |
| thousand needles | | |
| ungoro crater | | |
| winterspring | | |
#### Eastern Kingdoms:
| name | verified | translated |
|---------------------|----------|------------|
| dun morogh | x | |
| elwynn forest | x | |
| ironforge | x | |
| orgrimmar | x | |
| stormwind city | x | |
| tirisfal glades | x | |
| undercity | x | |
| alterac mountains | | |
| alterac valley | | |
| arathi highlands | | |
| badlands | | |
| blackrock mountain | | |
| blasted lands | | |
| burning steppes | | |
| deadwind pass | | |
| deeprun tram | | |
| duskwood | | |
| eastern plaguelands | | |
| hillsbrad foothills | | |
| loch modan | | |
| redridge mountains | | |
| searing gorge | | |
| shadowfang keep | | |
| silverpine forest | | |
| stranglethorn vale | | |
| swamp of sorrows | | |
| the hinterlands | | |
| western plaguelands | | |
| westfall | | |
| wetlands | | |
#### Classes:
| name | verified | translated |
|---------|----------|------------|
| druid | x | |
| hunter | x | |
| mage | x | |
| paladin | x | |
| priest | x | |
| rogue | x | |
| shaman | x | |
| warlock | x | |
| warrior | x | |
#### Dungeons:
| name | verified | translated |
|--------------------------|----------|------------|
| blackfathom deeps | | |
| blackrock depths | | |
| blackrock spire | | |
| dire maul | | |
| gnomeregan | | |
| maraudon | | |
| ragefire chasm | | |
| razorfen downs | | |
| razorfen kraul | | |
| scarlet monastery | | |
| scholomance | | |
| shadowfang keep | | |
| stratholme | | |
| the deadmines | | |
| the stockade | | |
| the temple of atalhakkar | | |
| uldaman | | |
| wailing caverns | | |
| zulfarrak | | |
#### Professions:
| name | verified | translated |
|----------------|----------|------------|
| alchemy | | |
| blacksmithing | | |
| cooking | | |
| engineering | | |
| first aid | | |
| fishing | | |
| herbalism | | |
| leatherworking | | |
| tailoring | | |
#### Raids:
| name | verified | translated |
|-------------------|----------|------------|
| ahnqiraj | | |
| blackwing lair | | |
| molten core | | |
| naxxramas | | |
| onyxias lair | | |
| ruins of ahnqiraj | | |
| zulgurub | | |
#### Events:
| name | verified | translated |
|--------------------|----------|------------|
| childrens week | | |
| darkmoon faire | | |
| hallows end | | |
| love is in the air | | |
| lunar festival | | |
| midsummer | | |
| winter veil | | |
#### Items:
| name | verified | translated |
|---------------|----------|------------|
| quest (books) | | |

View file

@ -1,13 +1,13 @@
#!/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"