Refactor modules, closes #223

* All modules are sandboxed now
* All images,sounds,fonts,translations and styles were moved to "data" folder
* Reorganize image files folders
* Remove unmaintained modules: client_particles, client_shaders
* Implement new automatic way to load styles and fonts
* Add hide/show offline option in VipList
* Add invite/exclude to/from private channel in players menus
* Many other minor changes
This commit is contained in:
Eduardo Bart
2013-01-18 20:39:11 -02:00
parent 20d9176d10
commit 28b5fc1d5a
330 changed files with 1171 additions and 1823 deletions

View File

@@ -40,9 +40,9 @@ SpeakTypes = {
}
SayModes = {
[1] = { speakTypeDesc = 'whisper', icon = 'icons/whisper.png' },
[2] = { speakTypeDesc = 'say', icon = 'icons/say.png' },
[3] = { speakTypeDesc = 'yell', icon = 'icons/yell.png' }
[1] = { speakTypeDesc = 'whisper', icon = '/images/game/console/icons/whisper' },
[2] = { speakTypeDesc = 'say', icon = '/images/game/console/icons/say' },
[3] = { speakTypeDesc = 'yell', icon = '/images/game/console/icons/yell' }
}
MAX_HISTORY = 1000
@@ -79,7 +79,7 @@ function init()
onGameStart = onGameStart,
onGameEnd = clear })
consolePanel = g_ui.loadUI('console.otui', modules.game_interface.getBottomPanel())
consolePanel = g_ui.loadUI('console', modules.game_interface.getBottomPanel())
consoleTextEdit = consolePanel:getChildById('consoleTextEdit')
consoleContentPanel = consolePanel:getChildById('consoleContentPanel')
consoleTabBar = consolePanel:getChildById('consoleTabBar')
@@ -210,7 +210,11 @@ function setTextEditText(text)
end
function openHelp()
g_game.joinChannel(HELP_CHANNEL)
local helpChannel = 9
if g_game.getProtocolVersion() <= 810 then
helpChannel = 8
end
g_game.joinChannel(helpChannel)
end
function addTab(name, focus)
@@ -291,7 +295,7 @@ function addPrivateText(text, speaktype, name, isPrivateCommand, creatureName)
local privateTab = getTab(name)
if privateTab == nil then
if (Options.getOption('showPrivateMessagesInConsole') and not focus) or (isPrivateCommand and not privateTab) then
if (modules.client_options.getOption('showPrivateMessagesInConsole') and not focus) or (isPrivateCommand and not privateTab) then
privateTab = defaultTab
else
privateTab = addTab(name, focus)
@@ -344,7 +348,7 @@ function getHighlightedText(text)
end
function addTabText(text, speaktype, tab, creatureName)
if Options.getOption('showTimestampsInConsole') then
if modules.client_options.getOption('showTimestampsInConsole') then
text = os.date('%H:%M') .. ' ' .. text
end
@@ -448,6 +452,11 @@ function processMessageMenu(mousePos, mouseButton, creatureName, text)
if not g_game.getLocalPlayer():hasVip(creatureName) then
menu:addOption(tr('Add to VIP list'), function () g_game.addVip(creatureName) end)
end
if modules.game_console.getOwnPrivateTab() then
menu:addSeparator()
menu:addOption(tr('Invite to private chat'), function() g_game.inviteToOwnChannel(creatureName) end)
menu:addOption(tr('Exclude from private chat'), function() g_game.excludeFromOwnChannel(creatureName) end)
end
if isIgnored(creatureName) then
menu:addOption(tr('Unignore') .. ' ' .. creatureName, function() removeIgnoredPlayer(creatureName) end)
else
@@ -599,7 +608,7 @@ end
function applyMessagePrefixies(name, level, message)
if name then
if Options.getOption('showLevelsInConsole') and level > 0 then
if modules.client_options.getOption('showLevelsInConsole') and level > 0 then
message = name .. ' [' .. level .. ']: ' .. message
else
message = name .. ': ' .. message
@@ -663,7 +672,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
if speaktype.private then
addPrivateText(composedMessage, speaktype, name, false, name)
if Options.getOption('showPrivateMessagesOnScreen') and speaktype ~= SpeakTypesSettings.privateNpcToPlayer then
if modules.client_options.getOption('showPrivateMessagesOnScreen') and speaktype ~= SpeakTypesSettings.privateNpcToPlayer then
modules.game_textmessage.displayPrivateMessage(name .. ':\n' .. message)
end
else
@@ -734,7 +743,7 @@ end
function onChannelList(channelList)
if channelsWindow then channelsWindow:destroy() end
channelsWindow = g_ui.displayUI('channelswindow.otui')
channelsWindow = g_ui.displayUI('channelswindow')
local channelListPanel = channelsWindow:getChildById('channelList')
channelsWindow.onEnter = doChannelListSubmit
channelsWindow.onDestroy = function() channelsWindow = nil end
@@ -801,7 +810,7 @@ end
function onClickIgnoreButton()
if ignoreWindow then return end
ignoreWindow = g_ui.displayUI('ignorewindow.otui')
ignoreWindow = g_ui.displayUI('ignorewindow')
local ignoreListPanel = ignoreWindow:getChildById('ignoreList')
ignoreWindow.onDestroy = function() ignoreWindow = nil end

View File

@@ -4,6 +4,6 @@ Module
author: edubart, andrefaramir, baxnie, sn4ake, BeniS
website: www.otclient.info
sandboxed: true
scripts: [ console.lua ]
scripts: [ console ]
@onLoad: init()
@onUnload: terminate()

View File

@@ -67,7 +67,7 @@ Panel
TabButton
id: prevChannelButton
icon: icons/leftarrow.png
icon: /images/game/console/leftarrow
anchors.left: parent.left
anchors.top: parent.top
margin-left: 6
@@ -85,7 +85,7 @@ Panel
TabButton
id: nextChannelButton
icon: icons/rightarrow.png
icon: /images/game/console/rightarrow
anchors.right: next.left
anchors.top: parent.top
margin-right: 5
@@ -94,7 +94,7 @@ Panel
TabButton
id: closeChannelButton
!tooltip: tr('Close this channel') .. ' (Ctrl+E)'
icon: icons/closechannel.png
icon: /images/game/console/closechannel
anchors.right: next.left
anchors.top: parent.top
enabled: false
@@ -105,7 +105,7 @@ Panel
TabButton
id: clearChannelButton
!tooltip: tr('Clear current message window')
icon: icons/clearchannel.png
icon: /images/game/console/clearchannel
anchors.right: next.left
anchors.top: parent.top
margin-right: 5
@@ -117,7 +117,7 @@ Panel
TabButton
id: channelsButton
!tooltip: tr('Open new channel') .. ' (Ctrl+O)'
icon: icons/channels.png
icon: /images/game/console/channels
anchors.right: next.left
anchors.top: parent.top
margin-right: 5
@@ -127,7 +127,7 @@ Panel
TabButton
id: ignoreButton
!tooltip: tr('Ignore players')
icon: icons/ignore.png
icon: /images/game/console/ignore
anchors.right: parent.right
anchors.top: parent.top
margin-right: 5
@@ -149,7 +149,7 @@ Panel
TabButton
id: sayModeButton
icon: icons/say.png
icon: /images/game/console/say
!tooltip: tr('Adjust volume')
&sayMode: 2
size: 20 20

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B