From 8b4aab06352a51f22c0d32c827291f2b3b9de858 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 07:39:59 +0200 Subject: [PATCH 01/11] Add files via upload --- data/Betrayal.json | 6 +-- data/changelog.json | 5 +++ data/lang_english.txt | 91 +++++++++++++++++++++++++++++++++++++++++++ data/versions.json | 2 +- 4 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 data/lang_english.txt diff --git a/data/Betrayal.json b/data/Betrayal.json index 731e897c..2cc557ee 100644 --- a/data/Betrayal.json +++ b/data/Betrayal.json @@ -102,7 +102,7 @@ "haku": { "rewards": { "fortification": [ - "strongboxes", + "unique strongbox", "mixed items" ], "intervention": [ @@ -110,7 +110,7 @@ "ambush scarab" ], "research": [ - "qual rare items", + "quality rares", "quality items" ], "transportation": [ @@ -250,7 +250,7 @@ "blight scarab" ], "research": [ - "take one: catalyst,\nsplinter, essence, fossil", + "take one: oil, catalyst,\nsplinter, essence, fossil", "fractured item" ], "transportation": [ diff --git a/data/changelog.json b/data/changelog.json index ea42789a..dacdc537 100644 --- a/data/changelog.json +++ b/data/changelog.json @@ -1,4 +1,9 @@ [ + [ + ["1.50.8", 15008], + "mapping tracker: sanctum support", + "general: preliminary support for community translations" + ], [ ["1.50.7", 15007], "item-info: jewel-weight fix", diff --git a/data/lang_english.txt b/data/lang_english.txt new file mode 100644 index 00000000..1851758a --- /dev/null +++ b/data/lang_english.txt @@ -0,0 +1,91 @@ +;##################################################### +; general information/instructions +;##################################################### + +; the script ignores lines that start with a semicolon +; this lang_english text-file can be used as a template to create new language-files +; make a __COPY__ of this file, then rename the __COPY__ to lang_XYZ (XYZ will be displayed in the drop-down menu in the section of the settings menu, and it will also be used as a suffix for other required files, e.g. Betrayal-info data) +; the next time you restart the script, there should be a drop-down list with languages in the section of the settings menu +; I know enough German to supply some edge-case examples/requirements for syntax-structures that differ from English, but not enough to add complete support for German game-clients +; use these examples to adjust the language-file to your own language + +; each line of the main data is divided into two parts: +; key = "value" + +; __DO NOT__ edit the key of a line, i.e. whatever is left of the equal sign +; always use TABs wherever this sample file uses them: if preferred, you can also remove them, but __DO NOT__ replace them with simple spaces + +; the value contains in-game text AS IT IS DISPLAYED IN THE CHAT-BOX, and that's also what the script is looking for in the client.txt log-file +; the value has to be enclosed in quotation marks, and it is also case-sensitive +; to leave a value blank, set it to "0" + +; depending on the syntax of a language, info-extraction from the client.txt file has to be adjusted +; generally, the script looks for certain patterns to determine what kind of information is present within a line in the log-file +; for English, "You have entered Highgate." will be displayed whenever you enter Highgate +; the script recognizes "You have entered", then 'knows' that the rest of the sentence is the location-name (so white-space and everything else will be removed) +; for German (and maybe others as well), "Ihr habt 'Hohenpforte' betreten." will be displayed +; so the script has to look for "Ihr habt" and "betreten" instead, then remove them to extract the location-name + +; to let the script 'know' of this structural difference, additional key/value pairs have to be provided +; simply add one or more additional line(s) with the same key: it's important to list them in the correct order, i.e. following the sentence structure +; enter = "Ihr habt" +; enter = "betreten" + + + +;##################################################### +; general: character tracking +;##################################################### + +; certain languages may use sign-characters to highlight location-names (e.g. German uses apostrophes: Highgate -> 'Hohenpforte') +; location = "'" + +; English doesn't, so the value stays blank ("0") + location = "0" + enter = "You have entered" + level = "is now level" + slain = "has been slain" + suicide = "has committed suicide" + killed = "You have killed" + killed = "monsters" + + + +;##################################################### +; mapping tracker: league-content tracking (dialogue) +;##################################################### + +; colons are included in the value (just in case they need to be swapped out in certain languages), so pay attention +; don't leave out colons because they are important for accuracy (especially Rog) + cassia = "Sister Cassia:" + strange voice = "Strange Voice:" + oshabi = "Oshabi:" + alva = "Alva, Master Explorer:" + einhar = "Einhar, Beastmaster:" + niko = "Niko, Master of the Depths:" + jun = "Jun, Veiled Master:" + aisling = "Aisling Laffrey, The Silent Butcher:" + cameria = "Cameria the Coldblooded:" + elreon = "Elreon, Light's Judge:" + gravicius = "Gravicius Reborn:" + guff = "Guff "Tiny" Grenn:" + haku = "Haku, Warmaster:" + hillock = "Hillock, the Blacksmith:" + it = "It That Fled:" + janus = "Janus Perandus:" + jorgin = "Thane Jorgin the Banished:" + korell = "Korell Goya, Son of Stone:" + leo = "Leo, Wolf of the Pits:" + riker = "Riker Maloney, Midnight Tinkerer:" + rin = "Rin Yuushu:" + tora = "Tora, the Culler:" + vagan = "Vagan, Victory's Herald:" + vorici = "Vorici, Silent Brother:" + +; expedition note: there is a difference in displayed names depending on whether the NPCs greet you when they first see you in a map (Gwennen, the Gambler) or whether the encounter has finished (Gwennen) +; always use the name displayed when they greet you +; for some reason, Rog is always displayed as simply "Rog", regardless of when he speaks (at least in English) + dannig = "Dannig, Warrior Skald:" + gwennen = "Gwennen, the Gambler:" + rog = "Rog:" + tujen = "Tujen, the Haggler:" \ No newline at end of file diff --git a/data/versions.json b/data/versions.json index f146ac8f..222aa763 100644 --- a/data/versions.json +++ b/data/versions.json @@ -1,6 +1,6 @@ { "_release": [ - 15007, + 15008, "https://github.com/Lailloken/Lailloken-UI/archive/refs/heads/beta.zip" ] } \ No newline at end of file From a46b0a71010ba50c9922fc948eab4525eb712781 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 07:41:08 +0200 Subject: [PATCH 02/11] v1.50.8 modules --- modules/client log.ahk | 24 ++++++++--------- modules/languages.ahk | 56 +++++++++++++++++++++++++++++++++++++++ modules/map tracker.ahk | 32 ++++++++++------------ modules/settings menu.ahk | 29 +++++++++++++++----- 4 files changed, 104 insertions(+), 37 deletions(-) create mode 100644 modules/languages.ahk diff --git a/modules/client log.ahk b/modules/client log.ahk index dbe707f9..ef3d4d4a 100644 --- a/modules/client log.ahk +++ b/modules/client log.ahk @@ -137,15 +137,15 @@ LogParse(content, ByRef areaID, ByRef areaname, ByRef areaseed, ByRef arealevel, local global vars, settings, db - ignore := ["[SHADER]", "[ENGINE]", "[RENDER]", "[DOWNLOAD]", "Tile hash", "Doodad hash", "Connecting to", "Connect time", "login server", "[D3D12]", "[D3D11]", "[WINDOW]", "Precalc", "[STARTUP]", "[WARN", "[VULKAN]", "[DXC]", "[TEXTURE]", "[BUNDLE]", "[JOB]", "Enumerated", "[SOUND]", "Queue file to download", "[STORAGE]", "[RESOURCE]", "[PARTICLE]"] - StringLower, content, content - Loop, Parse, content, `n, `r + ignore := ["[SHADER]", "[ENGINE]", "[RENDER]", "[DOWNLOAD]", "Tile hash", "Doodad hash", "Connecting to", "Connect time", "login server", "[D3D12]", "[D3D11]", "[WINDOW]", "Precalc", "[STARTUP]", "[WARN", "[VULKAN]", "[DXC]", "[TEXTURE]", "[BUNDLE]", "[JOB]", "Enumerated", "[SOUND]", "Queue file to download", "[STORAGE]", "[RESOURCE]", "[PARTICLE]", "[Item Filter]"] + + Loop, Parse, content, `n, `r. { For index, skip in ignore - If InStr(A_LoopField, skip, 1) ;skip lines with certain key-words + If InStr(A_LoopField, skip, 1) ;skip lines with certain key words/phrases Continue 2 - If InStr(A_LoopField, "generating level") + If InStr(A_LoopField, "Generating level ", 1) { parse := SubStr(A_Loopfield, InStr(A_Loopfield, "area """) + 6), areaID := SubStr(parse, 1, InStr(parse, """") -1) ;store PoE-internal location name in var areaseed := SubStr(A_Loopfield, InStr(A_Loopfield, "with seed ") + 10), areaname := "" @@ -159,22 +159,22 @@ LogParse(content, ByRef areaID, ByRef areaname, ByRef areaseed, ByRef arealevel, Else If InStr(A_LoopField, " connected to ") && InStr(A_LoopField, ".login.") || InStr(A_LoopField, "*****") areaID := "login" - If InStr(A_LoopField, "you have entered ") - parse := SubStr(A_LoopField, InStr(A_LoopField, "you have entered") + 17), areaname := SubStr(parse, 1, -1) + If LangLineParse(A_LoopField, vars.lang.enter) + parse := SubStr(A_LoopField, InStr(A_LoopField, vars.lang.enter.1)), areaname := LLK_StringCase(LangLineTrim(parse, vars.lang.enter, 1)) - If !Blank(settings.general.character) && InStr(A_LoopField, " " settings.general.character " ") && InStr(A_LoopField, " is now level ") + If !Blank(settings.general.character) && InStr(A_LoopField, " " settings.general.character " ") && LangLineParse(A_LoopField, vars.lang.level) { - level := SubStr(A_Loopfield, InStr(A_Loopfield, "is now level ")), level := StrReplace(level, "is now level ") + level := SubStr(A_Loopfield, InStr(A_Loopfield, vars.lang.level.1)), level := LangLineTrim(level, vars.lang.level) If settings.leveltracker.geartracker && vars.hwnd.geartracker.main GeartrackerGUI("refresh") } - If settings.features.maptracker && (vars.log.areaID = vars.maptracker.map.id) && (InStr(A_LoopField, " has been slain.") || InStr(A_LoopField, " has committed suicide.")) + If settings.features.maptracker && (vars.log.areaID = vars.maptracker.map.id) && (LangLineParse(A_LoopField, vars.lang.slain) || LangLineParse(A_LoopField, vars.lang.suicide)) vars.maptracker.map.deaths += 1 - If settings.features.maptracker && settings.maptracker.kills && vars.maptracker.refresh_kills && InStr(A_LoopField, "you have killed ") + If settings.features.maptracker && settings.maptracker.kills && vars.maptracker.refresh_kills && LangLineParse(A_LoopField, vars.lang.killed) { - parse := SubStr(A_LoopField, InStr(A_LoopField, "you have killed ") + 16), parse := SubStr(parse, 1, InStr(parse, " monsters") - 1) + parse := SubStr(A_LoopField, InStr(A_LoopField, vars.lang.killed.1)), parse := LangLineTrim(parse, vars.lang.killed) Loop, Parse, parse { If (A_Index = 1) diff --git a/modules/languages.ahk b/modules/languages.ahk new file mode 100644 index 00000000..fb65a7d2 --- /dev/null +++ b/modules/languages.ahk @@ -0,0 +1,56 @@ +Init_Lang() +{ + local + global vars, settings, Json + + lang := LLK_IniRead("ini\config.ini", "settings", "language", "english"), lang := !FileExist("data\lang_"lang ".txt") ? "english" : lang, settings.general.lang := lang + Loop, Parse, % StrReplace(LLK_FileRead("data\lang_"settings.general.lang ".txt", 1), "`t"), `n, `r + { + If Blank(A_LoopField) || (SubStr(A_LoopField, 1, 1) = ";") + Continue + If !InStr(A_LoopField, "=") + { + MsgBox, % "Error in file ""data\lang_"settings.general.lang """, line"A_Index ":`nkey/value pair is missing an equal sign, or comment is missing a semicolon" + Continue + } + key := SubStr(A_LoopField, 1, InStr(A_LoopField, "=") - 1), val := SubStr(A_LoopField, InStr(A_LoopField, "=") + 1), val := SubStr(val, 2), val := SubStr(val, 1, -1) + If !val + Continue + If !IsObject(vars.lang[key]) + vars.lang[key] := [] + vars.lang[key].Push(val) + } +} + +LangLineParse(line, array) +{ + local + global vars, settings + + If !array.Count() + Return + + check := 1 + For index, segment in array + { + check *= InStr(line, segment, 1) ? 1 : 0 + If !check + Break + } + Return check +} + +LangLineTrim(line, array, location := 0) +{ + local + global vars, settings + + location := location ? vars.lang.location_identifier.1 : "" + For index, segment in array + line := StrReplace(line, segment,,, 1) + While InStr(" "location, SubStr(line, 1, 1)) + line := SubStr(line, 2) + While InStr(" "location, SubStr(line, 0)) + line := SubStr(line, 1, -1) + Return line +} diff --git a/modules/map tracker.ahk b/modules/map tracker.ahk index 0b8bd96f..efa9d59d 100644 --- a/modules/map tracker.ahk +++ b/modules/map tracker.ahk @@ -91,10 +91,10 @@ MaptrackerCheck(mode := 0) ;checks if player is in a map or map-related content global vars, settings If !mode - parse := {"mapworlds": 0, "maven": 0, "betrayal": 0, "incursion": 0, "heist": "heisthub", "mapatziri": 0, "legionleague": 0, "expedition": 0, "atlasexilesboss": 0, "breachboss": 0, "affliction": 0, "bestiary": 0} + parse := {"mapworlds": 0, "maven": 0, "betrayal": 0, "incursion": 0, "heist": "heisthub", "mapatziri": 0, "legionleague": 0, "expedition": 0, "atlasexilesboss": 0, "breachboss": 0, "affliction": 0, "bestiary": 0, "sanctum": "sanctumfoyer"} Else If (mode = 1) parse := {"abyssleague": 0, "labyrinth_trials": 0, "mapsidearea": 0} - Else parse := {"mapworlds": 0, "maven": 0, "betrayal": 0, "incursion": 0, "heist": "heisthub", "mapatziri": 0, "legionleague": 0, "expedition": 0, "atlasexilesboss": 0, "breachboss": 0, "affliction": 0, "bestiary": 0, "abyssleague": 0, "labyrinth_trials": 0, "mapsidearea": 0} + Else parse := {"mapworlds": 0, "maven": 0, "betrayal": 0, "incursion": 0, "heist": "heisthub", "mapatziri": 0, "legionleague": 0, "expedition": 0, "atlasexilesboss": 0, "breachboss": 0, "affliction": 0, "bestiary": 0, "sanctum": "sanctumfoyer", "abyssleague": 0, "labyrinth_trials": 0, "mapsidearea": 0} For key, val in parse If InStr(vars.log.areaID, key) && (!val || val && !InStr(vars.log.areaID, val)) @@ -625,21 +625,16 @@ MaptrackerParseDialogue(line) { local global vars, settings - static ignore, blight, delirium, expedition, harvest, incursion, bestiary, betrayal, delve + static blight, delirium, expedition, harvest, incursion, bestiary, betrayal, delve If !IsObject(ignore) { - ignore := ["You have entered"] - blight := ["sister cassia"], delirium := ["strange voice"], expedition := ["dannig, warrior skald", "gwennen, the gambler", "rog", "tujen, the haggler"], harvest := ["oshabi"], incursion := ["alva, master explorer"], bestiary := ["einhar, beastmaster"], delve := ["niko, master of the depths"] - betrayal := ["jun, veiled master", "aisling laffrey, the silent butcher", "cameria the coldblooded", "elreon, light's judge", "gravicius reborn", "guff ""tiny"" grenn", "haku, warmaster", "hillock, the blacksmith", "it that fled", "janus perandus", "thane jorgin the banished", "korell goya, son of stone", "leo, wolf of the pits", "riker maloney, midnight tinkerer", "rin yuushu", "tora, the culler", "vagan, victory's herald", "vorici, silent brother"] + blight := [vars.lang.cassia.1], delirium := [vars.lang["strange voice"].1], expedition := [vars.lang.dannig.1, vars.lang.gwennen.1, vars.lang.rog.1, vars.lang.tujen.1], harvest := [vars.lang.oshabi.1], incursion := [vars.lang.alva.1], bestiary := [vars.lang.einhar.1], delve := [vars.lang.niko.1] + betrayal := [vars.lang.jun.1, vars.lang.aisling.1, vars.lang.cameria.1, vars.lang.elreon.1, vars.lang.gravicius.1, vars.lang.guff.1, vars.lang.haku.1, vars.lang.hillock.1, vars.lang.it.1, vars.lang.janus.1, vars.lang.jorgin.1, vars.lang.korell.1, vars.lang.leo.1, vars.lang.riker.1, vars.lang.rin.1, vars.lang.tora.1, vars.lang.vagan.1, vars.lang.vorici.1] } - For index, skip in ignore - If InStr(line, skip, 1) ;skip certain key words/phrases to avoid erroneous tracking - Return - For mechanic, type in vars.maptracker.mechanics - If (type = 1) && (InStr(vars.log.areaID, mechanic) || (mechanic = "delirium") && InStr(vars.log.areaID, "affliction") || InStr(vars.log.areaID, "maven") || InStr(vars.log.areaID, "heist")) ;don't track contents in league-specific instances (logbook, temple, syndicate hideouts, heists, etc.) + If (type = 1) && (InStr(vars.log.areaID, mechanic) || (mechanic = "delirium") && InStr(vars.log.areaID, "affliction") || InStr(vars.log.areaID, "maven") || InStr(vars.log.areaID, "heist") || InStr(vars.log.areaID, "sanctum")) ;don't track contents in league-specific instances (logbook, temple, syndicate hideouts, heists, etc.) Return For mechanic, type in vars.maptracker.mechanics @@ -647,7 +642,7 @@ MaptrackerParseDialogue(line) If (type != 1) || !settings.maptracker[mechanic] || LLK_HasVal(vars.maptracker.map.content, mechanic) Continue For index, identifier in %mechanic% - If InStr(line, " " identifier ": ") + If InStr(line, identifier, 1) { vars.maptracker.map.content.Push(mechanic) Return @@ -660,13 +655,14 @@ MaptrackerReminder() local global vars, settings - ;missable_content := ["incursion", "delve", "betrayal", "ritual", "metamorph"], check := 0 + ignore := ["(vaal area)", "abyssal depths", "lab trial"] Clipboard := "" SendInput, ^{c} ClipWait, 0.05 - ;For index, content in missable_content - ; check += LLK_HasVal(vars.maptracker.map.content, content) ? 1 : 0 - If InStr(Clipboard, "`r`nportal scroll`r`n") ;&& check + For index, mechanic in ignore + If LLK_HasVal(vars.maptracker.map.content, mechanic, 1) + Return + If InStr(Clipboard, "`r`nportal scroll`r`n") LLK_ToolTip("double-check`nmap content!", 3,,,, "aqua", settings.general.fSize + 4,,, 1) } @@ -737,7 +733,7 @@ MaptrackerTimer() Else { vars.maptracker.map.name := !vars.maptracker.map.name ? (StrMatch(vars.log.areaID, "expedition") ? "logbook: " : "") vars.log.areaname : vars.maptracker.map.name ;areaID and areaname are sometimes parsed on two different loop-ticks, so it has to be declared separately here - If (vars.maptracker.map.id != vars.log.areaID || vars.maptracker.map.seed != vars.log.areaseed) && !MaptrackerCheck(1) ;entering a new map + If !MaptrackerCheck(1) && (vars.maptracker.map.id != vars.log.areaID || !InStr(vars.log.areaID, "sanctum") && vars.maptracker.map.seed != vars.log.areaseed) ;entering a new map MaptrackerSave(), new := 1 vars.maptracker.map.portals += vars.maptracker.hideout && !new ? 1 : 0 ;entering through a portal from hideout? -> increase portal-count @@ -762,6 +758,6 @@ MaptrackerTowncheck() local global vars, settings - If InStr(vars.log.areaID, "hideout") || InStr(vars.log.areaID, "heisthub") || InStr(vars.log.areaID, "menagerie") + If InStr(vars.log.areaID, "hideout") || InStr(vars.log.areaID, "heisthub") || InStr(vars.log.areaID, "menagerie") || InStr(vars.log.areaID, "sanctumfoyer") Return 1 } diff --git a/modules/settings menu.ahk b/modules/settings menu.ahk index 55af8cbb..5090211b 100644 --- a/modules/settings menu.ahk +++ b/modules/settings menu.ahk @@ -655,7 +655,7 @@ Settings_general() Gui, %GUI%: Add, Text, % "xs Section HWNDhwnd c"(vars.log.level ? "Lime" : settings.general.character? "Yellow" : "Red"), % "active character: " vars.hwnd.settings.character_text := hwnd, vars.hwnd.help_tooltips["settings_active character status"] := hwnd Gui, %GUI%: Font, % "s"settings.general.fSize - 4 - Gui, %GUI%: Add, Edit, % "ys x+0 cBlack wp r1 hp gSettings_general2 HWNDhwnd", % settings.general.character + Gui, %GUI%: Add, Edit, % "ys x+0 cBlack wp r1 hp gSettings_general2 HWNDhwnd", % LLK_StringCase(settings.general.character) If vars.log.level Gui, %GUI%: Add, Text, % "ys x+-1 hp 0x200 Center Border", % " lvl " vars.log.level " " Gui, %GUI%: Font, % "s"settings.general.fSize @@ -665,11 +665,26 @@ Settings_general() } Gui, %GUI%: Font, bold underline - Gui, %GUI%: Add, Text, % "xs Section y+"vars.settings.spacing, % "game-window settings:" + Gui, %GUI%: Add, Text, % "xs Section y+"vars.settings.spacing, % "game-client settings:" Gui, %GUI%: Font, norm Gui, %GUI%: Add, Text, % "ys Border HWNDhwnd gSettings_general2", % " apply && restart " - vars.hwnd.settings.apply := hwnd + vars.hwnd.settings.apply := hwnd, check := "" + Loop, Files, data\lang_* + parse := SubStr(A_LoopFileName, InStr(A_LoopFileName, "_") + 1), parse := LLK_StringCase(StrReplace(parse, ".txt")), check .= parse "|" + + If (LLK_InStrCount(check, "|") > 1) + { + parse := 0 + Loop, Parse, check, | + parse := (StrLen(A_LoopField) > parse) ? StrLen(A_LoopField) : parse + Gui, %GUI%: Add, Text, % "xs Section", % "language: " + Gui, %GUI%: Font, % "s"settings.general.fSize - 4 + Gui, %GUI%: Add, DDL, % "ys x+0 HWNDhwnd gSettings_general2 r"LLK_InStrCount(check, "|") " w"settings.general.fWidth * parse + settings.general.fWidth, % StrReplace(check, settings.general.lang, settings.general.lang "|") + vars.hwnd.settings.language := hwnd + Gui, %GUI%: Font, % "s"settings.general.fSize + } + Gui, %GUI%: Add, Text, % "xs Section", % "detected mode: " Gui, %GUI%: Add, Text, % "ys x+0 cAqua HWNDhwnd w"settings.general.fwidth* 20, % (vars.client.fullscreen = "true") ? "windowed fullscreen" : !vars.client.borderless ? "windowed" : "borderless windowed" vars.hwnd.settings.window_mode := hwnd @@ -822,10 +837,6 @@ Settings_general2(cHWND := "") IniWrite, general, ini\config.ini, versions, reload settings Reload ExitApp - Case "hide": - IniWrite, % LLK_ControlGet(cHWND), ini\config.ini, UI, hide panel - settings.general.hide_button := LLK_ControlGet(cHWND) - Init_GUI() Case "character": GuiControl, +cRed, % vars.hwnd.settings.character GuiControl, movedraw, % vars.hwnd.settings.character @@ -840,6 +851,9 @@ Settings_general2(cHWND := "") If WinExist("ahk_id "vars.hwnd.leveltracker.main) GuiControl, text, % vars.hwnd.leveltracker.experience, % LeveltrackerExperience() Settings_menu("general") + Case "language": + GuiControl, +cRed, % vars.hwnd.settings.apply + GuiControl, movedraw, % vars.hwnd.settings.apply Case "custom_width": GuiControl, +cRed, % vars.hwnd.settings.apply GuiControl, movedraw, % vars.hwnd.settings.apply @@ -859,6 +873,7 @@ Settings_general2(cHWND := "") IniWrite, % height, ini\config.ini, Settings, custom-resolution IniWrite, % width, ini\config.ini, Settings, custom-width IniWrite, % LLK_ControlGet(vars.hwnd.settings.remove_borders), ini\config.ini, settings, remove window-borders + IniWrite, % LLK_ControlGet(vars.hwnd.settings.language), ini\config.ini, settings, language If vars.hwnd.settings.blackbars IniWrite, % LLK_ControlGet(vars.hwnd.settings.blackbars), ini\config.ini, Settings, black-bar compensation IniWrite, % vars.settings.active, ini\config.ini, Versions, reload settings From 557c2f5f7c9c8d369983008fa861c313e98e14d4 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 07:44:33 +0200 Subject: [PATCH 03/11] v1.50.8 initial --- Lailloken UI.ahk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Lailloken UI.ahk b/Lailloken UI.ahk index 5db48b36..9174c00f 100644 --- a/Lailloken UI.ahk +++ b/Lailloken UI.ahk @@ -83,6 +83,7 @@ Return #Include modules\hotkeys.ahk #Include *i modules\hotkeys custom.ahk #Include modules\item-checker.ahk +#Include modules\languages.ahk #Include modules\leveling tracker.ahk #Include modules\map-info.ahk #Include modules\map tracker.ahk @@ -522,6 +523,7 @@ Init_vars() vars.cheatsheets := {} vars.client := {} vars.leveltracker := {} + vars.lang := {} vars.log := {} ;store data related to the game's log here vars.mapinfo := {} vars.hwnd := {"help_tooltips": {}} @@ -723,7 +725,7 @@ RightClick() { local global vars, settings - + If GetKeyState("LButton", "P") Return vars.system.click := 2 @@ -888,6 +890,7 @@ Startup() sleep 4000 Init_client() + Init_lang() vars.hwnd.poe_client := WinExist("ahk_group poe_window") ;save the client's handle vars.general.runcheck := A_TickCount ;save when the client was last running (for purposes of killing the script after X minutes) @@ -1238,7 +1241,7 @@ LLK_Error(ErrorMessage, restart := 0) LLK_FileCheck() { - If !FileExist("data\Resolutions.ini") || !FileExist("data\Class_CustomFont.ahk") || !FileExist("data\Fontin-SmallCaps.ttf") || !FileExist("data\JSON.ahk") || !FileExist("data\External Functions.ahk") || !FileExist("data\Map mods.ini") || !FileExist("data\Betrayal.json") || !FileExist("data\Atlas.ini") || !FileExist("data\timeless jewels\") || !FileExist("data\leveling tracker\") + If !FileExist("data\Resolutions.ini") || !FileExist("data\Class_CustomFont.ahk") || !FileExist("data\Fontin-SmallCaps.ttf") || !FileExist("data\JSON.ahk") || !FileExist("data\External Functions.ahk") || !FileExist("data\Map mods.ini") || !FileExist("data\Betrayal.json") || !FileExist("data\Atlas.ini") || !FileExist("data\timeless jewels\") || !FileExist("data\leveling tracker\") || !FileExist("data\lang_english.txt") Return 0 Else Return 1 } @@ -1261,12 +1264,13 @@ LLK_FilePermissionError(issue, folder) MsgBox, % text } -LLK_FileRead(file) +LLK_FileRead(file, keep_case := 0) { local FileRead, read, % file - StringLower, read, read + If !keep_case + StringLower, read, read Return read } From ebd69c8c0ecd3a5e7b0632fef4f5635c705bfa4c Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 09:06:24 +0200 Subject: [PATCH 04/11] tweaked language file --- data/lang_english.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/data/lang_english.txt b/data/lang_english.txt index 1851758a..0f09e30f 100644 --- a/data/lang_english.txt +++ b/data/lang_english.txt @@ -4,6 +4,9 @@ ; the script ignores lines that start with a semicolon ; this lang_english text-file can be used as a template to create new language-files +; feel free to publish your translation files in the Lailloken UI discussions section or your own GitHub repository +; I kindly ask you not to publish them as part of a Lailloken UI fork (imho, a translation for which I have laid the groundwork does not warrant a separate fork) + ; make a __COPY__ of this file, then rename the __COPY__ to lang_XYZ (XYZ will be displayed in the drop-down menu in the section of the settings menu, and it will also be used as a suffix for other required files, e.g. Betrayal-info data) ; the next time you restart the script, there should be a drop-down list with languages in the section of the settings menu ; I know enough German to supply some edge-case examples/requirements for syntax-structures that differ from English, but not enough to add complete support for German game-clients @@ -33,6 +36,19 @@ +;##################################################### +; credits: translators +;##################################################### + +; these names will be shown when hovering over the translator label next to the drop-down list in the settings menu + translator = "lailloken" +; translator = "0" +; translator = "0" +; translator = "0" +; translator = "0" + + + ;##################################################### ; general: character tracking ;##################################################### From fca8d66de65a63ac9117924e0327b6f5f35478a2 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 09:06:49 +0200 Subject: [PATCH 05/11] tweaked translations --- modules/languages.ahk | 1 + modules/settings menu.ahk | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/languages.ahk b/modules/languages.ahk index fb65a7d2..8917ad36 100644 --- a/modules/languages.ahk +++ b/modules/languages.ahk @@ -20,6 +20,7 @@ vars.lang[key] := [] vars.lang[key].Push(val) } + vars.help.settings["lang translators"] := vars.lang.translator.Clone() } LangLineParse(line, array) diff --git a/modules/settings menu.ahk b/modules/settings menu.ahk index 5090211b..c6d2d34f 100644 --- a/modules/settings menu.ahk +++ b/modules/settings menu.ahk @@ -680,9 +680,10 @@ Settings_general() parse := (StrLen(A_LoopField) > parse) ? StrLen(A_LoopField) : parse Gui, %GUI%: Add, Text, % "xs Section", % "language: " Gui, %GUI%: Font, % "s"settings.general.fSize - 4 - Gui, %GUI%: Add, DDL, % "ys x+0 HWNDhwnd gSettings_general2 r"LLK_InStrCount(check, "|") " w"settings.general.fWidth * parse + settings.general.fWidth, % StrReplace(check, settings.general.lang, settings.general.lang "|") - vars.hwnd.settings.language := hwnd + Gui, %GUI%: Add, DDL, % "ys x+0 HWNDhwnd0 gSettings_general2 r"LLK_InStrCount(check, "|") " w"settings.general.fWidth * parse + settings.general.fWidth, % StrReplace(check, settings.general.lang, settings.general.lang "|") Gui, %GUI%: Font, % "s"settings.general.fSize + Gui, %GUI%: Add, Text, % "ys HWNDhwnd x+"settings.general.fWidth, (translators) + vars.hwnd.settings.language := hwnd0, vars.hwnd.help_tooltips["settings_lang translators"] := hwnd } Gui, %GUI%: Add, Text, % "xs Section", % "detected mode: " From d4ca485c52207a1408bc0b553f215a899a2d1665 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 09:07:09 +0200 Subject: [PATCH 06/11] tweaked translations --- Lailloken UI.ahk | 1 + 1 file changed, 1 insertion(+) diff --git a/Lailloken UI.ahk b/Lailloken UI.ahk index 9174c00f..1ff410f8 100644 --- a/Lailloken UI.ahk +++ b/Lailloken UI.ahk @@ -230,6 +230,7 @@ HelpToolTip(HWND_key) WinGetPos, xWin, yWin, wWin,, % "ahk_id "vars.hwnd[(HWND_checks[check] = 0) ? check : HWND_checks[check]].main If (check = "lab" && InStr(control, "square")) vars.help.lab[control] := [vars.lab.compass.rooms[StrReplace(control, "square")].name] + tooltip_width := (check = "settings") ? vars.settings.w - vars.settings.wSelection : (wWin - 2) * (check = "cheatsheets" && vars.cheatsheet_menu.type = "advanced" || check = "seed-explorer" ? 0.5 : 1) If !tooltip_width Return From dd08c2956d3d8683c1775e20ca2fdf79e6998949 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:31:32 +0200 Subject: [PATCH 07/11] tweaked translations & tooltips --- data/help tooltips.json | 8 ++++++-- data/lang_english.txt | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/data/help tooltips.json b/data/help tooltips.json index 87958c6a..2ddc8a0d 100644 --- a/data/help tooltips.json +++ b/data/help tooltips.json @@ -32,7 +32,7 @@ ], "active character status": [ "red: no name specified", - "yellow: char not found / waiting for level 2", + "yellow: char not found / waiting for level-up", "green: char found, tracking active" ], "force resolution": [ @@ -85,7 +85,7 @@ ], "cheatsheets modifier-key": [ "cheat sheets are activated by pressing the modifier and omni-key simultaneously", - "if a sheet is configured as , only the omni-key has to be held down", + "if a sheet is configured as , only the omni-key has to be held down", "pick a combination that is not used in game" ], "cheatsheets color": [ @@ -228,6 +228,9 @@ "single-click solution to mark larger mod groups as un/desired", "the name specifies which mods are affected, the color whether they'll be set to un/desired" ], + "lang unavailable": [ + "this feature is currently not available on non-english clients" + ], "leveltracker enable": [ "provides an automated leveling guide overlay and several campaign qol-tools" ], @@ -321,6 +324,7 @@ ], "maptracker loot-tracker": [ "items you ctrl-click into the stash will be logged", + "ctrl-rightclick will remove previously added items one by one", "requires the image-check to be set up correctly in the menu" ], "maptracker kill-tracker": [ diff --git a/data/lang_english.txt b/data/lang_english.txt index 0f09e30f..2e4eb007 100644 --- a/data/lang_english.txt +++ b/data/lang_english.txt @@ -104,4 +104,12 @@ dannig = "Dannig, Warrior Skald:" gwennen = "Gwennen, the Gambler:" rog = "Rog:" - tujen = "Tujen, the Haggler:" \ No newline at end of file + tujen = "Tujen, the Haggler:" + + + +;##################################################### +; mapping tracker: item names +;##################################################### + + portal = "portal scroll" \ No newline at end of file From 2c52ba773bf0a0a65851ea93f9ac7dc9641dc828 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:34:14 +0200 Subject: [PATCH 08/11] translation tweaks --- modules/client log.ahk | 2 +- modules/languages.ahk | 4 ++-- modules/map tracker.ahk | 6 +++--- modules/settings menu.ahk | 24 ++++++++++++++++++++---- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/modules/client log.ahk b/modules/client log.ahk index ef3d4d4a..3c45340d 100644 --- a/modules/client log.ahk +++ b/modules/client log.ahk @@ -5,7 +5,7 @@ If !IsObject(vars.log.file) { - vars.log.file := FileOpen(vars.log.file_location, "r") + vars.log.file := FileOpen(vars.log.file_location, "r", "UTF-8") log_content := vars.log.file.Read() } Else FileRead, log_content, % vars.log.file_location diff --git a/modules/languages.ahk b/modules/languages.ahk index 8917ad36..44cabe7d 100644 --- a/modules/languages.ahk +++ b/modules/languages.ahk @@ -4,7 +4,7 @@ global vars, settings, Json lang := LLK_IniRead("ini\config.ini", "settings", "language", "english"), lang := !FileExist("data\lang_"lang ".txt") ? "english" : lang, settings.general.lang := lang - Loop, Parse, % StrReplace(LLK_FileRead("data\lang_"settings.general.lang ".txt", 1), "`t"), `n, `r + Loop, Parse, % StrReplace(LLK_FileRead("data\lang_"settings.general.lang ".txt", 1, "65001"), "`t"), `n, `r { If Blank(A_LoopField) || (SubStr(A_LoopField, 1, 1) = ";") Continue @@ -46,7 +46,7 @@ LangLineTrim(line, array, location := 0) local global vars, settings - location := location ? vars.lang.location_identifier.1 : "" + location := location ? vars.lang.location.1 : "" For index, segment in array line := StrReplace(line, segment,,, 1) While InStr(" "location, SubStr(line, 1, 1)) diff --git a/modules/map tracker.ahk b/modules/map tracker.ahk index efa9d59d..88376b8d 100644 --- a/modules/map tracker.ahk +++ b/modules/map tracker.ahk @@ -5,9 +5,9 @@ settings.features.maptracker := LLK_IniRead("ini\config.ini", "Features", "enable map tracker", 0) - settings.maptracker := {"loot": LLK_IniRead("ini\map tracker.ini", "Settings", "enable loot tracker", 0)} + settings.maptracker := {"loot": (settings.general.lang != "english") ? 0 : LLK_IniRead("ini\map tracker.ini", "Settings", "enable loot tracker", 0)} settings.maptracker.kills := LLK_IniRead("ini\map tracker.ini", "Settings", "enable kill tracker", 0) - settings.maptracker.mapinfo := LLK_IniRead("ini\map tracker.ini", "Settings", "log mods from map-info panel", 0) + settings.maptracker.mapinfo := (settings.general.lang != "english") ? 0 : LLK_IniRead("ini\map tracker.ini", "Settings", "log mods from map-info panel", 0) settings.maptracker.fSize := LLK_IniRead("ini\map tracker.ini", "Settings", "font-size", settings.general.fSize) LLK_FontDimensions(settings.maptracker.fSize, height, width) settings.maptracker.fWidth := width, settings.maptracker.fHeight := height @@ -662,7 +662,7 @@ MaptrackerReminder() For index, mechanic in ignore If LLK_HasVal(vars.maptracker.map.content, mechanic, 1) Return - If InStr(Clipboard, "`r`nportal scroll`r`n") + If InStr(Clipboard, "`r`n"vars.lang.portal) LLK_ToolTip("double-check`nmap content!", 3,,,, "aqua", settings.general.fSize + 4,,, 1) } diff --git a/modules/settings menu.ahk b/modules/settings menu.ahk index c6d2d34f..2ac96261 100644 --- a/modules/settings menu.ahk +++ b/modules/settings menu.ahk @@ -1752,14 +1752,20 @@ Settings_maptracker() Gui, %GUI%: Font, bold underline Gui, %GUI%: Add, Text, % "xs Section Center y+"vars.settings.spacing, general settings: Gui, %GUI%: Font, norm - Gui, %GUI%: Add, Checkbox, % "xs Section gSettings_maptracker2 HWNDhwnd Checked"settings.maptracker.loot, enable loot tracker - vars.hwnd.settings.loot := vars.hwnd.help_tooltips["settings_maptracker loot-tracker"] := hwnd + Gui, %GUI%: Add, Checkbox, % "xs Section gSettings_maptracker2 HWNDhwnd Checked"settings.maptracker.loot (settings.general.lang != "english" ? " cGray" : ""), enable loot tracker + vars.hwnd.settings.loot := hwnd + If (settings.general.lang = "english") + vars.hwnd.help_tooltips["settings_maptracker loot-tracker"] := hwnd + Else vars.hwnd.help_tooltips["settings_lang unavailable"] := hwnd Gui, %GUI%: Add, Checkbox, % "xs Section gSettings_maptracker2 HWNDhwnd Checked"settings.maptracker.kills, enable kill tracker vars.hwnd.settings.kills := vars.hwnd.help_tooltips["settings_maptracker kill-tracker"] := hwnd If settings.features.mapinfo { - Gui, %GUI%: Add, Checkbox, % "xs Section gSettings_maptracker2 HWNDhwnd Checked"settings.maptracker.mapinfo, include map-info panel mods - vars.hwnd.settings.mapinfo := vars.hwnd.help_tooltips["settings_maptracker mapinfo"] := hwnd + Gui, %GUI%: Add, Checkbox, % "xs Section gSettings_maptracker2 HWNDhwnd Checked"settings.maptracker.mapinfo (settings.general.lang != "english" ? " cGray" : ""), include map-info panel mods + vars.hwnd.settings.mapinfo := hwnd + If (settings.general.lang = "english") + vars.hwnd.help_tooltips["settings_maptracker mapinfo"] := hwnd + Else vars.hwnd.help_tooltips["settings_lang unavailable|"] := hwnd } Gui, %GUI%: Add, Checkbox, % "xs Section gSettings_maptracker2 HWNDhwnd Checked"settings.maptracker.sidecontent, track side-areas in maps vars.hwnd.settings.sidecontent := vars.hwnd.help_tooltips["settings_maptracker side-content"] := hwnd @@ -1834,6 +1840,11 @@ Settings_maptracker2(cHWND) Init_GUI("maptracker") Settings_menu("mapping tracker") Case "loot": + If (settings.general.lang != "english") + { + GuiControl,, % cHWND, 0 + Return + } settings.maptracker.loot := LLK_ControlGet(cHWND) IniWrite, % settings.maptracker.loot, ini\map tracker.ini, settings, enable loot tracker Settings_ScreenChecksValid() @@ -1841,6 +1852,11 @@ Settings_maptracker2(cHWND) settings.maptracker.kills := LLK_ControlGet(cHWND), vars.maptracker.refresh_kills := "" IniWrite, % settings.maptracker.kills, ini\map tracker.ini, settings, enable kill tracker Case "mapinfo": + If (settings.general.lang != "english") + { + GuiControl,, % cHWND, 0 + Return + } settings.maptracker.mapinfo := LLK_ControlGet(cHWND) IniWrite, % settings.maptracker.mapinfo, ini\map tracker.ini, settings, log mods from map-info panel Case "sidecontent": From 57d6fb9f95132544c84f7547444dd7632398d9d6 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:37:27 +0200 Subject: [PATCH 09/11] translation tweaks --- data/lang_english.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/lang_english.txt b/data/lang_english.txt index 2e4eb007..bee739eb 100644 --- a/data/lang_english.txt +++ b/data/lang_english.txt @@ -112,4 +112,4 @@ ; mapping tracker: item names ;##################################################### - portal = "portal scroll" \ No newline at end of file + portal = "Portal Scroll" \ No newline at end of file From 0c877f8786f18eed908e9f58c18c39b1a554c843 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:37:49 +0200 Subject: [PATCH 10/11] translation tweaks --- modules/map tracker.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/map tracker.ahk b/modules/map tracker.ahk index 88376b8d..7e87185f 100644 --- a/modules/map tracker.ahk +++ b/modules/map tracker.ahk @@ -662,7 +662,7 @@ MaptrackerReminder() For index, mechanic in ignore If LLK_HasVal(vars.maptracker.map.content, mechanic, 1) Return - If InStr(Clipboard, "`r`n"vars.lang.portal) + If InStr(Clipboard, "`r`n"vars.lang.portal, 1) LLK_ToolTip("double-check`nmap content!", 3,,,, "aqua", settings.general.fSize + 4,,, 1) } From d9ff1e7362e139c5269aecce5f76034e274b8d24 Mon Sep 17 00:00:00 2001 From: Lailloken <61888437+Lailloken@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:38:23 +0200 Subject: [PATCH 11/11] v1.50.8 finalizing --- Lailloken UI.ahk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lailloken UI.ahk b/Lailloken UI.ahk index 1ff410f8..2f3c5ec1 100644 --- a/Lailloken UI.ahk +++ b/Lailloken UI.ahk @@ -1265,11 +1265,11 @@ LLK_FilePermissionError(issue, folder) MsgBox, % text } -LLK_FileRead(file, keep_case := 0) +LLK_FileRead(file, keep_case := 0, encoding := "") { local - FileRead, read, % file + FileRead, read, % (!Blank(encoding) ? "*P"encoding " " : "") file If !keep_case StringLower, read, read Return read