From 4c51009ed92dcd41c6cd5c3c7f732e0016ed6544 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Mon, 4 Feb 2013 16:33:34 -0200 Subject: [PATCH] Minor fixes * Fix focusing opened channel on login * Add missing options to rule violation window * Send rule violations messages in default channel * Enable show private messages in console by default * Fix battle issues with invisible creatures * Allow to use hotkeys while trading --- modules/client_options/options.lua | 2 +- modules/game_battle/battle.lua | 11 ++++------- modules/game_console/console.lua | 21 +++++++-------------- modules/game_interface/gameinterface.lua | 18 ++++++++++++++++-- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index ca711f7b..bd469ace 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -11,7 +11,7 @@ local defaultOptions = { showInfoMessagesInConsole = true, showTimestampsInConsole = true, showLevelsInConsole = true, - showPrivateMessagesInConsole = false, + showPrivateMessagesInConsole = true, showPrivateMessagesOnScreen = true, showLeftPanel = false, foregroundFrameRate = 61, diff --git a/modules/game_battle/battle.lua b/modules/game_battle/battle.lua index 4ecbce53..0f03d4fe 100644 --- a/modules/game_battle/battle.lua +++ b/modules/game_battle/battle.lua @@ -175,14 +175,11 @@ function onCreaturePositionChange(creature, newPos, oldPos) end end - function onCreatureOutfitChange(creature, outfit, oldOutfit) - if hasCreature(creature) then - if doCreatureFitFilters(creature) then - addCreature(creature) - else - removeCreature(creature) - end + if doCreatureFitFilters(creature) then + addCreature(creature) + else + removeCreature(creature) end end diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 66df893c..86b439dc 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -71,6 +71,7 @@ serverTab = nil violationsChannelId = nil violationWindow = nil violationReportTab = nil +ignoredChannels = {} local ignoreSettings = { privateMessages = false, @@ -346,14 +347,15 @@ end function addChannel(name, id) channels[id] = name - local tab = addTab(name, true) + local focus = not table.find(ignoredChannels, id) + local tab = addTab(name, focus) tab.channelId = id return tab end function addPrivateChannel(receiver) channels[receiver] = receiver - return addTab(receiver, true) + return addTab(receiver, false) end function addPrivateText(text, speaktype, name, isPrivateCommand, creatureName) @@ -833,7 +835,7 @@ function processViolation(name, text) channels[tabname] = tabname tab.violationChatName = name g_game.openRuleViolation(name) - addTabText(text, SpeakTypesSettings.say, tab) + addTabText(text, SpeakTypesSettings.say, tab, name) end function onRuleViolationChannel(channelId) @@ -1025,22 +1027,13 @@ function online() if channelId ~= -1 and channelId < 100 then if not table.find(channels, channelId) then g_game.joinChannel(channelId) + table.insert(ignoredChannels, channelId) end end end end end - - local tab = defaultTab - if tab then - --[[ - Known Issue: The server is calling to open channels after - onGameStart is executed causing it to focus the last tab opened. - - Fix: Don't save channels to the settings that are opened by the server. - ]] - addEvent(function() consoleTabBar:selectTab(tab) end, true) - end + scheduleEvent(function() ignoredChannels = {} end, 3000) end function offline() diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 4b6e1ba9..aefab0bb 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -326,7 +326,14 @@ function onTradeWith(clickedWidget, mousePosition) end function startUseWith(thing) - if g_ui.isMouseGrabbed() or not thing then return end + if not thing then return end + if g_ui.isMouseGrabbed() then + if selectedThing then + selectedThing = thing + selectedType = 'use' + end + return + end selectedType = 'use' selectedThing = thing mouseGrabberWidget:grabMouse() @@ -334,7 +341,14 @@ function startUseWith(thing) end function startTradeWith(thing) - if g_ui.isMouseGrabbed() or not thing then return end + if not thing then return end + if g_ui.isMouseGrabbed() then + if selectedThing then + selectedThing = thing + selectedType = 'trade' + end + return + end selectedType = 'trade' selectedThing = thing mouseGrabberWidget:grabMouse()