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
This commit is contained in:
Eduardo Bart 2013-02-04 16:33:34 -02:00
parent 0fc56c73cc
commit 4c51009ed9
4 changed files with 28 additions and 24 deletions

View File

@ -11,7 +11,7 @@ local defaultOptions = {
showInfoMessagesInConsole = true,
showTimestampsInConsole = true,
showLevelsInConsole = true,
showPrivateMessagesInConsole = false,
showPrivateMessagesInConsole = true,
showPrivateMessagesOnScreen = true,
showLeftPanel = false,
foregroundFrameRate = 61,

View File

@ -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

View File

@ -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()

View File

@ -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()