implement all needed tr() for localization

* implement some pt-BR translations
* remove legacy about module
This commit is contained in:
Eduardo Bart 2012-04-26 16:54:16 -03:00
parent ca0e1bd38b
commit 34091bc48e
47 changed files with 480 additions and 419 deletions

View File

@ -3,8 +3,9 @@ Client = {}
function Client.reloadScripts() function Client.reloadScripts()
dofile '/otclientrc' dofile '/otclientrc'
reloadModules() reloadModules()
TextMessage.displayEventAdvance('All modules and scripts were reloaded.') local message = tr('All modules and scripts were reloaded.')
print('All modules and scripts were reloaded.') TextMessage.displayEventAdvance(message)
print(message)
end end
function Client.init() function Client.init()

View File

@ -1,34 +0,0 @@
About = {}
-- private variables
local aboutButton
local aboutWindow
-- public functions
function About.init()
aboutButton = TopMenu.addRightButton('aboutButton', 'About', 'about.png', About.show)
aboutWindow = displayUI('about.otui')
aboutWindow:hide()
end
function About.terminate()
aboutButton:destroy()
aboutButton = nil
aboutWindow:destroy()
aboutWindow = nil
About = nil
end
function About.show()
aboutWindow:show()
aboutWindow:raise()
aboutWindow:focus()
end
function About.hide()
aboutWindow:hide()
end
function About.openWebpage()
displayErrorBox("Error", "Not implemented yet")
end

View File

@ -1,15 +0,0 @@
Module
name: client_about
description: Create the about window
author: OTClient team
website: https://github.com/edubart/otclient
dependencies:
- client_topmenu
@onLoad: |
dofile 'about'
About.init()
@onUnload: |
About.terminate()

View File

@ -1,58 +0,0 @@
MainWindow
id: about
text: Info
size: 244 221
@onEnter: About.hide()
@onEscape: About.hide()
FlatPanel
size: 208 129
anchors.left: parent.left
anchors.top: parent.top
Label
text-align: center
text: |-
OTClient
Version 0.4.0
Created by edubart
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
margin-top: 20
HorizontalSeparator
size: 190 2
anchors.left: parent.left
anchors.top: parent.top
margin-top: 83
margin-left: 9
Label
text: Official Website
anchors.left: parent.left
anchors.bottom: parent.bottom
margin-bottom: 14
margin-left: 9
Button
text: Github Page
size: 88 24
anchors.right: parent.right
anchors.bottom: parent.bottom
margin-bottom: 9
margin-right: 9
@onClick: About.openWebpage()
HorizontalSeparator
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 12
Button
text: Ok
size: 46 24
anchors.right: parent.right
anchors.bottom: parent.bottom
@onClick: About.hide()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

View File

@ -25,14 +25,14 @@ local function tryLogin(charInfo, tries)
if tries > 4 then if tries > 4 then
CharacterList.destroyLoadBox() CharacterList.destroyLoadBox()
displayErrorBox('Error', 'Could not logout.') displayErrorBox(tr('Error'), tr('Unable to logout.'))
return return
end end
if g_game.isOnline() then if g_game.isOnline() then
g_game.safeLogout() g_game.safeLogout()
if tries == 1 then if tries == 1 then
loadBox = displayCancelBox('Please wait', 'Loggin out...') loadBox = displayCancelBox(tr('Please wait'), tr('Loggin out...'))
end end
scheduleEvent(function() tryLogin(charInfo, tries+1) end, 250) scheduleEvent(function() tryLogin(charInfo, tries+1) end, 250)
return return
@ -42,7 +42,7 @@ local function tryLogin(charInfo, tries)
g_game.loginWorld(EnterGame.account, EnterGame.password, charInfo.worldName, charInfo.worldHost, charInfo.worldPort, charInfo.characterName) g_game.loginWorld(EnterGame.account, EnterGame.password, charInfo.worldName, charInfo.worldHost, charInfo.worldPort, charInfo.characterName)
loadBox = displayCancelBox('Please wait', 'Connecting to game server...') loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to game server...'))
connect(loadBox, { onCancel = function() connect(loadBox, { onCancel = function()
loadBox = nil loadBox = nil
g_game.cancelLogin() g_game.cancelLogin()
@ -55,7 +55,7 @@ end
function onGameLoginError(message) function onGameLoginError(message)
CharacterList.destroyLoadBox() CharacterList.destroyLoadBox()
errorBox = displayErrorBox("Login Error", "Login error: " .. message) errorBox = displayErrorBox(tr("Login Error"), message)
errorBox.onOk = function() errorBox.onOk = function()
errorBox = nil errorBox = nil
CharacterList.showAgain() CharacterList.showAgain()
@ -64,7 +64,7 @@ end
function onGameConnectionError(message) function onGameConnectionError(message)
CharacterList.destroyLoadBox() CharacterList.destroyLoadBox()
errorBox = displayErrorBox("Login Error", "Connection error: " .. message) errorBox = displayErrorBox(tr("Login Error"), message)
errorBox.onOk = function() errorBox.onOk = function()
errorBox = nil errorBox = nil
CharacterList.showAgain() CharacterList.showAgain()
@ -128,7 +128,7 @@ function CharacterList.create(characters, premDays)
characterList:focusChild(focusLabel, ActiveFocusReason) characterList:focusChild(focusLabel, ActiveFocusReason)
if premDays > 0 then if premDays > 0 then
accountStatusLabel:setText("Account Status:\nPremium Account (" .. premDays .. ' days left)') accountStatusLabel:setText(tr("Account Status:\nPremium Account (%s) days left", premDays))
end end
end end
@ -173,7 +173,7 @@ function CharacterList.doLogin()
CharacterList.hide() CharacterList.hide()
tryLogin(charInfo) tryLogin(charInfo)
else else
displayErrorBox('Error', 'You must select a character to login!') displayErrorBox(tr('Error'), tr('You must select a character to login!'))
end end
end end

View File

@ -51,7 +51,7 @@ MainWindow
//CheckBox //CheckBox
// id: charAutoLoginBox // id: charAutoLoginBox
// !text: tr('Auto login') // !text: tr('Auto login')
// tooltip: Auto login selected character on next charlist load // !tooltip: tr('Auto login selected character on next charlist load')
// anchors.left: parent.left // anchors.left: parent.left
// anchors.right: parent.right // anchors.right: parent.right
// anchors.bottom: next.top // anchors.bottom: next.top

View File

@ -24,7 +24,7 @@ local function onError(protocol, message, connectionError)
if not connectionError then if not connectionError then
clearAccountFields() clearAccountFields()
end end
local errorBox = displayErrorBox('Login Error', message) local errorBox = displayErrorBox(tr('Login Error'), message)
connect(errorBox, { onOk = EnterGame.show }) connect(errorBox, { onOk = EnterGame.show })
end end
@ -51,7 +51,7 @@ local function onCharacterList(protocol, characters, premDays)
local lastMotdNumber = Settings.getNumber("motd") local lastMotdNumber = Settings.getNumber("motd")
if motdNumber and motdNumber ~= lastMotdNumber then if motdNumber and motdNumber ~= lastMotdNumber then
Settings.set("motd", motdNumber) Settings.set("motd", motdNumber)
local motdBox = displayInfoBox("Message of the day", motdMessage) local motdBox = displayInfoBox(tr('Message of the day'), motdMessage)
connect(motdBox, { onOk = CharacterList.show }) connect(motdBox, { onOk = CharacterList.show })
CharacterList.hide() CharacterList.hide()
end end
@ -60,8 +60,8 @@ end
-- public functions -- public functions
function EnterGame.init() function EnterGame.init()
enterGame = displayUI('entergame.otui') enterGame = displayUI('entergame.otui')
enterGameButton = TopMenu.addLeftButton('enterGameButton', 'Login (Ctrl + G)', 'login.png', EnterGame.openWindow) enterGameButton = TopMenu.addLeftButton('enterGameButton', tr('Login') .. ' (Ctrl + G)', 'login.png', EnterGame.openWindow)
motdButton = TopMenu.addLeftButton('motdButton', 'Message of the day', 'motd.png', EnterGame.displayMotd) motdButton = TopMenu.addLeftButton('motdButton', tr('Message of the day'), 'motd.png', EnterGame.displayMotd)
motdButton:hide() motdButton:hide()
Keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow) Keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow)
@ -133,7 +133,7 @@ function EnterGame.doLogin()
protocolLogin.onMotd = onMotd protocolLogin.onMotd = onMotd
protocolLogin.onCharacterList = onCharacterList protocolLogin.onCharacterList = onCharacterList
loadBox = displayCancelBox('Please wait', 'Connecting to login server...') loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to login server...'))
connect(loadBox, { onCancel = function(msgbox) connect(loadBox, { onCancel = function(msgbox)
loadBox = nil loadBox = nil
protocolLogin:cancelLogin() protocolLogin:cancelLogin()
@ -144,5 +144,5 @@ function EnterGame.doLogin()
end end
function EnterGame.displayMotd() function EnterGame.displayMotd()
displayInfoBox('Message of the day', motdMessage) displayInfoBox(tr('Message of the day'), motdMessage)
end end

View File

@ -12,12 +12,12 @@ function Locales.init()
Locales.installLocales('locales') Locales.installLocales('locales')
local userLocaleName = Settings.get('locale') local userLocaleName = Settings.get('locale')
if not userLocaleName or not Locales.setLocale(userLocaleName) then if userLocaleName then
print('Locale ' .. userLocaleName .. ' is not loaded. Using default. ' .. defaultLocaleName) print('Using configurated locale: ' .. userLocaleName)
if not Locales.setLocale(defaultLocaleName) then Locales.setLocale(userLocaleName)
fatal('Default locale could not be loaded. Re-install the program.') else
return print('Using default locale: ' .. defaultLocaleName)
end Locales.setLocale(defaultLocaleName)
Settings.set('locale', defaultLocaleName) Settings.set('locale', defaultLocaleName)
end end
@ -33,14 +33,8 @@ function Locales.terminate()
end end
function Locales.installLocale(locale) function Locales.installLocale(locale)
if not locale then if not locale or not locale.name then
print('Coult not install locale.') error('Unable to install locale.')
return false
end
if not locale.name then
printf('Coult not install locale.')
return false
end end
local installedLocale = installedLocales[locale.name] local installedLocale = installedLocales[locale.name]
@ -62,13 +56,10 @@ end
function Locales.setLocale(name) function Locales.setLocale(name)
local locale = installedLocales[name] local locale = installedLocales[name]
if locale then if not locale then
currentLocale = locale error("Locale " .. name .. ' does not exist.')
return true
end end
currentLocale = locale
print("Locale " .. name .. ' does not exist.')
return false
end end
function tr(text, ...) function tr(text, ...)
@ -86,12 +77,14 @@ function tr(text, ...)
return out:reverse() return out:reverse()
elseif tostring(text) then elseif tostring(text) then
local translation = currentLocale.translation[text] local translation = currentLocale.translation[text]
if translation then if not translation then
return string.format(translation, ...) if currentLocale.name ~= defaultLocaleName then
elseif currentLocale.name ~= defaultLocaleName then warning('Unable to translate: \"' .. text .. '\"')
print('WARNING: \"' .. text .. '\" could not be translated.') end
translation = text
end end
return string.format(translation, ...)
end end
end end
return text return text
end end

View File

@ -1,26 +1,199 @@
-- to find all possible translations in the source code use the following command:
-- find \( -name '*.lua' -o -name '*.otui' \) -exec grep -oE "tr\\('(\\\\'|[^'])*'" {} \; -exec grep -oE "tr\\(\"(\\\\\"|[^\"])*\nil {} \; | sort | uniq | sed "s/^tr(.\(.*\).$/[\"\1\"] = nil,/"
locale = { locale = {
name = 'pt-br', name = 'pt-br',
-- As traduções devem vir sempre em ordem alfabética. -- As traduções devem vir sempre em ordem alfabética.
translation = { translation = {
['Account name'] = 'Nome da conta', ["Account name"] = "Nome da conta",
['Account Status:\nFree Account'] = 'Estado da Conta:\nGrátis', ["Account Status:\nFree Account"] = "Estado da conta:\nGratís",
['Auto login'] = 'Entrar automaticamente', ["Account Status:\nPremium Account (%s) days left"] = "Estado da conta:\nConta premium (%s) dias faltando",
['Cancel'] = 'Cancelar', ["Add"] = "Adicionar",
['Character List'] = 'Lista de Personagens', ["Add new VIP"] = "Adicionar nova VIP",
['Enter Game'] = 'Entrar no Jogo', ["Addon 1"] = "Addon 1",
['Make sure that your client uses\nthe correct game protocol version'] = 'Tenha certeza de que o cliente usa\na versão correta do protocolo do jogo', ["Addon 2"] = "Addon 2",
['Ok'] = 'Ok', ["Addon 3"] = "Addon 3",
['Open charlist automatically when starting otclient'] = 'Abrir a lista de personagens automaticamente ao iniciar o otclient', ["Add to VIP list"] = "Adicionar a lista VIP",
['Options'] = 'Opções', ["Adjust volume"] = "Ajustar volume",
['Password'] = 'Senha', ["All modules and scripts were reloaded."] = "Todos modules e scripts foram recarregados.",
['Port'] = 'Porta', ["Amount:"] = "Quantidade:",
['Remember account and password when starts otclient'] = 'Lembrar conta e senha ao iniciar o otclient', ["Attack"] = "Atacar",
['Remember password'] = 'Lembrar senha', ["Author"] = "Autor",
['Server'] = 'Servidor' ["Autoload"] = "Carregar automaticamente",
} ["Autoload priority"] = "Prioridade de carregamento",
["Auto login"] = "Entrar automaticamente",
["Auto login selected character on next charlist load"] = "Entrar automaticamente com o personagem quando reabrir a lista de personagens",
["Axe Fighting"] = "Machado",
["Battle"] = "Batalha",
["Button Assign"] = "Selecionar botão",
["Buy"] = "Comprar",
["Buy no backpack"] = "Comprar na backpack",
["Buy with backpack"] = "Comprar com backpack",
["Cancel"] = "Cancelar",
["Capacity:"] = "Capacidade:",
["Capacity"] = "Capacidade",
["Channels"] = "Canais",
["Character List"] = "Lista de personagens",
["Classic control"] = "Controle clássico",
["Clear object"] = "Limpar objeto",
["Close"] = "Fechar",
["Close this channel"] = "Fechar esse canal",
["Club Fighting"] = "Porrete",
["Combat Controls"] = nil,
["Connecting to game server..."] = "Conectando no servidor do jogo...",
["Connecting to login server..."] = "Conectando no servidor de autenticação...",
["Consider capacity"] = "Considerar capacidade",
["Consider equipped"] = "Considerar equipado",
["Copy Name"] = "Copiar Nome",
["Current hotkeys:"] = "Atalhos atuais",
["Current hotkey to add: %s"] = "Atalho atual para adicionar: %s",
["Default"] = "Default",
["Description"] = "Descrição",
["Detail"] = "Detalhe",
["Disable Shared Experience"] = "Desativar experiência compartilhada",
["Distance Fighting"] = "Flecha",
["Edit hotkey text:"] = "Editar texto do atalho",
["Edit Text"] = "Editar Texto",
["Enable Shared Experience"] = "Ativar experiência compartilhada",
["Enable vertical synchronization"] = "Ativar sincronização vertical",
["Enter Game"] = "Entrar no jogo",
["Error"] = "Erro",
["Exclude from private chat"] = "Excluir do canal privado",
["Experience"] = "Experiência",
["Fishing"] = "Pesca",
["Fist Fighting"] = "Porrada",
["Follow"] = "Seguir",
["Frame rate limit"] = "Limite de FPS",
["Fullscreen"] = "Tela cheia",
["Head"] = "Cabeça",
["Health Bar"] = "Barra de Vida",
["Hide monsters"] = "Esconder montros",
["Hide non-skull players"] = "Esconder jogadores sem caveira",
["Hide Npcs"] = "Esconder NPCs",
["Hide party members"] = "Esconder membros do grupo",
["Hide players"] = "Esconder jogadores",
["Hit Points"] = "Vida",
["Hotkeys"] = "Atalhos",
["Ignore capacity"] = "Ignorar capacidade",
["Ignore equipped"] = "Ignorar equipado",
["Inventory"] = "Inventário",
["Invite to Party"] = "Convidar para o grupo",
["Invite to private chat"] = "Convidar para canal privado",
["Join %s\'s Party"] = "Entrar no grupo do %s",
["Leave Party"] = "Sair do grupo",
["Level"] = "Nível",
["Limits FPS to 60"] = "Limita o FPS para 60",
["List of items that you're able to buy"] = "Listar itens que você não pode comprar",
["List of items that you're able to sell"] = "Listar itens que você pode comprar",
["Load"] = "Carregar",
["Loggin out..."] = "Saindo...",
["Login"] = "Entrar",
["Login Error"] = "Erro de Autenticação",
["Look"] = "Olhar",
["Magic Level"] = "Nível Mágico",
["Make sure that your client uses\nthe correct game protocol version"] = "Tenha certeza que o seu cliente use\no mesmo protocolo do server do jogo",
["Mana"] = "Mana",
["Manage hotkeys:"] = "Configurar atalhos:",
["Message of the day"] = "Mensagem do dia",
["Message to %s"] = "Mandar mensagem para %s",
["Minimap"] = "Minimapa",
["Module Manager"] = "Gerenciador de Módulos",
["Module name"] = "Nomo do módulo",
["Money:"] = "Dinheiro:",
["Move Stackable Item"] = "Move item contável",
["Move up"] = "Mover para cima",
["Name:"] = "Nome:",
["NPC Trade"] = "Troca com NPC",
["Ok"] = "Ok",
["Open"] = "Abrir",
["Open a private message channel:"] = "Abrir um canal privado:",
["Open charlist automatically when starting otclient"] = "Abrir lista de personágens",
["Open in new window"] = nil,
["Open new channel"] = nil,
["Options"] = nil,
["Outfit Name"] = nil,
["Pass Leadership to %s"] = nil,
["Password"] = nil,
["Please enter a character name:"] = nil,
["Please, press the key you wish to add onto your hotkeys manager"] = nil,
["Please wait"] = nil,
["Port"] = nil,
["Price:"] = nil,
["Primary"] = nil,
["Quantity:"] = nil,
["Refresh"] = nil,
["Reload All"] = nil,
["Remember account and password when starts otclient"] = nil,
["Remember password"] = nil,
["Remove"] = nil,
["Remove %s"] = nil,
["Revoke %s\'s Invitation"] = nil,
["Rotate"] = nil,
["Search:"] = nil,
["Secondary"] = nil,
["Select object"] = nil,
["Select Outfit"] = nil,
["Sell"] = nil,
["Send automatically"] = nil,
["Server"] = nil,
["Server Log"] = nil,
["Set Outfit"] = nil,
["Shielding"] = nil,
["Show all items"] = nil,
["Show event messages in console"] = nil,
["Show frame rate"] = nil,
["Show info messages in console"] = nil,
["Show levels in console"] = nil,
["Show only holding items"] = nil,
["Show private messages in console"] = nil,
["Show status messages in console"] = nil,
["Show timestamps in console"] = nil,
["Skills"] = nil,
["Soul Points"] = nil,
["Stamina"] = nil,
["Stop Attack"] = nil,
["Stop Follow"] = nil,
["%s: (use object)"] = nil,
["%s: (use object on target)"] = nil,
["%s: (use object on yourself)"] = nil,
["%s: (use object with crosshair)"] = nil,
["Sword Fighting"] = nil,
["Terminal"] = nil,
["There is no way."] = nil,
["Trade with ..."] = nil,
["Unable to logout."] = nil,
["Unload"] = nil,
["Use"] = nil,
["Use on target"] = nil,
["Use on yourself"] = nil,
["Use with ..."] = nil,
["Version"] = nil,
["VIP list"] = nil,
["VIP List"] = nil,
["Website"] = nil,
["Weight:"] = nil,
["With crosshair"] = nil,
["You are burning"] = nil,
["You are cursed"] = nil,
["You are dazzled"] = nil,
["You are drowing"] = nil,
["You are electrified"] = nil,
["You are freezing"] = nil,
["You are hasted"] = nil,
["You are paralysed"] = nil,
["You are poisoned"] = nil,
["You are protected by a magic shield"] = nil,
["You are strengthened"] = nil,
["You are within a protection zone"] = nil,
["You have %s percent"] = nil,
["You have %s percent to go"] = nil,
["You may not logout during a fight"] = nil,
["You may not logout or enter a protection zone"] = nil,
["You must select a character to login!"] = nil,
}
-- Adicionar informações de números. 1.000 100,00 1.000,00 etc. -- Adicionar informações de números. 1.000 100,00 1.000,00 etc.
} }
Locales.installLocale(locale) Locales.installLocale(locale)

View File

@ -16,7 +16,7 @@ function ModuleManager.init()
Keyboard.bindKeyPress('Up', function() moduleList:focusPreviousChild(KeyboardFocusReason) end, moduleManagerWindow) Keyboard.bindKeyPress('Up', function() moduleList:focusPreviousChild(KeyboardFocusReason) end, moduleManagerWindow)
Keyboard.bindKeyPress('Down', function() moduleList:focusNextChild(KeyboardFocusReason) end, moduleManagerWindow) Keyboard.bindKeyPress('Down', function() moduleList:focusNextChild(KeyboardFocusReason) end, moduleManagerWindow)
moduleManagerButton = TopMenu.addLeftButton('moduleManagerButton', 'Module manager', 'modulemanager.png', ModuleManager.toggle) moduleManagerButton = TopMenu.addLeftButton('moduleManagerButton', tr('Module Manager'), 'modulemanager.png', ModuleManager.toggle)
-- refresh modules only after all modules are loaded -- refresh modules only after all modules are loaded
addEvent(ModuleManager.listModules) addEvent(ModuleManager.listModules)

View File

@ -34,7 +34,7 @@ ModuleValueLabel < UILabel
MainWindow MainWindow
id: moduleManagerWindow id: moduleManagerWindow
size: 480 450 size: 480 450
text: Module Manager !text: tr('Module Manager')
@onEscape: ModuleManager.hide() @onEscape: ModuleManager.hide()
@ -54,7 +54,7 @@ MainWindow
anchors.left: moduleList.left anchors.left: moduleList.left
margin-top: 8 margin-top: 8
width: 80 width: 80
text: Refresh !text: tr('Refresh')
@onClick: ModuleManager.refreshModules() @onClick: ModuleManager.refreshModules()
Button Button
@ -63,7 +63,7 @@ MainWindow
anchors.right: moduleList.right anchors.right: moduleList.right
margin-top: 8 margin-top: 8
width: 80 width: 80
text: Reload All !text: tr('Reload All')
@onClick: ModuleManager.reloadAllModules() @onClick: ModuleManager.reloadAllModules()
Panel Panel
@ -76,40 +76,40 @@ MainWindow
height: 265 height: 265
ModuleInfoLabel ModuleInfoLabel
text: Module name !text: tr('Module name')
ModuleValueLabel ModuleValueLabel
id: moduleName id: moduleName
ModuleInfoLabel ModuleInfoLabel
text: Description !text: tr('Description')
ModuleValueLabel ModuleValueLabel
id: moduleDescription id: moduleDescription
height: 100 height: 100
text-wrap: true text-wrap: true
//ModuleInfoLabel //ModuleInfoLabel
// text: Autoload // !text: tr('Autoload')
//ModuleValueLabel //ModuleValueLabel
// id: moduleAutoload // id: moduleAutoload
//ModuleInfoLabel //ModuleInfoLabel
// text: Autoload priority // !text: tr('Autoload priority')
//ModuleValueLabel //ModuleValueLabel
// id: moduleLoadPriority // id: moduleLoadPriority
// text: 1000 // text: 1000
ModuleInfoLabel ModuleInfoLabel
text: Author !text: tr('Author')
ModuleValueLabel ModuleValueLabel
id: moduleAuthor id: moduleAuthor
ModuleInfoLabel ModuleInfoLabel
text: Website !text: tr('Website')
ModuleValueLabel ModuleValueLabel
id: moduleWebsite id: moduleWebsite
ModuleInfoLabel ModuleInfoLabel
text: Version !text: tr('Version')
ModuleValueLabel ModuleValueLabel
id: moduleVersion id: moduleVersion
@ -118,7 +118,7 @@ MainWindow
anchors.top: moduleInfo.bottom anchors.top: moduleInfo.bottom
anchors.left: moduleInfo.left anchors.left: moduleInfo.left
margin-top: 8 margin-top: 8
text: Load !text: tr('Load')
enabled: false enabled: false
@onClick: ModuleManager.reloadCurrentModule() @onClick: ModuleManager.reloadCurrentModule()
@ -128,7 +128,7 @@ MainWindow
anchors.right: moduleInfo.right anchors.right: moduleInfo.right
margin-left: 10 margin-left: 10
margin-top: 8 margin-top: 8
text: Unload !text: tr('Unload')
enabled: false enabled: false
@onClick: ModuleManager.unloadCurrentModule() @onClick: ModuleManager.unloadCurrentModule()
@ -136,7 +136,7 @@ MainWindow
id: closeButton id: closeButton
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
text: Close !text: tr('Close')
width: 60 width: 60
@onClick: ModuleManager.hide() @onClick: ModuleManager.hide()

View File

@ -1,28 +1,28 @@
Panel Panel
OptionCheckBox OptionCheckBox
id: classicControl id: classicControl
text: Classic control !text: tr('Classic control')
OptionCheckBox OptionCheckBox
id: showInfoMessagesInConsole id: showInfoMessagesInConsole
text: Show info messages in console !text: tr('Show info messages in console')
OptionCheckBox OptionCheckBox
id: showEventMessagesInConsole id: showEventMessagesInConsole
text: Show event messages in console !text: tr('Show event messages in console')
OptionCheckBox OptionCheckBox
id: showStatusMessagesInConsole id: showStatusMessagesInConsole
text: Show status messages in console !text: tr('Show status messages in console')
OptionCheckBox OptionCheckBox
id: showTimestampsInConsole id: showTimestampsInConsole
text: Show timestamps in console !text: tr('Show timestamps in console')
OptionCheckBox OptionCheckBox
id: showLevelsInConsole id: showLevelsInConsole
text: Show levels in console !text: tr('Show levels in console')
OptionCheckBox OptionCheckBox
id: showPrivateMessagesInConsole id: showPrivateMessagesInConsole
text: Show private messages in console !text: tr('Show private messages in console')

View File

@ -1,19 +1,19 @@
Panel Panel
OptionCheckBox OptionCheckBox
id: vsync id: vsync
text: Enable vertical synchronization !text: tr('Enable vertical synchronization')
tooltip: Limits FPS to 60 !tooltip: tr('Limits FPS to 60')
OptionCheckBox OptionCheckBox
id: showfps id: showfps
text: Show frame rate !text: tr('Show frame rate')
OptionCheckBox OptionCheckBox
id: fullscreen id: fullscreen
text: Fullscreen !text: tr('Fullscreen')
Label Label
text: Frame rate limit !text: tr('Frame rate limit')
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: prev.bottom anchors.top: prev.bottom

View File

@ -28,7 +28,7 @@ function Options.init()
optionsWindow = displayUI('options.otui') optionsWindow = displayUI('options.otui')
optionsWindow:hide() optionsWindow:hide()
optionsButton = TopMenu.addLeftButton('optionsButton', tr('Options') .. ' (Ctrl+O)', 'options.png', Options.toggle) optionsButton = TopMenu.addLeftButton('optionsButton', tr('Options'), 'options.png', Options.toggle)
optionsTabBar = optionsWindow:getChildById('optionsTabBar') optionsTabBar = optionsWindow:getChildById('optionsTabBar')
optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent')) optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))
optionsTabBar:addTab('General', loadUI('general.otui')) optionsTabBar:addTab('General', loadUI('general.otui'))
@ -37,6 +37,7 @@ end
function Options.terminate() function Options.terminate()
Keyboard.unbindKeyDown('Ctrl+P') Keyboard.unbindKeyDown('Ctrl+P')
Keyboard.unbindKeyDown('Ctrl+F')
optionsWindow:destroy() optionsWindow:destroy()
optionsWindow = nil optionsWindow = nil
optionsButton:destroy() optionsButton:destroy()
@ -63,10 +64,6 @@ function Options.hide()
optionsWindow:hide() optionsWindow:hide()
end end
function Options.openWebpage()
displayErrorBox("Error", "Not implemented yet")
end
function Options.toggleOption(key) function Options.toggleOption(key)
Options.setOption(key, not Options.getOption(key)) Options.setOption(key, not Options.getOption(key))
end end

View File

@ -16,7 +16,7 @@ OptionCheckBox < CheckBox
MainWindow MainWindow
id: optionsWindow id: optionsWindow
text: Options !text: tr('Options')
size: 286 230 size: 286 230
@onEnter: Options.hide() @onEnter: Options.hide()
@ -37,7 +37,7 @@ MainWindow
margin-top: 10 margin-top: 10
Button Button
text: Ok !text: tr('Ok')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -127,7 +127,7 @@ function Terminal.init()
end end
end end
terminalButton = TopMenu.addLeftButton('terminalButton', 'Terminal (Ctrl + T)', 'terminal.png', Terminal.toggle) terminalButton = TopMenu.addLeftButton('terminalButton', tr('Terminal') .. ' (Ctrl + T)', 'terminal.png', Terminal.toggle)
Keyboard.bindKeyDown('Ctrl+T', Terminal.toggle) Keyboard.bindKeyDown('Ctrl+T', Terminal.toggle)
commandHistory = Settings.getList('terminal-history') commandHistory = Settings.getList('terminal-history')

View File

@ -1,11 +1,15 @@
function print(...) function print(...)
local msg = "" local msg = ""
for i,v in ipairs(arg) do for i,v in ipairs({...}) do
msg = msg .. tostring(v) .. "\t" msg = msg .. tostring(v) .. "\t"
end end
g_logger.log(LogInfo, msg) g_logger.log(LogInfo, msg)
end end
function warning(msg)
g_logger.log(LogWarning, msg)
end
function fatal(msg) function fatal(msg)
g_logger.log(LogFatal, msg) g_logger.log(LogFatal, msg)
end end

View File

@ -161,40 +161,40 @@ function GameInterface.createThingMenu(menuPosition, lookThing, useThing, creatu
local menu = createWidget('PopupMenu') local menu = createWidget('PopupMenu')
if lookThing then if lookThing then
menu:addOption('Look', function() g_game.look(lookThing) end) menu:addOption(tr('Look'), function() g_game.look(lookThing) end)
end end
if useThing then if useThing then
if useThing:isContainer() then if useThing:isContainer() then
if useThing:getParentContainer() then if useThing:getParentContainer() then
menu:addOption('Open', function() g_game.open(useThing, useThing:getParentContainer()) end) menu:addOption(tr('Open'), function() g_game.open(useThing, useThing:getParentContainer()) end)
menu:addOption('Open in new window', function() g_game.open(useThing, nil) end) menu:addOption(tr('Open in new window'), function() g_game.open(useThing, nil) end)
else else
menu:addOption('Open', function() g_game.open(useThing, nil) end) menu:addOption(tr('Open'), function() g_game.open(useThing, nil) end)
end end
else else
if useThing:isMultiUse() then if useThing:isMultiUse() then
menu:addOption('Use with ...', function() GameInterface.startUseWith(useThing) end) menu:addOption(tr('Use with ...'), function() GameInterface.startUseWith(useThing) end)
else else
menu:addOption('Use', function() g_game.use(useThing) end) menu:addOption(tr('Use'), function() g_game.use(useThing) end)
end end
end end
if useThing:isRotateable() then if useThing:isRotateable() then
menu:addOption('Rotate', function() g_game.rotate(useThing) end) menu:addOption(tr('Rotate'), function() g_game.rotate(useThing) end)
end end
end end
if lookThing and not lookThing:asCreature() and not lookThing:isNotMoveable() and lookThing:isPickupable() then if lookThing and not lookThing:asCreature() and not lookThing:isNotMoveable() and lookThing:isPickupable() then
menu:addSeparator() menu:addSeparator()
menu:addOption('Trade with ...', function() GameInterface.startTradeWith(lookThing) end) menu:addOption(tr('Trade with ...'), function() GameInterface.startTradeWith(lookThing) end)
end end
if lookThing then if lookThing then
local parentContainer = lookThing:getParentContainer() local parentContainer = lookThing:getParentContainer()
if parentContainer and parentContainer:hasParent() then if parentContainer and parentContainer:hasParent() then
menu:addOption('Move up', function() g_game.moveToParentContainer(lookThing, lookThing:getCount()) end) menu:addOption(tr('Move up'), function() g_game.moveToParentContainer(lookThing, lookThing:getCount()) end)
end end
end end
@ -202,64 +202,64 @@ function GameInterface.createThingMenu(menuPosition, lookThing, useThing, creatu
menu:addSeparator() menu:addSeparator()
if creatureThing:asLocalPlayer() then if creatureThing:asLocalPlayer() then
menu:addOption('Set Outfit', function() g_game.requestOutfit() end) menu:addOption(tr('Set Outfit'), function() g_game.requestOutfit() end)
if creatureThing:isPartyMember() --[[and not fighting]] then if creatureThing:isPartyMember() --[[and not fighting]] then
if creatureThing:isPartyLeader() then if creatureThing:isPartyLeader() then
if creatureThing:isPartySharedExperienceActive() then if creatureThing:isPartySharedExperienceActive() then
menu:addOption('Disable Shared Experience', function() g_game.partyShareExperience(false) end) menu:addOption(tr('Disable Shared Experience'), function() g_game.partyShareExperience(false) end)
else else
menu:addOption('Enable Shared Experience', function() g_game.partyShareExperience(true) end) menu:addOption(tr('Enable Shared Experience'), function() g_game.partyShareExperience(true) end)
end end
end end
menu:addOption('Leave Party', function() g_game.partyLeave() end) menu:addOption(tr('Leave Party'), function() g_game.partyLeave() end)
end end
else else
local localPlayer = g_game.getLocalPlayer() local localPlayer = g_game.getLocalPlayer()
if localPlayer then if localPlayer then
if g_game.getAttackingCreature() ~= creatureThing then if g_game.getAttackingCreature() ~= creatureThing then
menu:addOption('Attack', function() g_game.attack(creatureThing) end) menu:addOption(tr('Attack'), function() g_game.attack(creatureThing) end)
else else
menu:addOption('Stop Attack', function() g_game.cancelAttack() end) menu:addOption(tr('Stop Attack'), function() g_game.cancelAttack() end)
end end
if g_game.getFollowingCreature() ~= creatureThing then if g_game.getFollowingCreature() ~= creatureThing then
menu:addOption('Follow', function() g_game.follow(creatureThing) end) menu:addOption(tr('Follow'), function() g_game.follow(creatureThing) end)
else else
menu:addOption('Stop Follow', function() g_game.cancelFollow() end) menu:addOption(tr('Stop Follow'), function() g_game.cancelFollow() end)
end end
if creatureThing:asPlayer() then if creatureThing:asPlayer() then
menu:addSeparator() menu:addSeparator()
local creatureName = creatureThing:getName() local creatureName = creatureThing:getName()
menu:addOption('Message to ' .. creatureName, function() g_game.openPrivateChannel(creatureName) end) menu:addOption(tr('Message to %s', creatureName), function() g_game.openPrivateChannel(creatureName) end)
if Console.getOwnPrivateTab() then if Console.getOwnPrivateTab() then
menu:addOption('Invite to private chat', function() g_game.inviteToOwnChannel(creatureName) end) menu:addOption(tr('Invite to private chat'), function() g_game.inviteToOwnChannel(creatureName) end)
menu:addOption('Exclude from private chat', function() g_game.excludeFromOwnChannel(creatureName) end) -- [TODO] must be removed after message's popup labels been implemented menu:addOption(tr('Exclude from private chat'), function() g_game.excludeFromOwnChannel(creatureName) end) -- [TODO] must be removed after message's popup labels been implemented
end end
menu:addOption('Add to VIP list', function() g_game.addVip(creatureName) end) menu:addOption(tr('Add to VIP list'), function() g_game.addVip(creatureName) end)
local localPlayerShield = localPlayer:asCreature():getShield() local localPlayerShield = localPlayer:asCreature():getShield()
local creatureShield = creatureThing:getShield() local creatureShield = creatureThing:getShield()
if localPlayerShield == ShieldNone or localPlayerShield == ShieldWhiteBlue then if localPlayerShield == ShieldNone or localPlayerShield == ShieldWhiteBlue then
if creatureShield == ShieldWhiteYellow then if creatureShield == ShieldWhiteYellow then
menu:addOption('Join ' .. creatureThing:getName() .. '\'s Party', function() g_game.partyJoin(creatureThing:getId()) end) menu:addOption(tr('Join %s\'s Party', creatureThing:getName()), function() g_game.partyJoin(creatureThing:getId()) end)
else else
menu:addOption('Invite to Party', function() g_game.partyInvite(creatureThing:getId()) end) menu:addOption(tr('Invite to Party'), function() g_game.partyInvite(creatureThing:getId()) end)
end end
elseif localPlayerShield == ShieldWhiteYellow then elseif localPlayerShield == ShieldWhiteYellow then
if creatureShield == ShieldWhiteBlue then if creatureShield == ShieldWhiteBlue then
menu:addOption('Revoke ' .. creatureThing:getName() .. '\'s Invitation', function() g_game.partyRevokeInvitation(creatureThing:getId()) end) menu:addOption(tr('Revoke %s\'s Invitation', creatureThing:getName()), function() g_game.partyRevokeInvitation(creatureThing:getId()) end)
end end
elseif localPlayerShield == ShieldYellow or localPlayerShield == ShieldYellowSharedExp or localPlayerShield == ShieldYellowNoSharedExpBlink or localPlayerShield == ShieldYellowNoSharedExp then elseif localPlayerShield == ShieldYellow or localPlayerShield == ShieldYellowSharedExp or localPlayerShield == ShieldYellowNoSharedExpBlink or localPlayerShield == ShieldYellowNoSharedExp then
if creatureShield == ShieldWhiteBlue then if creatureShield == ShieldWhiteBlue then
menu:addOption('Revoke ' .. creatureThing:getName() .. '\'s Invitation', function() g_game.partyRevokeInvitation(creatureThing:getId()) end) menu:addOption(tr('Revoke %s\'s Invitation', creatureThing:getName()), function() g_game.partyRevokeInvitation(creatureThing:getId()) end)
elseif creatureShield == ShieldBlue or creatureShield == ShieldBlueSharedExp or creatureShield == ShieldBlueNoSharedExpBlink or creatureShield == ShieldBlueNoSharedExp then elseif creatureShield == ShieldBlue or creatureShield == ShieldBlueSharedExp or creatureShield == ShieldBlueNoSharedExpBlink or creatureShield == ShieldBlueNoSharedExp then
menu:addOption('Pass Leadership to ' .. creatureThing:getName(), function() g_game.partyPassLeadership(creatureThing:getId()) end) menu:addOption(tr('Pass Leadership to %s'), function() g_game.partyPassLeadership(creatureThing:getId()) end)
else else
menu:addOption('Invite to Party', function() g_game.partyInvite(creatureThing:getId()) end) menu:addOption(tr('Invite to Party'), function() g_game.partyInvite(creatureThing:getId()) end)
end end
end end
end end
@ -267,7 +267,7 @@ function GameInterface.createThingMenu(menuPosition, lookThing, useThing, creatu
end end
menu:addSeparator() menu:addSeparator()
menu:addOption('Copy Name', function() g_window.setClipboardText(creatureThing:getName()) end) menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(creatureThing:getName()) end)
end end

View File

@ -1,11 +1,11 @@
CountWindow < MainWindow CountWindow < MainWindow
id: countWindow id: countWindow
text: Move Stackable Item !text: tr('Move Stackable Item')
size: 196 112 size: 196 112
@onEscape: self:destroy() @onEscape: self:destroy()
Label Label
text: Amount: !text: tr('Amount:')
width: 64 width: 64
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
@ -26,7 +26,7 @@ CountWindow < MainWindow
Button Button
id: buttonOk id: buttonOk
text: Ok !text: tr('Ok')
width: 64 width: 64
anchors.right: next.left anchors.right: next.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@ -34,7 +34,7 @@ CountWindow < MainWindow
Button Button
id: buttonCancel id: buttonCancel
text: Cancel !text: tr('Cancel')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -6,7 +6,6 @@ MiniWindow < UIMiniWindow
text-offset: 24 5 text-offset: 24 5
text-align: topLeft text-align: topLeft
margin-bottom: 2 margin-bottom: 2
move-policy: free updated
image-source: /game/images/miniwindow.png image-source: /game/images/miniwindow.png
image-border: 4 image-border: 4
image-border-top: 23 image-border-top: 23

View File

@ -68,7 +68,7 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton)
elseif mouseButton == MouseLeftButton and self:isPressed() then elseif mouseButton == MouseLeftButton and self:isPressed() then
local dirs = g_map.findPath(g_game.getLocalPlayer():getPosition(), tile:getPosition(), 255) local dirs = g_map.findPath(g_game.getLocalPlayer():getPosition(), tile:getPosition(), 255)
if #dirs == 0 then if #dirs == 0 then
TextMessage.displayStatus('There is no way.') TextMessage.displayStatus(tr('There is no way.'))
return true return true
end end
g_game.autoWalk(dirs) g_game.autoWalk(dirs)

View File

@ -37,7 +37,7 @@ table.insert(lifeBarColors, {percentAbove = -1, color = '#4F0000' } )
-- public functions -- public functions
function Battle.init() function Battle.init()
battleWindow = displayUI('battle.otui', GameInterface.getLeftPanel()) battleWindow = displayUI('battle.otui', GameInterface.getLeftPanel())
battleButton = TopMenu.addGameToggleButton('battleButton', 'Battle (Ctrl+B)', 'battle.png', Battle.toggle) battleButton = TopMenu.addGameToggleButton('battleButton', tr('Battle') .. ' (Ctrl+B)', 'battle.png', Battle.toggle)
battleButton:setOn(true) battleButton:setOn(true)
Keyboard.bindKeyDown('Ctrl+B', Battle.toggle) Keyboard.bindKeyDown('Ctrl+B', Battle.toggle)

View File

@ -38,7 +38,7 @@ BattleParty < BattleIcon
MiniWindow MiniWindow
id: battleWindow id: battleWindow
text: Battle !text: tr('Battle')
height: 166 height: 166
icon: battle.png icon: battle.png
@onClose: Battle.toggle() @onClose: Battle.toggle()
@ -46,34 +46,34 @@ MiniWindow
MiniWindowContents MiniWindowContents
BattlePlayers BattlePlayers
id: hidePlayers id: hidePlayers
tooltip: Hide players !tooltip: tr('Hide players')
anchors.top: parent.top anchors.top: parent.top
anchors.right: next.left anchors.right: next.left
margin-right: 5 margin-right: 5
BattleNPCs BattleNPCs
id: hideNPCs id: hideNPCs
tooltip: Hide Npc's !tooltip: tr('Hide Npcs')
anchors.top: parent.top anchors.top: parent.top
anchors.right: next.left anchors.right: next.left
margin-right: 5 margin-right: 5
BattleMonsters BattleMonsters
id: hideMonsters id: hideMonsters
tooltip: Hide monsters !tooltip: tr('Hide monsters')
anchors.top: parent.top anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
BattleSkulls BattleSkulls
id: hideSkulls id: hideSkulls
tooltip: Hide non-skull players !tooltip: tr('Hide non-skull players')
anchors.top: prev.top anchors.top: prev.top
anchors.left: prev.right anchors.left: prev.right
margin-left: 5 margin-left: 5
BattleParty BattleParty
id: hideParty id: hideParty
tooltip: Hide party members !tooltip: tr('Hide party members')
anchors.top: prev.top anchors.top: prev.top
anchors.left: prev.right anchors.left: prev.right
margin-left: 5 margin-left: 5

View File

@ -48,7 +48,7 @@ end
-- public functions -- public functions
function CombatControls.init() function CombatControls.init()
combatControlsButton = TopMenu.addGameToggleButton('combatControlsButton', 'Combat Controls', 'combatcontrols.png', CombatControls.toggle) combatControlsButton = TopMenu.addGameToggleButton('combatControlsButton', tr('Combat Controls'), 'combatcontrols.png', CombatControls.toggle)
combatControlsButton:setOn(true) combatControlsButton:setOn(true)
combatControlsWindow = loadUI('combatcontrols.otui', GameInterface.getRightPanel()) combatControlsWindow = loadUI('combatcontrols.otui', GameInterface.getRightPanel())

View File

@ -20,7 +20,7 @@ SafeFightBox < CombatBox
image-source: /game_combatcontrols/icons/safefight.png image-source: /game_combatcontrols/icons/safefight.png
MiniWindow MiniWindow
text: Combat Controls !text: tr('Combat Controls')
icon: combatcontrols.png icon: combatcontrols.png
height: 64 height: 64
@onClose: CombatControls.toggle() @onClose: CombatControls.toggle()

View File

@ -10,7 +10,7 @@ ChannelListLabel < Label
MainWindow MainWindow
id: channelsWindow id: channelsWindow
text: Channels !text: tr('Channels')
size: 250 238 size: 250 238
@onEscape: self:destroy() @onEscape: self:destroy()
@ -25,7 +25,7 @@ MainWindow
Label Label
id: openPrivateChannelWithLabel id: openPrivateChannelWithLabel
text: Open a private message channel: !text: tr('Open a private message channel:')
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: next.top anchors.bottom: next.top
@ -41,7 +41,7 @@ MainWindow
Button Button
id: buttonOpen id: buttonOpen
text: Open !text: tr('Open')
width: 64 width: 64
anchors.right: next.left anchors.right: next.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@ -50,7 +50,7 @@ MainWindow
Button Button
id: buttonCancel id: buttonCancel
text: Cancel !text: tr('Cancel')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -91,7 +91,7 @@ local function onCreatureSpeak(name, level, speaktype, message, channelId, creat
if speaktype.private then if speaktype.private then
Console.addPrivateText(message, speaktype, name, false) Console.addPrivateText(message, speaktype, name, false)
else else
local channel = 'Default' local channel = tr('Default')
if not defaultMessage then if not defaultMessage then
channel = channels[channelId] channel = channels[channelId]
end end
@ -177,7 +177,7 @@ local function onChannelList(channelList)
end end
local function onGameStart() local function onGameStart()
local tab = Console.getTab('Default') local tab = Console.getTab(tr('Default'))
if tab then if tab then
addEvent(function() consoleTabBar:selectTab(tab) end, false) addEvent(function() consoleTabBar:selectTab(tab) end, false)
end end
@ -201,8 +201,8 @@ function Console.init()
consoleTabBar:setContentWidget(consoleContentPanel) consoleTabBar:setContentWidget(consoleContentPanel)
channels = {} channels = {}
Console.addTab('Default', true) Console.addTab(tr('Default'), true)
Console.addTab('Server Log', false) Console.addTab(tr('Server Log'), false)
Keyboard.bindKeyPress('Shift+Up', function() navigateMessageHistory(1) end, consolePanel) Keyboard.bindKeyPress('Shift+Up', function() navigateMessageHistory(1) end, consolePanel)
Keyboard.bindKeyPress('Shift+Down', function() navigateMessageHistory(-1) end, consolePanel) Keyboard.bindKeyPress('Shift+Down', function() navigateMessageHistory(-1) end, consolePanel)
@ -265,8 +265,8 @@ function Console.clear()
channels = {} channels = {}
consoleTabBar:getTab('Default').tabPanel:getChildById('consoleBuffer'):destroyChildren() consoleTabBar:getTab(tr('Default')).tabPanel:getChildById('consoleBuffer'):destroyChildren()
consoleTabBar:getTab('Server Log').tabPanel:getChildById('consoleBuffer'):destroyChildren() consoleTabBar:getTab(tr('Server Log')).tabPanel:getChildById('consoleBuffer'):destroyChildren()
local npcTab = consoleTabBar:getTab('NPCs') local npcTab = consoleTabBar:getTab('NPCs')
if npcTab then if npcTab then
@ -289,14 +289,14 @@ function Console.addTab(name, focus)
local tab = consoleTabBar:addTab(name) local tab = consoleTabBar:addTab(name)
if focus then if focus then
consoleTabBar:selectTab(tab) consoleTabBar:selectTab(tab)
elseif name ~= 'Server Log' then elseif name ~= tr('Server Log') then
consoleTabBar:blinkTab(tab) consoleTabBar:blinkTab(tab)
end end
return tab return tab
end end
function Console.onTabChange(tabBar, tab) function Console.onTabChange(tabBar, tab)
if tab:getText() == "Default" or tab:getText() == "Server Log" then if tab:getText() == tr('Default') or tab:getText() == tr('Server Log') then
consolePanel:getChildById('closeChannelButton'):disable() consolePanel:getChildById('closeChannelButton'):disable()
else else
consolePanel:getChildById('closeChannelButton'):enable() consolePanel:getChildById('closeChannelButton'):enable()
@ -305,7 +305,7 @@ end
function Console.removeCurrentTab() function Console.removeCurrentTab()
local tab = consoleTabBar:getCurrentTab() local tab = consoleTabBar:getCurrentTab()
if tab:getText() == "Default" or tab:getText() == "Server Log" then return end if tab:getText() == tr('Default') or tab:getText() == tr('Server Log') then return end
-- notificate the server that we are leaving the channel -- notificate the server that we are leaving the channel
if tab.channelId then if tab.channelId then
@ -342,7 +342,7 @@ function Console.addPrivateText(text, speaktype, name, isPrivateCommand)
local privateTab = Console.getTab(name) local privateTab = Console.getTab(name)
if privateTab == nil then if privateTab == nil then
if Options['showPrivateMessagesInConsole'] or (isPrivateCommand and not privateTab) then if Options['showPrivateMessagesInConsole'] or (isPrivateCommand and not privateTab) then
privateTab = Console.getTab('Default') privateTab = Console.getTab(tr('Default'))
else else
privateTab = Console.addTab(name, focus) privateTab = Console.addTab(name, focus)
end end
@ -424,14 +424,14 @@ function Console.sendCurrentMessage()
-- when talking on server log, the message goes to default channel -- when talking on server log, the message goes to default channel
local name = tab:getText() local name = tab:getText()
if name == 'Server Log' then if name == tr('Server Log') then
tab = Console.getTab('Default') tab = Console.getTab(tr('Default'))
name = 'Default' name = tr('Default')
end end
local speaktypedesc local speaktypedesc
if (tab.channelId or name == 'Default') and not chatCommandPrivateReady then if (tab.channelId or name == tr('Default')) and not chatCommandPrivateReady then
if name == 'Default' then if name == tr('Default') then
speaktypedesc = chatCommandSayMode or SayModes[consolePanel:getChildById('sayModeButton').sayMode].speakTypeDesc speaktypedesc = chatCommandSayMode or SayModes[consolePanel:getChildById('sayModeButton').sayMode].speakTypeDesc
if speaktypedesc ~= 'say' then Console.sayModeChange(2) end -- head back to say mode if speaktypedesc ~= 'say' then Console.sayModeChange(2) end -- head back to say mode
else else

View File

@ -64,7 +64,7 @@ Panel
TabButton TabButton
id: closeChannelButton id: closeChannelButton
tooltip: Close this channel (Ctrl+E) !tooltip: tr('Close this channel') .. ' (Ctrl+E)'
icon: /core_styles/icons/closechannel.png icon: /core_styles/icons/closechannel.png
anchors.right: next.left anchors.right: next.left
anchors.top: parent.top anchors.top: parent.top
@ -75,7 +75,7 @@ Panel
TabButton TabButton
id: channelsButton id: channelsButton
tooltip: Open new channel (Ctrl+O) !tooltip: tr('Open new channel') .. ' (Ctrl+O)'
icon: /core_styles/icons/channels.png icon: /core_styles/icons/channels.png
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
@ -99,7 +99,7 @@ Panel
TabButton TabButton
id: sayModeButton id: sayModeButton
icon: /core_styles/icons/say.png icon: /core_styles/icons/say.png
tooltip: Adjust volume !tooltip: tr('Adjust volume')
&sayMode: 2 &sayMode: 2
size: 20 20 size: 20 20
anchors.left: parent.left anchors.left: parent.left

View File

@ -2,21 +2,21 @@ HealthBar = {}
-- constants -- constants
local Icons = {} local Icons = {}
Icons[1] = { tooltip = 'You are poisoned', path = '/game_healthbar/icons/poisoned.png', id = 'condition_poisoned' } Icons[1] = { tooltip = tr('You are poisoned'), path = '/game_healthbar/icons/poisoned.png', id = 'condition_poisoned' }
Icons[2] = { tooltip = 'You are burning', path = '/game_healthbar/icons/burning.png', id = 'condition_burning' } Icons[2] = { tooltip = tr('You are burning'), path = '/game_healthbar/icons/burning.png', id = 'condition_burning' }
Icons[4] = { tooltip = 'You are electrified', path = '/game_healthbar/icons/electrified.png', id = 'condition_electrified' } Icons[4] = { tooltip = tr('You are electrified'), path = '/game_healthbar/icons/electrified.png', id = 'condition_electrified' }
Icons[8] = { tooltip = 'You are freezing', path = '/game_healthbar/icons/drunk.png', id = 'condition_drunk' } Icons[8] = { tooltip = tr('You are freezing'), path = '/game_healthbar/icons/drunk.png', id = 'condition_drunk' }
Icons[16] = { tooltip = 'You are protected by a magic shield', path = '/game_healthbar/icons/magic_shield.png', id = 'condition_magic_shield' } Icons[16] = { tooltip = tr('You are protected by a magic shield'), path = '/game_healthbar/icons/magic_shield.png', id = 'condition_magic_shield' }
Icons[32] = { tooltip = 'You are paralysed', path = '/game_healthbar/icons/slowed.png', id = 'condition_slowed' } Icons[32] = { tooltip = tr('You are paralysed'), path = '/game_healthbar/icons/slowed.png', id = 'condition_slowed' }
Icons[64] = { tooltip = 'You are hasted', path = '/game_healthbar/icons/haste.png', id = 'condition_haste' } Icons[64] = { tooltip = tr('You are hasted'), path = '/game_healthbar/icons/haste.png', id = 'condition_haste' }
Icons[128] = { tooltip = 'You may not logout during a fight', path = '/game_healthbar/icons/logout_block.png', id = 'condition_logout_block' } Icons[128] = { tooltip = tr('You may not logout during a fight'), path = '/game_healthbar/icons/logout_block.png', id = 'condition_logout_block' }
Icons[256] = { tooltip = 'You are drowing', path = '/game_healthbar/icons/drowning.png', id = 'condition_drowning' } Icons[256] = { tooltip = tr('You are drowing'), path = '/game_healthbar/icons/drowning.png', id = 'condition_drowning' }
Icons[512] = { tooltip = 'You are freezing', path = '/game_healthbar/icons/freezing.png', id = 'condition_freezing' } Icons[512] = { tooltip = tr('You are freezing'), path = '/game_healthbar/icons/freezing.png', id = 'condition_freezing' }
Icons[1024] = { tooltip = 'You are dazzled', path = '/game_healthbar/icons/dazzled.png', id = 'condition_dazzled' } Icons[1024] = { tooltip = tr('You are dazzled'), path = '/game_healthbar/icons/dazzled.png', id = 'condition_dazzled' }
Icons[2048] = { tooltip = 'You are cursed', path = '/game_healthbar/icons/cursed.png', id = 'condition_cursed' } Icons[2048] = { tooltip = tr('You are cursed'), path = '/game_healthbar/icons/cursed.png', id = 'condition_cursed' }
Icons[4096] = { tooltip = 'You are strengthened', path = '/game_healthbar/icons/strengthened.png', id = 'condition_strengthened' } Icons[4096] = { tooltip = tr('You are strengthened'), path = '/game_healthbar/icons/strengthened.png', id = 'condition_strengthened' }
Icons[8192] = { tooltip = 'You may not logout or enter a protection zone', path = '/game_healthbar/icons/protection_zone_block.png', id = 'condition_protection_zone_block' } Icons[8192] = { tooltip = tr('You may not logout or enter a protection zone'), path = '/game_healthbar/icons/protection_zone_block.png', id = 'condition_protection_zone_block' }
Icons[16384] = { tooltip = 'You are within a protection zone', path = '/game_healthbar/icons/protection_zone.png', id = 'condition_protection_zone' } Icons[16384] = { tooltip = tr('You are within a protection zone'), path = '/game_healthbar/icons/protection_zone.png', id = 'condition_protection_zone' }
-- private variables -- private variables
local healthBarWindow local healthBarWindow
@ -34,7 +34,7 @@ function HealthBar.init()
connect(g_game, { onGameEnd = HealthBar.offline }) connect(g_game, { onGameEnd = HealthBar.offline })
healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel()) healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel())
healthBarButton = TopMenu.addGameToggleButton('healthBarButton', 'Healh Bar', 'healthbar.png', HealthBar.toggle) healthBarButton = TopMenu.addGameToggleButton('healthBarButton', tr('Health Bar'), 'healthbar.png', HealthBar.toggle)
healthBarButton:setOn(true) healthBarButton:setOn(true)
healthBar = healthBarWindow:recursiveGetChildById('healthBar') healthBar = healthBarWindow:recursiveGetChildById('healthBar')
manaBar = healthBarWindow:recursiveGetChildById('manaBar') manaBar = healthBarWindow:recursiveGetChildById('manaBar')

View File

@ -42,7 +42,7 @@ ConditionWidget < UIWidget
MiniWindow MiniWindow
icon: healthbar.png icon: healthbar.png
id: healthBarWindow id: healthBarWindow
text: Health Bar !text: tr('Health Bar')
height: 86 height: 86
@onClose: HealthBar.toggle() @onClose: HealthBar.toggle()

View File

@ -37,7 +37,7 @@ function HotkeysManager.init()
hotkeysWindow = displayUI('hotkeys_manager.otui') hotkeysWindow = displayUI('hotkeys_manager.otui')
hotkeysWindow:setVisible(false) hotkeysWindow:setVisible(false)
hotkeysButton = TopMenu.addGameButton('hotkeysButton', 'Hotkeys (Ctrl+K)', '/game_hotkeys/icon.png', HotkeysManager.toggle) hotkeysButton = TopMenu.addGameButton('hotkeysButton', tr('Hotkeys') .. ' (Ctrl+K)', '/game_hotkeys/icon.png', HotkeysManager.toggle)
Keyboard.bindKeyDown('Ctrl+K', HotkeysManager.toggle) Keyboard.bindKeyDown('Ctrl+K', HotkeysManager.toggle)
currentHotkeysList = hotkeysWindow:getChildById('currentHotkeys') currentHotkeysList = hotkeysWindow:getChildById('currentHotkeys')
@ -201,20 +201,20 @@ function HotkeysManager.addHotkey()
messageBox = createWidget('MainWindow', rootWidget) messageBox = createWidget('MainWindow', rootWidget)
messageBox:grabKeyboard() messageBox:grabKeyboard()
messageBox:setId('assignWindow') messageBox:setId('assignWindow')
messageBox:setText('Button Assign') messageBox:setText(tr('Button Assign'))
messageBox:setWidth(420) messageBox:setWidth(420)
messageBox:setHeight(140) messageBox:setHeight(140)
messageBox:setDragable(false) messageBox:setDragable(false)
widget = createWidget('Label', messageBox) widget = createWidget('Label', messageBox)
widget:setText('Please, press the key you wish to add onto your hotkeys manager') widget:setText(tr('Please, press the key you wish to add onto your hotkeys manager'))
widget:resizeToText() widget:resizeToText()
widget:addAnchor(AnchorHorizontalCenter, 'parent', AnchorHorizontalCenter) widget:addAnchor(AnchorHorizontalCenter, 'parent', AnchorHorizontalCenter)
widget:addAnchor(AnchorTop, 'parent', AnchorTop) widget:addAnchor(AnchorTop, 'parent', AnchorTop)
widget = createWidget('Label', messageBox) widget = createWidget('Label', messageBox)
widget:setId('comboPreview') widget:setId('comboPreview')
widget:setText('Current hotkey to add: None') widget:setText(tr('Current hotkey to add: %s', 'none'))
widget.keyCombo = '' widget.keyCombo = ''
widget:resizeToText() widget:resizeToText()
widget:addAnchor(AnchorHorizontalCenter, 'parent', AnchorHorizontalCenter) widget:addAnchor(AnchorHorizontalCenter, 'parent', AnchorHorizontalCenter)
@ -223,7 +223,7 @@ function HotkeysManager.addHotkey()
widget = createWidget('Button', messageBox) widget = createWidget('Button', messageBox)
widget:setId('cancelButton') widget:setId('cancelButton')
widget:setText('Cancel') widget:setText(tr('Cancel'))
widget:setWidth(64) widget:setWidth(64)
widget:addAnchor(AnchorBottom, 'parent', AnchorBottom) widget:addAnchor(AnchorBottom, 'parent', AnchorBottom)
widget:addAnchor(AnchorRight, 'parent', AnchorRight) widget:addAnchor(AnchorRight, 'parent', AnchorRight)
@ -234,7 +234,7 @@ function HotkeysManager.addHotkey()
widget = createWidget('Button', messageBox) widget = createWidget('Button', messageBox)
widget:setId('addButton') widget:setId('addButton')
widget:setText('Add') widget:setText(tr('Add'))
widget:setWidth(64) widget:setWidth(64)
widget:disable() widget:disable()
widget:addAnchor(AnchorBottom, 'cancelButton', AnchorBottom) widget:addAnchor(AnchorBottom, 'cancelButton', AnchorBottom)
@ -372,19 +372,19 @@ function HotkeysManager.changeUseType(useType, checked)
useWith:enable() useWith:enable()
if useType == HOTKEY_MANAGER_USEONSELF then if useType == HOTKEY_MANAGER_USEONSELF then
hotkeyLabelSelectedOnList:setText(hotkeyLabelSelectedOnList.keyCombo .. ': (use object on yourself)') hotkeyLabelSelectedOnList:setText(tr('%s: (use object on yourself)', hotkeyLabelSelectedOnList.keyCombo))
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseSelf) hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseSelf)
useOnSelf:setChecked(true) useOnSelf:setChecked(true)
useOnTarget:setChecked(false) useOnTarget:setChecked(false)
useWith:setChecked(false) useWith:setChecked(false)
elseif useType == HOTKEY_MANAGER_USEONTARGET then elseif useType == HOTKEY_MANAGER_USEONTARGET then
hotkeyLabelSelectedOnList:setText(hotkeyLabelSelectedOnList.keyCombo .. ': (use object on target)') hotkeyLabelSelectedOnList:setText(tr('%s: (use object on target)', hotkeyLabelSelectedOnList.keyCombo))
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseTarget) hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseTarget)
useOnSelf:setChecked(false) useOnSelf:setChecked(false)
useOnTarget:setChecked(true) useOnTarget:setChecked(true)
useWith:setChecked(false) useWith:setChecked(false)
elseif useType == HOTKEY_MANAGER_USEWITH then elseif useType == HOTKEY_MANAGER_USEWITH then
hotkeyLabelSelectedOnList:setText(hotkeyLabelSelectedOnList.keyCombo .. ': (use object with crosshair)') hotkeyLabelSelectedOnList:setText(tr('%s: (use object with crosshair)', hotkeyLabelSelectedOnList.keyCombo))
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseWith) hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseWith)
useOnSelf:setChecked(false) useOnSelf:setChecked(false)
@ -396,7 +396,7 @@ function HotkeysManager.changeUseType(useType, checked)
useOnTarget:disable() useOnTarget:disable()
useWith:disable() useWith:disable()
hotkeyLabelSelectedOnList:setText(hotkeyLabelSelectedOnList.keyCombo .. ': (use object)') hotkeyLabelSelectedOnList:setText(tr('%s: (use object)', hotkeyLabelSelectedOnList.keyCombo))
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUse) hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUse)
useOnSelf:setChecked(false) useOnSelf:setChecked(false)
@ -448,7 +448,7 @@ end
function HotkeysManager.hotkeyCapture(widget, keyCode, keyboardModifiers) function HotkeysManager.hotkeyCapture(widget, keyCode, keyboardModifiers)
local keyCombo = determineKeyComboDesc(keyCode, keyboardModifiers) local keyCombo = determineKeyComboDesc(keyCode, keyboardModifiers)
local comboPreview = rootWidget:getChildById('assignWindow'):getChildById('comboPreview') local comboPreview = rootWidget:getChildById('assignWindow'):getChildById('comboPreview')
comboPreview:setText('Current hotkey to add: '.. keyCombo) comboPreview:setText(tr('Current hotkey to add: %s', keyCombo))
comboPreview.keyCombo = keyCombo comboPreview.keyCombo = keyCombo
comboPreview:resizeToText() comboPreview:resizeToText()
rootWidget:getChildById('assignWindow'):getChildById('addButton'):enable() rootWidget:getChildById('assignWindow'):getChildById('addButton'):enable()

View File

@ -10,7 +10,7 @@ HotkeyListLabel < UILabel
MainWindow MainWindow
id: hotkeysWindow id: hotkeysWindow
text: Hotkeys !text: tr('Hotkeys')
size: 340 460 size: 340 460
@onEnter: HotkeysManager.hide() @onEnter: HotkeysManager.hide()
@ -18,11 +18,11 @@ MainWindow
Label Label
id: currentHotkeysLabel id: currentHotkeysLabel
text: Current hotkeys: !text: tr('Current hotkeys:')
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
VerticalScrollBar VerticalScrollBar
id: currentHotkeysScrollBar id: currentHotkeysScrollBar
height: 150 height: 150
@ -30,7 +30,7 @@ MainWindow
anchors.right: parent.right anchors.right: parent.right
step: 14 step: 14
pixels-scroll: true pixels-scroll: true
TextList TextList
id: currentHotkeys id: currentHotkeys
vertical-scrollbar: currentHotkeysScrollBar vertical-scrollbar: currentHotkeysScrollBar
@ -43,7 +43,7 @@ MainWindow
focusable: false focusable: false
Label Label
text: Manage hotkeys: !text: tr('Manage hotkeys:')
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: prev.bottom anchors.top: prev.bottom
@ -51,7 +51,7 @@ MainWindow
Button Button
id: addHotkey id: addHotkey
text: Add !text: tr('Add')
width: 64 width: 64
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
@ -60,7 +60,7 @@ MainWindow
Button Button
id: removeHotkey id: removeHotkey
text: Remove !text: tr('Remove')
width: 64 width: 64
enabled: false enabled: false
anchors.left: prev.right anchors.left: prev.right
@ -70,7 +70,7 @@ MainWindow
Label Label
id: hotKeyTextLabel id: hotKeyTextLabel
text: Edit hotkey text: !text: tr('Edit hotkey text:')
enable: false enable: false
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@ -88,7 +88,7 @@ MainWindow
CheckBox CheckBox
id: sendAutomatically id: sendAutomatically
text: Send automatically !text: tr('Send automatically')
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: prev.bottom anchors.top: prev.bottom
@ -105,7 +105,7 @@ MainWindow
Button Button
id: selectObjectButton id: selectObjectButton
text: Select object !text: tr('Select object')
width: 128 width: 128
enabled: false enabled: false
anchors.left: prev.right anchors.left: prev.right
@ -115,7 +115,7 @@ MainWindow
Button Button
id: clearObjectButton id: clearObjectButton
text: Clear object !text: tr('Clear object')
width: 128 width: 128
enabled: false enabled: false
anchors.left: prev.left anchors.left: prev.left
@ -126,7 +126,7 @@ MainWindow
ButtonBox ButtonBox
id: useOnSelf id: useOnSelf
text: Use on yourself !text: tr('Use on yourself')
width: 128 width: 128
enabled: false enabled: false
anchors.left: selectObjectButton.right anchors.left: selectObjectButton.right
@ -138,7 +138,7 @@ MainWindow
ButtonBox ButtonBox
id: useOnTarget id: useOnTarget
text: Use on target !text: tr('Use on target')
width: 128 width: 128
enabled: false enabled: false
anchors.left: prev.left anchors.left: prev.left
@ -150,7 +150,7 @@ MainWindow
ButtonBox ButtonBox
id: useWith id: useWith
text: With crosshair !text: tr('With crosshair')
width: 128 width: 128
enabled: false enabled: false
anchors.left: prev.left anchors.left: prev.left
@ -161,7 +161,7 @@ MainWindow
@onCheckChange: HotkeysManager.changeUseType(HOTKEY_MANAGER_USEWITH, self:isChecked()) @onCheckChange: HotkeysManager.changeUseType(HOTKEY_MANAGER_USEWITH, self:isChecked())
Button Button
text: Close !text: tr('Close')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -17,7 +17,7 @@ function Inventory.init()
inventoryWindow = displayUI('inventory.otui', GameInterface.getRightPanel()) inventoryWindow = displayUI('inventory.otui', GameInterface.getRightPanel())
inventoryWindow.onClose = Inventory.toggle inventoryWindow.onClose = Inventory.toggle
inventoryPanel = inventoryWindow:getChildById('contentsPanel') inventoryPanel = inventoryWindow:getChildById('contentsPanel')
inventoryButton = TopMenu.addGameToggleButton('inventoryButton', 'Inventory (Ctrl+I)', 'inventory.png', Inventory.toggle) inventoryButton = TopMenu.addGameToggleButton('inventoryButton', tr('Inventory') .. ' (Ctrl+I)', 'inventory.png', Inventory.toggle)
inventoryButton:setOn(true) inventoryButton:setOn(true)
if g_game.isOnline() then if g_game.isOnline() then

View File

@ -1,6 +1,6 @@
MiniWindow MiniWindow
id: inventoryMiniWindow id: inventoryMiniWindow
text: Inventory !text: tr('Inventory')
icon: inventory.png icon: inventory.png
height: 180 height: 180
@onClose: Inventory.toggle() @onClose: Inventory.toggle()

View File

@ -10,7 +10,7 @@ function onMinimapMouseRelease(self, mousePosition, mouseButton)
if tile and mouseButton == MouseLeftButton and self:isPressed() then if tile and mouseButton == MouseLeftButton and self:isPressed() then
local dirs = g_map.findPath(g_game.getLocalPlayer():getPosition(), tile:getPosition(), 255) local dirs = g_map.findPath(g_game.getLocalPlayer():getPosition(), tile:getPosition(), 255)
if #dirs == 0 then if #dirs == 0 then
TextMessage.displayStatus('There is no way.') TextMessage.displayStatus(tr('There is no way.'))
return true return true
end end
g_game.autoWalk(dirs) g_game.autoWalk(dirs)
@ -33,7 +33,7 @@ function Minimap.init()
connect(g_game, { onLogin = Minimap.reset }) connect(g_game, { onLogin = Minimap.reset })
Keyboard.bindKeyDown('Ctrl+M', Minimap.toggle) Keyboard.bindKeyDown('Ctrl+M', Minimap.toggle)
minimapButton = TopMenu.addGameToggleButton('minimapButton', 'Minimap (Ctrl+M)', 'minimap.png', Minimap.toggle) minimapButton = TopMenu.addGameToggleButton('minimapButton', tr('Minimap') .. ' (Ctrl+M)', 'minimap.png', Minimap.toggle)
minimapButton:setOn(false) minimapButton:setOn(false)
minimapWidget = loadUI('minimap.otui', GameInterface.getMapPanel()) minimapWidget = loadUI('minimap.otui', GameInterface.getMapPanel())

View File

@ -132,7 +132,7 @@ end
function NPCTrade.updateSetup() function NPCTrade.updateSetup()
if offerSelected then if offerSelected then
if radioItems.selectedWidget:isEnabled() then if radioItems.selectedWidget:isEnabled() then
if setupButton:getText() == 'Buy' then if setupButton:getText() == tr('Buy') then
local capacityMaxCount = math.floor(100*g_game.getLocalPlayer():getFreeCapacity()/offerSelected[3]) local capacityMaxCount = math.floor(100*g_game.getLocalPlayer():getFreeCapacity()/offerSelected[3])
local priceMaxCount = math.floor(moneyGoods/NPCTrade.getOfferPrice(offerSelected)) local priceMaxCount = math.floor(moneyGoods/NPCTrade.getOfferPrice(offerSelected))
quantityScroll:setMaximum(math.max(0, math.min(100, math.min(priceMaxCount, capacityMaxCount)))) quantityScroll:setMaximum(math.max(0, math.min(100, math.min(priceMaxCount, capacityMaxCount))))
@ -148,7 +148,7 @@ function NPCTrade.updateSetup()
end end
function NPCTrade.getOfferPrice(offer) function NPCTrade.getOfferPrice(offer)
if setupButton:getText() == 'Buy' then if setupButton:getText() == tr('Buy') then
local price = offer[4] local price = offer[4]
if buyWithBackpack then if buyWithBackpack then
if offer[1]:isStackable() then if offer[1]:isStackable() then
@ -225,14 +225,14 @@ end
function NPCTrade.itemPopup(self, mousePosition, mouseButton) function NPCTrade.itemPopup(self, mousePosition, mouseButton)
if mouseButton == MouseRightButton then if mouseButton == MouseRightButton then
local menu = createWidget('PopupMenu') local menu = createWidget('PopupMenu')
menu:addOption('Look', function() return g_game.inspectNpcTrade(self.offer[1]) end) menu:addOption(tr('Look'), function() return g_game.inspectNpcTrade(self.offer[1]) end)
menu:addSeparator() menu:addSeparator()
if setupButton:getText() == 'Buy' then if setupButton:getText() == tr('Buy') then
menu:addOption((buyWithBackpack and 'Buy no backpack' or 'Buy with backpack'), NPCTrade.switchBuyWithBackpack) menu:addOption((buyWithBackpack and tr('Buy no backpack') or tr('Buy with backpack')), NPCTrade.switchBuyWithBackpack)
menu:addOption((ignoreCapacity and 'Consider capacity' or 'Ignore capacity'), function() ignoreCapacity = not ignoreCapacity return true end) menu:addOption((ignoreCapacity and tr('Consider capacity') or tr('Ignore capacity')), function() ignoreCapacity = not ignoreCapacity return true end)
else else
menu:addOption((ignoreEquipped and 'Consider equipped' or 'Ignore equipped'), function() ignoreEquipped = not ignoreEquipped return true end) menu:addOption((ignoreEquipped and tr('Consider equipped') or tr('Ignore equipped')), function() ignoreEquipped = not ignoreEquipped return true end)
menu:addOption((showOnlyHolding and 'Show all items' or 'Show only holding items'), function() showOnlyHolding = not showOnlyHolding NPCTrade.refreshFilters() return true end) menu:addOption((showOnlyHolding and tr('Show all items') or tr('Show only holding items')), function() showOnlyHolding = not showOnlyHolding NPCTrade.refreshFilters() return true end)
end end
menu:display(mousePosition) menu:display(mousePosition)
end end
@ -274,7 +274,7 @@ function NPCTrade.createItemsOnPanel()
end end
function NPCTrade.extraFilters(widget, showOnlyHolding) function NPCTrade.extraFilters(widget, showOnlyHolding)
if setupButton:getText() == 'Sell' then if setupButton:getText() == tr('Sell') then
if not showOnlyHolding or cacheGoods[widget.offer[1]:getId()] then if not showOnlyHolding or cacheGoods[widget.offer[1]:getId()] then
return true return true
else else
@ -306,8 +306,8 @@ function NPCTrade.refreshFilters()
end end
end end
function NPCTrade.refreshItemsPanel() function NPCTrade.refreshItemsPanel()
if setupButton:getText() == 'Buy' then if setupButton:getText() == tr('Buy') then
local items = itemsPanel:getChildCount() local items = itemsPanel:getChildCount()
for i = 1, items do for i = 1, items do
local itemWidget = itemsPanel:getChildByIndex(i) local itemWidget = itemsPanel:getChildByIndex(i)

View File

@ -7,19 +7,19 @@ NPCOfferLabel < Label
NPCPanel < ScrollablePanel NPCPanel < ScrollablePanel
image-source: /core_styles/styles/images/panel_flat.png image-source: /core_styles/styles/images/panel_flat.png
image-border: 1 image-border: 1
NPCItemBox < UICheckBox NPCItemBox < UICheckBox
border-width: 1 border-width: 1
border-color: #000000 border-color: #000000
@onCheckChange: NPCTrade.setItem(self) @onCheckChange: NPCTrade.setItem(self)
Item Item
id: item id: item
phantom: true phantom: true
anchors.top: parent.top anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
margin-top: 2 margin-top: 2
Label Label
id: nameLabel id: nameLabel
phantom: true phantom: true
@ -27,7 +27,7 @@ NPCItemBox < UICheckBox
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text-auto-resize: true text-auto-resize: true
margin-top: 5 margin-top: 5
Label Label
id: weightLabel id: weightLabel
phantom: true phantom: true
@ -35,7 +35,7 @@ NPCItemBox < UICheckBox
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text-auto-resize: true text-auto-resize: true
margin-top: 5 margin-top: 5
Label Label
id: priceLabel id: priceLabel
phantom: true phantom: true
@ -46,21 +46,21 @@ NPCItemBox < UICheckBox
$checked: $checked:
border-color: #FFFFFF border-color: #FFFFFF
$hover !checked: $hover !checked:
border-color: #AAAAAA border-color: #AAAAAA
MainWindow MainWindow
id: npcWindow id: npcWindow
text: NPC Trade !text: tr('NPC Trade')
size: 550 550 size: 550 550
@onEscape: NPCTrade.hide() @onEscape: NPCTrade.hide()
TabButton TabButton
id: buyTab id: buyTab
tooltip: List of items that you're able to buy !tooltip: tr("List of items that you're able to buy")
text: Buy !text: tr('Buy')
checked: true checked: true
on: true on: true
anchors.left: parent.left anchors.left: parent.left
@ -71,23 +71,23 @@ MainWindow
TabButton TabButton
id: sellTab id: sellTab
tooltip: List of items that you're able to sell !tooltip: tr("List of items that you're able to sell")
text: Sell !text: tr('Sell')
anchors.left: parent.horizontalCenter anchors.left: parent.horizontalCenter
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
margin-left: 5 margin-left: 5
margin-top: 5 margin-top: 5
Label Label
id: searchLabel id: searchLabel
text: Search: !text: tr('Search:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
text-auto-resize: true text-auto-resize: true
margin-top: 7 margin-top: 7
margin-left: 2 margin-left: 2
TextEdit TextEdit
id: searchText id: searchText
width: 200 width: 200
@ -96,14 +96,14 @@ MainWindow
margin-top: -2 margin-top: -2
margin-left: 5 margin-left: 5
@onTextChange: NPCTrade.refreshFilters() @onTextChange: NPCTrade.refreshFilters()
NPCPanel NPCPanel
height: 250 height: 250
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
VerticalScrollBar VerticalScrollBar
id: itemsPanelListScrollBar id: itemsPanelListScrollBar
anchors.top: parent.top anchors.top: parent.top
@ -111,7 +111,7 @@ MainWindow
anchors.right: parent.right anchors.right: parent.right
step: 14 step: 14
pixels-scroll: true pixels-scroll: true
NPCPanel NPCPanel
id: itemsPanel id: itemsPanel
height: 250 height: 250
@ -125,7 +125,7 @@ MainWindow
cell-size: 160 90 cell-size: 160 90
flow: true flow: true
auto-spacing: true auto-spacing: true
FlatPanel FlatPanel
id: setupPanel id: setupPanel
height: 150 height: 150
@ -134,10 +134,10 @@ MainWindow
anchors.right: parent.right anchors.right: parent.right
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
Label Label
id: quantityLabel id: quantityLabel
text: Quantity: !text: tr('Quantity:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
text-auto-resize: true text-auto-resize: true
@ -146,7 +146,7 @@ MainWindow
NPCOfferLabel NPCOfferLabel
id: quantity id: quantity
HorizontalScrollBar HorizontalScrollBar
id: quantityScroll id: quantityScroll
anchors.left: parent.left anchors.left: parent.left
@ -161,74 +161,74 @@ MainWindow
Label Label
id: nameLabel id: nameLabel
text: Name: !text: tr('Name:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
margin-left: 2 margin-left: 2
width: 64 width: 64
NPCOfferLabel NPCOfferLabel
id: name id: name
Label Label
id: priceLabel id: priceLabel
text: Price: !text: tr('Price:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
margin-left: 2 margin-left: 2
width: 64 width: 64
NPCOfferLabel NPCOfferLabel
id: price id: price
Label Label
id: moneyLabel id: moneyLabel
text: Money: !text: tr('Money:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
margin-left: 2 margin-left: 2
width: 64 width: 64
NPCOfferLabel NPCOfferLabel
id: money id: money
Label Label
id: weightLabel id: weightLabel
text: Weight: !text: tr('Weight:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
margin-left: 2 margin-left: 2
width: 64 width: 64
NPCOfferLabel NPCOfferLabel
id: weight id: weight
Label Label
id: capacityLabel id: capacityLabel
text: Capacity: !text: tr('Capacity:')
anchors.left: parent.left anchors.left: parent.left
anchors.top: prev.bottom anchors.top: prev.bottom
margin-top: 5 margin-top: 5
margin-left: 2 margin-left: 2
width: 64 width: 64
NPCOfferLabel NPCOfferLabel
id: capacity id: capacity
Button Button
id: setupButton id: setupButton
text: Buy !text: tr('Buy')
width: 64 width: 64
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: prev.bottom anchors.top: prev.bottom
@onClick: NPCTrade.setupButton() @onClick: NPCTrade.setupButton()
Button Button
text: Close !text: tr('Close')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -1,5 +1,5 @@
Window Window
text: Select Outfit !text: tr('Select Outfit')
size: 550 280 size: 550 280
padding: 0 0 0 0 padding: 0 0 0 0
@ -11,7 +11,7 @@ Window
Label Label
id: outfitName id: outfitName
text: Outfit Name !text: tr('Outfit Name')
width: 100 width: 100
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
@ -43,7 +43,7 @@ Window
ButtonBox ButtonBox
id: head id: head
text: Head !text: tr('Head')
anchors.top: outfitCreatureBox.top anchors.top: outfitCreatureBox.top
anchors.left: outfitCreatureBox.right anchors.left: outfitCreatureBox.right
margin-left: 10 margin-left: 10
@ -52,21 +52,21 @@ Window
ButtonBox ButtonBox
id: primary id: primary
text: Primary !text: tr('Primary')
anchors.top: prev.bottom anchors.top: prev.bottom
anchors.left: prev.left anchors.left: prev.left
width: 90 width: 90
ButtonBox ButtonBox
id: secondary id: secondary
text: Secondary !text: tr('Secondary')
anchors.top: prev.bottom anchors.top: prev.bottom
anchors.left: prev.left anchors.left: prev.left
width: 90 width: 90
ButtonBox ButtonBox
id: detail id: detail
text: Detail !text: tr('Detail')
anchors.top: prev.bottom anchors.top: prev.bottom
anchors.left: prev.left anchors.left: prev.left
width: 90 width: 90
@ -91,7 +91,7 @@ Window
CheckBox CheckBox
id: addon1 id: addon1
text: Addon 1 !text: tr('Addon 1')
enabled: false enabled: false
margin-top: 6 margin-top: 6
width: 100 width: 100
@ -100,7 +100,7 @@ Window
CheckBox CheckBox
id: addon2 id: addon2
text: Addon 2 !text: tr('Addon 2')
enabled: false enabled: false
margin-top: 2 margin-top: 2
width: 100 width: 100
@ -109,7 +109,7 @@ Window
CheckBox CheckBox
id: addon3 id: addon3
text: Addon 3 !text: tr('Addon 3')
enabled: false enabled: false
margin-top: 2 margin-top: 2
width: 100 width: 100
@ -126,7 +126,7 @@ Window
Button Button
id: outfitOkButton id: outfitOkButton
text: Ok !text: tr('Ok')
width: 64 width: 64
anchors.right: next.left anchors.right: next.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@ -136,7 +136,7 @@ Window
Button Button
id: outfitCancelButton id: outfitCancelButton
text: Cancel !text: tr('Cancel')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -36,7 +36,7 @@ function Skills.init()
}) })
skillsWindow = displayUI('skills.otui', GameInterface.getLeftPanel()) skillsWindow = displayUI('skills.otui', GameInterface.getLeftPanel())
skillsButton = TopMenu.addGameToggleButton('skillsButton', 'Skills (Ctrl+S)', 'skills.png', Skills.toggle) skillsButton = TopMenu.addGameToggleButton('skillsButton', tr('Skills') .. ' (Ctrl+S)', 'skills.png', Skills.toggle)
skillsButton:setOn(true) skillsButton:setOn(true)
Keyboard.bindKeyDown('Ctrl+S', Skills.toggle) Keyboard.bindKeyDown('Ctrl+S', Skills.toggle)
end end
@ -86,7 +86,7 @@ end
function Skills.onLevelChange(localPlayer, value, percent) function Skills.onLevelChange(localPlayer, value, percent)
setSkillValue('level', tr(value)) setSkillValue('level', tr(value))
setSkillPercent('level', percent, 'You have ' .. (100 - percent) .. ' percent to go') setSkillPercent('level', percent, tr('You have %s percent to go', 100 - percent))
end end
function Skills.onHealthChange(localPlayer, health, maxHealth) function Skills.onHealthChange(localPlayer, health, maxHealth)
@ -114,16 +114,16 @@ function Skills.onStaminaChange(localPlayer, stamina)
local percent = 100 * stamina / (42 * 60) -- max is 42 hours local percent = 100 * stamina / (42 * 60) -- max is 42 hours
setSkillValue('stamina', hours .. ":" .. minutes) setSkillValue('stamina', hours .. ":" .. minutes)
setSkillPercent('stamina', percent, 'You have ' .. percent .. ' percent') setSkillPercent('stamina', percent, tr('You have %s percent', percent))
end end
function Skills.onMagicLevelChange(localPlayer, value, percent) function Skills.onMagicLevelChange(localPlayer, value, percent)
setSkillValue('magiclevel', value) setSkillValue('magiclevel', value)
setSkillPercent('magiclevel', percent, 'You have ' .. (100 - percent) .. ' percent to go') setSkillPercent('magiclevel', percent, tr('You have %s percent to go', 100 - percent))
end end
function Skills.onSkillChange(localPlayer, id, level, percent) function Skills.onSkillChange(localPlayer, id, level, percent)
setSkillValue('skillId' .. id, level) setSkillValue('skillId' .. id, level)
setSkillPercent('skillId' .. id, percent, 'You have ' .. (100 - percent) .. ' percent to go') setSkillPercent('skillId' .. id, percent, tr('You have %s percent to go', 100 - percent))
end end

View File

@ -32,7 +32,7 @@ SkillPercentPanel < ProgressBar
MiniWindow MiniWindow
id: skillWindow id: skillWindow
text: Skills !text: tr('Skills')
height: 350 height: 350
icon: skills.png icon: skills.png
@onClose: Skills.toggle() @onClose: Skills.toggle()
@ -45,13 +45,13 @@ MiniWindow
id: experience id: experience
height: 15 height: 15
SkillNameLabel SkillNameLabel
text: Experience !text: tr('Experience')
SkillValueLabel SkillValueLabel
SkillButton SkillButton
id: level id: level
SkillNameLabel SkillNameLabel
text: Level !text: tr('Level')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
background-color: red background-color: red
@ -60,41 +60,41 @@ MiniWindow
id: health id: health
height: 15 height: 15
SkillNameLabel SkillNameLabel
text: Hit Points !text: tr('Hit Points')
SkillValueLabel SkillValueLabel
SkillButton SkillButton
id: mana id: mana
height: 15 height: 15
SkillNameLabel SkillNameLabel
text: Mana !text: tr('Mana')
SkillValueLabel SkillValueLabel
SkillButton SkillButton
id: soul id: soul
height: 15 height: 15
SkillNameLabel SkillNameLabel
text: Soul Points !text: tr('Soul Points')
SkillValueLabel SkillValueLabel
SkillButton SkillButton
id: capacity id: capacity
height: 15 height: 15
SkillNameLabel SkillNameLabel
text: Capacity !text: tr('Capacity')
SkillValueLabel SkillValueLabel
SkillButton SkillButton
id: stamina id: stamina
SkillNameLabel SkillNameLabel
text: Stamina !text: tr('Stamina')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
SkillButton SkillButton
id: magiclevel id: magiclevel
SkillNameLabel SkillNameLabel
text: Magic Level !text: tr('Magic Level')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
background-color: red background-color: red
@ -102,14 +102,14 @@ MiniWindow
SkillButton SkillButton
id: skillId0 id: skillId0
SkillNameLabel SkillNameLabel
text: Fist Fighting !text: tr('Fist Fighting')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
SkillButton SkillButton
id: skillId1 id: skillId1
SkillNameLabel SkillNameLabel
text: Club Fighting !text: tr('Club Fighting')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
@ -117,35 +117,35 @@ MiniWindow
id: skillId2 id: skillId2
SkillNameLabel SkillNameLabel
text: Sword Fighting !text: tr('Sword Fighting')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
SkillButton SkillButton
id: skillId3 id: skillId3
SkillNameLabel SkillNameLabel
text: Axe Fighting !text: tr('Axe Fighting')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
SkillButton SkillButton
id: skillId4 id: skillId4
SkillNameLabel SkillNameLabel
text: Distance Fighting !text: tr('Distance Fighting')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
SkillButton SkillButton
id: skillId5 id: skillId5
SkillNameLabel SkillNameLabel
text: Shielding !text: tr('Shielding')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel
SkillButton SkillButton
id: skillId6 id: skillId6
SkillNameLabel SkillNameLabel
text: Fishing !text: tr('Fishing')
SkillValueLabel SkillValueLabel
SkillPercentPanel SkillPercentPanel

View File

@ -5,14 +5,14 @@ importStyle 'textmessage.otui'
-- private variables -- private variables
local MessageTypes = { local MessageTypes = {
consoleRed = { color = '#F55E5E', consoleTab = 'Default' }, consoleRed = { color = '#F55E5E', consoleTab = tr('Default') },
consoleOrange = { color = '#FE6500', consoleTab = 'Default' }, consoleOrange = { color = '#FE6500', consoleTab = tr('Default') },
consoleBlue = { color = '#9F9DFD', consoleTab = 'Default' }, consoleBlue = { color = '#9F9DFD', consoleTab = tr('Default') },
warning = { color = '#F55E5E', consoleTab = 'Server Log', labelId = 'centerWarning', wrap = true }, warning = { color = '#F55E5E', consoleTab = tr('Server Log'), labelId = 'centerWarning', wrap = true },
infoDescription = { color = '#00EB00', consoleTab = 'Server Log', labelId = 'centerInfo', consoleOption = 'showInfoMessagesInConsole', wrap = true }, infoDescription = { color = '#00EB00', consoleTab = tr('Server Log'), labelId = 'centerInfo', consoleOption = 'showInfoMessagesInConsole', wrap = true },
eventAdvance = { color = '#FFFFFF', consoleTab = 'Server Log', labelId = 'centerAdvance', consoleOption = 'showEventMessagesInConsole', wrap = true }, eventAdvance = { color = '#FFFFFF', consoleTab = tr('Server Log'), labelId = 'centerAdvance', consoleOption = 'showEventMessagesInConsole', wrap = true },
eventDefault = { color = '#FFFFFF', consoleTab = 'Server Log', labelId = 'bottomStatus', consoleOption = 'showEventMessagesInConsole' }, eventDefault = { color = '#FFFFFF', consoleTab = tr('Server Log'), labelId = 'bottomStatus', consoleOption = 'showEventMessagesInConsole' },
statusDefault = { color = '#FFFFFF', consoleTab = 'Server Log', labelId = 'bottomStatus', consoleOption = 'showStatusMessagesInConsole' }, statusDefault = { color = '#FFFFFF', consoleTab = tr('Server Log'), labelId = 'bottomStatus', consoleOption = 'showStatusMessagesInConsole' },
statusSmall = { color = '#FFFFFF', labelId = 'bottomStatus' }, statusSmall = { color = '#FFFFFF', labelId = 'bottomStatus' },
} }

View File

@ -5,8 +5,8 @@ Module
@onLoad: | @onLoad: |
if not g_thingsType.load('/game_tibiafiles/Tibia.dat') then if not g_thingsType.load('/game_tibiafiles/Tibia.dat') then
fatal("Unable to load dat file, please place a valid Tibia dat in modules/game_tibiafiles/Tibia.dat") fatal(tr("Unable to load dat file, please place a valid Tibia dat in modules/game_tibiafiles/Tibia.dat"))
end end
if not g_sprites.load('/game_tibiafiles/Tibia.spr') then if not g_sprites.load('/game_tibiafiles/Tibia.spr') then
fatal("Unable to load spr file, please place a valid Tibia spr in modules/game_tibiafiles/Tibia.spr") fatal(tr("Unable to load spr file, please place a valid Tibia spr in modules/game_tibiafiles/Tibia.spr"))
end end

View File

@ -1,11 +1,11 @@
MainWindow MainWindow
size: 256 128 size: 256 128
text: Add to VIP list !text: tr('Add to VIP list')
@onEnter: VipList.addVip() @onEnter: VipList.addVip()
@onEscape: VipList.destroyAddWindow() @onEscape: VipList.destroyAddWindow()
Label Label
text: Please enter a character name: !text: tr('Please enter a character name:')
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@ -24,7 +24,7 @@ MainWindow
margin-bottom: 10 margin-bottom: 10
Button Button
text: Ok !text: tr('Ok')
width: 64 width: 64
anchors.right: next.left anchors.right: next.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@ -32,7 +32,7 @@ MainWindow
@onClick: VipList.addVip() @onClick: VipList.addVip()
Button Button
text: Cancel !text: tr('Cancel')
width: 64 width: 64
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@ -13,7 +13,7 @@ function VipList.init()
vipWindow = displayUI('viplist.otui', GameInterface.getLeftPanel()) vipWindow = displayUI('viplist.otui', GameInterface.getLeftPanel())
vipButton = TopMenu.addGameToggleButton('vipListButton', 'VIP list', 'viplist.png', VipList.toggle) vipButton = TopMenu.addGameToggleButton('vipListButton', tr('VIP list'), 'viplist.png', VipList.toggle)
vipButton:setOn(true) vipButton:setOn(true)
end end
@ -127,10 +127,10 @@ function VipList.onVipListLabelMousePress(widget, mousePos, mouseButton)
local vipList = vipWindow:getChildById('contentsPanel') local vipList = vipWindow:getChildById('contentsPanel')
local menu = createWidget('PopupMenu') local menu = createWidget('PopupMenu')
menu:addOption('Add new VIP', function() VipList.createAddWindow() end) menu:addOption(tr('Add new VIP'), function() VipList.createAddWindow() end)
menu:addOption('Remove ' .. widget:getText(), function() if widget then g_game.removeVip(widget:getId():sub(4)) vipList:removeChild(widget) end end) menu:addOption(tr('Remove %s', widget:getText()), function() if widget then g_game.removeVip(widget:getId():sub(4)) vipList:removeChild(widget) end end)
menu:addSeparator() menu:addSeparator()
menu:addOption('Copy Name', function() g_window.setClipboardText(widget:getText()) end) menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(widget:getText()) end)
menu:display(mousePos) menu:display(mousePos)
return true return true

View File

@ -5,7 +5,7 @@ VipListLabel < GameLabel
MiniWindow MiniWindow
id: vipWindow id: vipWindow
text: VIP List !text: tr('VIP List')
height: 100 height: 100
icon: viplist.png icon: viplist.png
@onClose: VipList.toggle() @onClose: VipList.toggle()

View File

@ -89,16 +89,17 @@ void MapView::draw(const Rect& rect)
for(int z=m_cachedLastVisibleFloor;z>=m_cachedFirstVisibleFloor;--z) { for(int z=m_cachedLastVisibleFloor;z>=m_cachedFirstVisibleFloor;--z) {
while(it != end) { while(it != end) {
const TilePtr& tile = *it; const TilePtr& tile = *it;
if(tile->getPosition().z != z) Position tilePos = tile->getPosition();
if(tilePos.z != z)
break; break;
else else
++it; ++it;
if(!m_drawMinimapColors) if(!m_drawMinimapColors)
tile->draw(transformPositionTo2D(tile->getPosition()), scaleFactor, drawFlags); tile->draw(transformPositionTo2D(tilePos), scaleFactor, drawFlags);
else { else {
g_painter->setColor(tile->getMinimapColor()); g_painter->setColor(tile->getMinimapColor());
g_painter->drawFilledRect(Rect(transformPositionTo2D(tile->getPosition()), tileSize)); g_painter->drawFilledRect(Rect(transformPositionTo2D(tilePos), tileSize));
} }
} }