From 8584f599c7dd40037bddeb36955dd8cd7398b1cb Mon Sep 17 00:00:00 2001 From: denjifb <143030907+denjifb@users.noreply.github.com> Date: Fri, 12 Dec 2025 19:51:02 +0300 Subject: [PATCH 1/2] hedit: fix missing translations and apply various improvements --- .../hedit/client/gui/languages/arabic.lua | 17 +++- .../hedit/client/gui/languages/english.lua | 16 +++- .../hedit/client/gui/languages/german.lua | 16 +++- .../hedit/client/gui/languages/hungarian.lua | 16 +++- .../hedit/client/gui/languages/polish.lua | 30 ++++-- .../hedit/client/gui/languages/portuguese.lua | 28 ++++-- .../hedit/client/gui/languages/russian.lua | 17 +++- .../hedit/client/gui/languages/spanish.lua | 16 +++- .../hedit/client/gui/languages/turkish.lua | 55 ++++++----- .../hedit/client/gui/templates/default.lua | 95 ++++--------------- [gameplay]/hedit/client/gui/warningwnd.lua | 6 +- [gameplay]/hedit/client/utils.lua | 77 +++++++++++---- 12 files changed, 227 insertions(+), 162 deletions(-) diff --git a/[gameplay]/hedit/client/gui/languages/arabic.lua b/[gameplay]/hedit/client/gui/languages/arabic.lua index 554055f10..323e69229 100644 --- a/[gameplay]/hedit/client/gui/languages/arabic.lua +++ b/[gameplay]/hedit/client/gui/languages/arabic.lua @@ -62,6 +62,14 @@ guiLanguage.arabic = { warning = "تحذير!", error = "خلل!" }, + + --Warning button strings + warningButtons = { + yes = "نعم", + no = "لا", + ok = "حسناً", + }, + --Strings for the buttons at the top menubar = { handling = "وزانية", @@ -151,13 +159,14 @@ guiLanguage.arabic = { shortname = "محفوظات", longname = "حمل او احفظ اعدادات وزانية", itemtext = { - nameLabel = "اسم", - descriptionLabel = "وصف", saveButton = "حفظ", loadButton = "حمل", + deleteButton = "حذف", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn ="اسم", + modelColumn = "نموذج", + nameEdit = "اسم", + descriptionEdit = "وصف" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/english.lua b/[gameplay]/hedit/client/gui/languages/english.lua index 81678639e..c960e224c 100644 --- a/[gameplay]/hedit/client/gui/languages/english.lua +++ b/[gameplay]/hedit/client/gui/languages/english.lua @@ -62,6 +62,14 @@ guiLanguage.english = { warning = "Warning!", error = "Error!" }, + + --Warning button strings + warningButtons = { + yes = "Yes", + no = "No", + ok = "Ok", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -151,14 +159,14 @@ guiLanguage.english = { shortname = "Saves", longname = "Load or save handling settings.", itemtext = { - nameLabel = "Name", - descriptionLabel = "Description", saveButton = "Save", loadButton = "Load", deleteButton = "Delete", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Name", + modelColumn = "Model", + nameEdit = "Name", + descriptionEdit = "Description" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/german.lua b/[gameplay]/hedit/client/gui/languages/german.lua index 28ad28657..87a03ec9b 100644 --- a/[gameplay]/hedit/client/gui/languages/german.lua +++ b/[gameplay]/hedit/client/gui/languages/german.lua @@ -62,6 +62,14 @@ guiLanguage.german = { warning = "Warnung!", error = "Fehler!" }, + + --Warning button strings + warningButtons = { + yes = "Ja", + no = "Nein", + ok = "OK", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -151,14 +159,14 @@ guiLanguage.german = { shortname = "Speichern", longname = "Fahreinstellungen laden oder speichern.", itemtext = { - nameLabel = "Name", - descriptionLabel = "Beschreibung", saveButton = "Speichern", loadButton = "Laden", deleteButton = "Löschen", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Name", + modelColumn = "Modell", + nameEdit = "Name", + descriptionEdit = "Beschreibung" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/hungarian.lua b/[gameplay]/hedit/client/gui/languages/hungarian.lua index 8e0b500bf..65fa1b667 100644 --- a/[gameplay]/hedit/client/gui/languages/hungarian.lua +++ b/[gameplay]/hedit/client/gui/languages/hungarian.lua @@ -62,6 +62,14 @@ guiLanguage.hungarian = { warning = "Figyelmeztetés!", error = "Hiba!" }, + + --Warning button strings + warningButtons = { + yes = "Igen", + no = "Nem", + ok = "OK", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -151,14 +159,14 @@ guiLanguage.hungarian = { shortname = "Mentések", longname = "Töltsd be vagy mentsd el a handling beállításaidat.", itemtext = { - nameLabel = "Név", - descriptionLabel = "Leírás", saveButton = "Exportálás", loadButton = "Importálás", deleteButton = "Törlés", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Név", + modelColumn = "Modell", + nameEdit = "Név", + descriptionEdit = "Leírás" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/polish.lua b/[gameplay]/hedit/client/gui/languages/polish.lua index d93edf3e5..b28955aa3 100644 --- a/[gameplay]/hedit/client/gui/languages/polish.lua +++ b/[gameplay]/hedit/client/gui/languages/polish.lua @@ -62,6 +62,14 @@ guiLanguage.polish = { warning = "Uwaga!", error = "Blad!" }, + + --Warning button strings + warningButtons = { + yes = "Tak", + no = "Nie", + ok = "OK", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -115,11 +123,13 @@ guiLanguage.polish = { }, about = { shortname = "Informacje", - longname = "O edytorze handlingow", + longname = "O oficjalnym edytorze handlingu", itemtext = { - textlabel = "", - websitebox = "", - morelabel = "" + textlabel = "Witamy w oficjalnym edytorze handlingu MTA! Ten edytor pozwala zmieniać handling pojazdów w czasie rzeczywistym.\n\n" .. + "Możesz zapisywać i wczytywać ustawienia przez menu 'Handling' w lewym górnym rogu.\n\n" .. + "Więcej informacji – w tym changelog – znajdziesz tutaj:", + websitebox = "https://github.com/multitheftauto/mtasa-resources/tree/master/%5Bgameplay%5D/hedit", + morelabel = "\nDziękujemy za korzystanie z hedit!" } }, undo = { @@ -149,13 +159,14 @@ guiLanguage.polish = { shortname = "Zapisane", longname = "Wczytaj lub zapisz swoje ustawienia.", itemtext = { - nameLabel = "Nazwa", - descriptionLabel = "Opis", saveButton = "Zapisz", loadButton = "Wczytaj", + deleteButton = "Usuń", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Nazwa", + modelColumn = "Model", + nameEdit = "Nazwa", + descriptionEdit = "Opis" } }, import = { @@ -212,7 +223,8 @@ guiLanguage.polish = { edit_cmd = "", combo_commode = "", combo_language = "", - checkbox_lockwhenediting = "Zablokuj pojazd, kiedy edytujesz?" + checkbox_lockwhenediting = "Zablokuj pojazd, kiedy edytujesz?", + checkbox_dragmeterEnabled = "Użyj szybkiego strojenia", } }, handlinglog = { diff --git a/[gameplay]/hedit/client/gui/languages/portuguese.lua b/[gameplay]/hedit/client/gui/languages/portuguese.lua index 2a181ecb8..4888b7d0a 100644 --- a/[gameplay]/hedit/client/gui/languages/portuguese.lua +++ b/[gameplay]/hedit/client/gui/languages/portuguese.lua @@ -57,12 +57,20 @@ guiLanguage.portuguese = { -- --Warning level strings - -- warningtitles = { - -- info = "Informação", - -- question = "Pergunta", - -- warning = "Aviso!", - -- error = "Erro!" - -- }, + warningtitles = { + info = "Informação", + question = "Pergunta", + warning = "Aviso!", + error = "Erro!" + }, + + --Warning button strings + warningButtons = { + yes = "Sim", + no = "Não", + ok = "OK", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -152,14 +160,14 @@ guiLanguage.portuguese = { shortname = "Saves", longname = "Carregar ou salvar configurações de handling.", itemtext = { - nameLabel = "Nome", - descriptionLabel = "Descrição", saveButton = "Salvar", loadButton = "Carregar", deleteButton = "Excluir", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Nome", + modelColumn = "Modelo", + nameEdit = "Nome", + descriptionEdit = "Descrição" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/russian.lua b/[gameplay]/hedit/client/gui/languages/russian.lua index e5218894f..a498a3ec0 100644 --- a/[gameplay]/hedit/client/gui/languages/russian.lua +++ b/[gameplay]/hedit/client/gui/languages/russian.lua @@ -62,6 +62,14 @@ warning = "Предупреждение!", error = "Ошибка!" }, + + --Warning button strings + warningButtons = { + yes = "Да", + no = "Нет", + ok = "ОК", + }, + --Strings for the buttons at the top menubar = { handling = "Хэндлинг", @@ -152,13 +160,14 @@ shortname = "Сохранение", longname = "Сохранить или загрузить настройки хэндлинга.", itemtext = { - nameLabel = "Название", - descriptionLabel = "Описание", saveButton = "Сохранить", loadButton = "Загрузить", + deleteButton = "Удалить", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Название", + modelColumn = "модель", + nameEdit = "Название", + descriptionEdit = "Описание" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/spanish.lua b/[gameplay]/hedit/client/gui/languages/spanish.lua index 9162e8958..cf7101c5b 100644 --- a/[gameplay]/hedit/client/gui/languages/spanish.lua +++ b/[gameplay]/hedit/client/gui/languages/spanish.lua @@ -62,6 +62,14 @@ guiLanguage.spanish = { warning = "Aviso!", error = "Error!" }, + + --Warning button strings + warningButtons = { + yes = "Sí", + no = "No", + ok = "OK", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -151,14 +159,14 @@ guiLanguage.spanish = { shortname = "Saves", longname = "Cargar, guardar o eliminar handlings.", itemtext = { - nameLabel = "Nombre", - descriptionLabel = "Descripcion", saveButton = "Guardar", loadButton = "Cargar", deleteButton = "Borrar", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "Nombre", + modelColumn = "Modelo", + nameEdit = "Nombre", + descriptionEdit = "Descripcion" } }, import = { diff --git a/[gameplay]/hedit/client/gui/languages/turkish.lua b/[gameplay]/hedit/client/gui/languages/turkish.lua index d4b357eca..c4f223a54 100644 --- a/[gameplay]/hedit/client/gui/languages/turkish.lua +++ b/[gameplay]/hedit/client/gui/languages/turkish.lua @@ -33,15 +33,15 @@ guiLanguage.turkish = { confirmDelete = "Handling ayarlarını silmek istediğinizden emin misiniz?", confirmReset = "Handling ayarlarını sıfırlamak istediğinizden emin misiniz? Kaydedilmemiş tüm değişiklikler kaybolacak!", confirmImport = "Handling ayarlarını içe aktarmak istediğinizden emin misiniz? Kaydedilmemiş tüm değişiklikler kaybolacak!", - + successSave = "Handling ayarları başarılı bir şekilde kaydedildi!", successLoad = "Handling ayarları başarılı bir şekilde yüklendi!", successDelete = "Handling ayarlarınız başarılı bir şekilde silindi!", - wantTheSettings = "Bu ayarları uygulamak istediğinizden emin misiniz? Handling düzenleyici yeniden başlayacaktır.", + wantTheSettings = "Bu ayarları uygulamak istediğinizden emin misiniz? Handling düzenleyici yeniden başlayacaktır.", - vehicle = "Vehicle", - unsaved = "Unsaved", + vehicle = "Araç", + unsaved = "Kaydedilmedi", clickToEdit = "Düzenlemek için tıkla veya kaydır.", enterToSubmit = "Onaylamak için enter tuşuna basın.", @@ -62,6 +62,14 @@ guiLanguage.turkish = { warning = "Dikkat!", error = "Hata!" }, + + --Warning button strings + warningButtons = { + yes = "Evet", + no = "Hayır", + ok = "Tamam", + }, + --Strings for the buttons at the top menubar = { handling = "Handling", @@ -73,10 +81,10 @@ guiLanguage.turkish = { viewbuttons = { engine = "Motor", body = "Gövde", - wheels = "Tekerlekler", + wheels = "Tekerlek", appearance = "Görünüm", - modelflags = "Model\nSeçenekleri", - handlingflags = "Handling\nSeçenekleri", + modelflags = "Model\nSeç.", + handlingflags = "Handling\nSeç.", dynamometer = "Dyno", undo = "<", redo = ">", @@ -94,7 +102,7 @@ guiLanguage.turkish = { longname = "Gövde Ayarları" }, wheels = { - shortname = "Tekerlekler", + shortname = "Tekerlek", longname = "Tekerlek Ayarları" }, appearance = { @@ -114,14 +122,15 @@ guiLanguage.turkish = { longname = "Dinamometreyi Başlat" }, about = { - shortname = "About", - longname = "About the official handling editor", + shortname = "Hakkında", + longname = "Resmi handling düzenleyici hakkında", itemtext = { - textlabel = "Welcome to the official MTA handling editor! This resource allows you to edit the handling of any vehicle in-game in real time.\n\n".. - "You can save and load custom handlings you make through the 'Handling' menu in the top left corner.\n\n".. - "For more information about the handling editor - such as the official changelog - visit:", + textlabel = "Resmi MTA handling düzenleyicisine hoş geldiniz!\n\n".. + "Bu araç, oyundaki tüm araçların handling değerlerini gerçek zamanlı düzenlemenizi sağlar.\n\n".. + "Sol üstteki 'Araçlar' -> 'handling.cfg' menüsünden kendi ayarlarınızı kaydedebilir veya yükleyebilirsiniz.\n\n".. + "Daha fazla bilgi ve değişiklik kaydı için:", websitebox = "https://github.com/multitheftauto/mtasa-resources/tree/master/%5Bgameplay%5D/hedit", - morelabel = "\nThank you for choosing hedit!" + morelabel = "\nHedit'i seçtiğiniz için teşekkürler!" } }, undo = { @@ -139,7 +148,7 @@ guiLanguage.turkish = { } }, reset = { - shortname = "Sıfırla", + shortname = "Sıfırla", longname = "Bu aracın handling ayarlarını sıfırla.", itemtext = { label = "Sıfırlanacak Araç:", @@ -151,14 +160,14 @@ guiLanguage.turkish = { shortname = "Kayıtlar", longname = "Handling ayarlarını yükle veya kaydet.", itemtext = { - nameLabel = "İsim", - descriptionLabel = "Açıklama", saveButton = "Kaydet", loadButton = "Yükle", - deleteButton = "Sil", + deleteButton = "Sil", grid = "", - nameEdit = "", - descriptionEdit = "" + nameColumn = "İsim", + modelColumn = "Model", + nameEdit = "İsim", + descriptionEdit = "Açıklama" } }, import = { @@ -215,7 +224,7 @@ guiLanguage.turkish = { edit_cmd = "", combo_commode = "", combo_language = "", - checkbox_lockwhenediting = "Handling esnasında aracı kilitle?", + checkbox_lockwhenediting = "Handling esnasında aracı kilitle?", checkbox_dragmeterEnabled = "Hızlı ayar kullan" } }, @@ -354,7 +363,7 @@ guiLanguage.turkish = { syntax = { "Float", "Bu özelliğin neyi etkilediği bilinmemektedir." } }, ["suspensionHighSpeedDamping"] = { - friendlyName = "Süspansiyon Yüksek Hızlı Sönümleme", + friendlyName = "Süspansiyon Yüksek Hız Sönüm.", information = "Süspansiyonunuzun sertliğini değiştirerek daha hızlı sürmenize neden olur.", syntax = { "Float", "Bu özelliğin etkisi test edilmemiştir." } -- HERE {UNTESTED} }, @@ -432,7 +441,7 @@ guiLanguage.turkish = { ["1"] = {"AXLE_R_NOTILT","Arka tekerleklerin araca dikey kalmasını sağlar (GTA 3 gibi)."}, ["2"] = {"AXLE_R_SOLID","Arka tekerleklerin birbirine paralel kalmasını sağlar."}, ["4"] = {"AXLE_R_MCPHERSON","Arka tekerleklerin devrilmesini sağlar (GTA Vice City gibi)."}, - ["8"] = {"AXLE_R_REVERSE","rka tekerleklerin ters yönde eğilmesini sağlar."} + ["8"] = {"AXLE_R_REVERSE","Arka tekerleklerin ters yönde eğilmesini sağlar."} }, { ["1"] = {"IS_BIKE","Bisikletler bölümündeki ekstra ayarları kullanın."}, diff --git a/[gameplay]/hedit/client/gui/templates/default.lua b/[gameplay]/hedit/client/gui/templates/default.lua index 82885b061..72d108ff1 100644 --- a/[gameplay]/hedit/client/gui/templates/default.lua +++ b/[gameplay]/hedit/client/gui/templates/default.lua @@ -541,7 +541,7 @@ template.viewcontents = { websitebox = { type = "editbox", pos = { 73, 220 }, - size = { 290, 30 }, + size = { 284, 30 }, runfunction = function ( this ) this.enabled = false this.readOnly = true @@ -633,21 +633,9 @@ template.viewcontents = { requirelogin = false, requireadmin = false, onOpen = function ( content ) - guiGridListClear ( content.grid ) - - local saves = getClientSaves ( ) - for name,info in pairs ( saves ) do - local row = guiGridListAddRow ( content.grid ) - local model = getVehicleNameFromModel ( tonumber ( info.model ) ) - guiGridListSetItemText ( content.grid, row, 1, info.name, false, false ) - guiGridListSetItemText ( content.grid, row, 2, model, false, false ) - end - - guiSetText ( content.nameEdit, "title" ) - guiSetText ( content.descriptionEdit, "description" ) - - guiBringToFront ( content.nameLabel ) - guiBringToFront ( content.descriptionLabel ) + refreshSavesGridlist() + guiSetText ( content.nameEdit, getText("viewinfo", "save", "itemtext", "nameEdit") ) + guiSetText ( content.descriptionEdit, getText("viewinfo", "save", "itemtext", "descriptionEdit") ) end, onClose = function ( content ) @@ -660,8 +648,8 @@ template.viewcontents = { pos = { 72, 83 }, size = { 285, 220 }, runfunction = function ( this ) - guiGridListAddColumn ( this, "Name", 0.5 ) - guiGridListAddColumn ( this, "Model", 0.4 ) + guiGridListAddColumn ( this, getText("viewinfo", "save", "itemtext", "nameColumn"), 0.5 ) + guiGridListAddColumn ( this, getText("viewinfo", "save", "itemtext", "modelColumn"), 0.4 ) end, events = { onClick = function ( this ) @@ -671,19 +659,13 @@ template.viewcontents = { local name = string.lower ( guiGridListGetItemText ( this, row, col ) ) local save = getClientSaves()[name] guiSetStaticInfoText ( save.name, save.description ) - guiSetVisible ( content.nameLabel, false ) - guiSetVisible ( content.descriptionLabel, false ) guiSetText ( content.nameEdit, save.name ) guiSetText ( content.descriptionEdit, save.description ) return true end guiResetStaticInfoText() - guiSetVisible ( content.nameLabel, true ) - guiSetVisible ( content.descriptionLabel, true ) - guiBringToFront ( content.nameLabel ) - guiBringToFront ( content.descriptionLabel ) - guiSetText ( content.nameEdit, "" ) - guiSetText ( content.descriptionEdit, "" ) + guiSetText ( content.nameEdit, getText("viewinfo", "save", "itemtext", "nameEdit") ) + guiSetText ( content.descriptionEdit, getText("viewinfo", "save", "itemtext", "descriptionEdit") ) end, onDoubleClick = function ( this ) @@ -714,14 +696,14 @@ template.viewcontents = { size = { 212, 25 }, events = { onFocus = function ( this ) - local content = heditGUI.viewItems.save.guiItems - guiSetVisible ( content.nameLabel, false ) + local placeholderText = getText("viewinfo", "save", "itemtext", "nameEdit") + if guiGetText(this) == placeholderText then + guiSetText(this, "") + end end, onBlur = function ( this ) if guiGetText ( this ) == "" then - local content = heditGUI.viewItems.save.guiItems - guiBringToFront ( content.nameLabel ) - guiSetVisible ( content.nameLabel, true ) + guiSetText ( this, getText("viewinfo", "save", "itemtext", "nameEdit") ) end end } @@ -732,54 +714,18 @@ template.viewcontents = { size = { 212, 25 }, events = { onFocus = function ( this ) - local content = heditGUI.viewItems.save.guiItems - guiSetVisible ( content.descriptionLabel, false ) + local placeholderText = getText("viewinfo", "save", "itemtext", "descriptionEdit") + if guiGetText(this) == placeholderText then + guiSetText(this, "") + end end, onBlur = function ( this ) if guiGetText ( this ) == "" then - local content = heditGUI.viewItems.save.guiItems - guiBringToFront ( content.descriptionLabel ) - guiSetVisible ( content.descriptionLabel, true ) + guiSetText ( this, getText("viewinfo", "save", "itemtext", "descriptionEdit") ) end end } }, - nameLabel = { - type = "label", - pos = { 80, 334 }, - size = { 50, 12 }, - runfunction = function ( this ) - guiLabelSetColor ( this, 0, 0, 0 ) - guiSetFont ( this, "default-small" ) - end, - events = { - onClick = function ( this ) - local content = heditGUI.viewItems.save.guiItems - - guiSetVisible ( this, false ) - guiBringToFront ( content.nameEdit ) - guiEditSetCaretIndex ( content.nameEdit, string.len ( guiGetText ( content.nameEdit ) ) ) - end - } - }, - descriptionLabel = { - type = "label", - pos = { 80, 359 }, - size = { 50, 12 }, - runfunction = function ( this ) - guiLabelSetColor ( this, 0, 0, 0 ) - guiSetFont ( this, "default-small" ) - end, - events = { - onClick = function ( this ) - local content = heditGUI.viewItems.save.guiItems - - guiSetVisible ( this, false ) - guiBringToFront ( content.descriptionEdit ) - guiEditSetCaretIndex ( content.descriptionEdit, string.len ( guiGetText ( content.descriptionEdit ) ) ) - end - } - }, saveButton = { type = "button", pos = { 289, 309 }, @@ -797,8 +743,7 @@ template.viewcontents = { local function func ( ) saveClientHandling ( pVehicle, name, description ) - guiShowView ( previousMenu ) - guiCreateWarningMessage ( getText ( "successSave" ), 3 ) + guiCreateWarningMessage ( getText ( "successSave" ), 3, {refreshSavesGridlist} ) end if isClientHandlingExisting ( name ) then @@ -854,7 +799,7 @@ template.viewcontents = { local function func ( ) if deleteClientHandling ( pVehicle, name ) then - guiCreateWarningMessage ( getText ( "successDelete" ), 3 ) + guiCreateWarningMessage ( getText ( "successDelete" ), 3, {refreshSavesGridlist} ) end end diff --git a/[gameplay]/hedit/client/gui/warningwnd.lua b/[gameplay]/hedit/client/gui/warningwnd.lua index 3b05664d4..ed6205d92 100644 --- a/[gameplay]/hedit/client/gui/warningwnd.lua +++ b/[gameplay]/hedit/client/gui/warningwnd.lua @@ -45,10 +45,10 @@ function guiCreateWarningMessage ( text, level, buttonAccept, buttonDecline ) local accept, decline if buttonDecline or level == 2 then - accept = guiCreateButton ( 114, 100, 136, 25, "Yes", false, warningWnd ) - decline = guiCreateButton ( 255, 100, 136, 25, "No", false, warningWnd ) + accept = guiCreateButton ( 114, 100, 136, 25, getText("warningButtons", "yes"), false, warningWnd ) + decline = guiCreateButton ( 255, 100, 136, 25, getText("warningButtons", "no"), false, warningWnd ) else - accept = guiCreateButton ( 114, 100, 277, 25, "Okay", false, warningWnd ) + accept = guiCreateButton ( 114, 100, 277, 25, getText("warningButtons", "ok"), false, warningWnd ) end diff --git a/[gameplay]/hedit/client/utils.lua b/[gameplay]/hedit/client/utils.lua index 9db3c8361..551756257 100644 --- a/[gameplay]/hedit/client/utils.lua +++ b/[gameplay]/hedit/client/utils.lua @@ -1,35 +1,52 @@ function getText ( ... ) - local entry = getUserLanguage() + local language = getUserLanguage() + local entry = getLanguageEntry(language) + local path = {...} if not entry then return false end - for i,tab in ipairs{...} do - - entry = entry[tab] - - if not entry then - local path = table.concat ( {...}, "." ) - outputDebugString ( "No language entry in " .. getUserConfig ("language") .. ": ".. path, 2) - - -- Returning path is more friendly, helps developer find source of issue and can give user an idea of what was supposed to be said - return path - - elseif type ( entry ) == "string" then - return entry + for i, tab in ipairs(path) do + if entry and entry[tab] ~= nil then + entry = entry[tab] + else + -- check the default language (English) if the key doesn't exist in the user's language + local defaultEntry = getLanguageEntry("english") + for _, p in ipairs(path) do + defaultEntry = defaultEntry and defaultEntry[p] + end + + -- debug missing language entry to help developers + local missingPath = table.concat(path, ".") + outputDebugString("No language entry in " .. language .. ": " .. missingPath, 2) + + if not defaultEntry then + -- If missing in both, return the path. can give user an idea of what was supposed to be said + return missingPath + end + + if type(defaultEntry) == "string" then + -- return with [en] + return defaultEntry .. " [en]" + end end + end + if type(entry) == "string" then + return entry end if DEBUGMODE then - error ( "No valid arguments were passed!", 2 ) + error("No valid arguments were passed!", 2) end return "" end + + function getHandlingPropertyFriendlyName ( property ) if not isHandlingPropertyValid ( property ) then if DEBUGMODE then @@ -590,12 +607,20 @@ end function getUserLanguage ( ) local config = getUserConfig ( "language" ) - if config and guiLanguage[config] then - return guiLanguage[config] + if config then + return config end setUserConfig("language", "english") - return guiLanguage.english + return "english" +end + +function getLanguageEntry(language) + if not language or not guiLanguage[language] then + return guiLanguage.english + end + + return guiLanguage[language] end @@ -633,3 +658,19 @@ _setVehicleLocked = setVehicleLocked function setVehicleLocked(vehicle, state) return triggerServerEvent("vehicleLockRequest", localPlayer, vehicle, state) end + + +function refreshSavesGridlist() + local content = heditGUI.viewItems.save.guiItems + + guiGridListClear ( content.grid ) + guiResetStaticInfoText() + + local saves = getClientSaves ( ) + for name,info in pairs ( saves ) do + local row = guiGridListAddRow ( content.grid ) + local model = getVehicleNameFromModel ( tonumber ( info.model ) ) + guiGridListSetItemText ( content.grid, row, 1, info.name, false, false ) + guiGridListSetItemText ( content.grid, row, 2, model, false, false ) + end +end \ No newline at end of file From 4a12a7a8d22ad9818a806b46273b44a93f8060c2 Mon Sep 17 00:00:00 2001 From: denjifb <143030907+denjifb@users.noreply.github.com> Date: Fri, 12 Dec 2025 20:13:10 +0300 Subject: [PATCH 2/2] delete trailing whitespace --- [gameplay]/hedit/client/gui/templates/default.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[gameplay]/hedit/client/gui/templates/default.lua b/[gameplay]/hedit/client/gui/templates/default.lua index 72d108ff1..01d298f6f 100644 --- a/[gameplay]/hedit/client/gui/templates/default.lua +++ b/[gameplay]/hedit/client/gui/templates/default.lua @@ -697,7 +697,7 @@ template.viewcontents = { events = { onFocus = function ( this ) local placeholderText = getText("viewinfo", "save", "itemtext", "nameEdit") - if guiGetText(this) == placeholderText then + if guiGetText(this) == placeholderText then guiSetText(this, "") end end, @@ -715,7 +715,7 @@ template.viewcontents = { events = { onFocus = function ( this ) local placeholderText = getText("viewinfo", "save", "itemtext", "descriptionEdit") - if guiGetText(this) == placeholderText then + if guiGetText(this) == placeholderText then guiSetText(this, "") end end,