Adjusted chase modes to work correctly, added new option for auto chase override. Fixed NPC speak messages to appear in the correct position.

This commit is contained in:
BeniS
2012-07-08 02:09:50 +12:00
parent 6a85c31a77
commit 4453242bee
6 changed files with 34 additions and 9 deletions

View File

@@ -3,6 +3,10 @@ Panel
id: classicControl
!text: tr('Classic control')
OptionCheckBox
id: autoChaseOverride
!text: tr('Allow auto chase override')
OptionCheckBox
id: showInfoMessagesInConsole
!text: tr('Show info messages in console')

View File

@@ -5,6 +5,7 @@ local defaultOptions = {
showfps = true,
fullscreen = false,
classicControl = false,
autoChaseOverride = true,
showStatusMessagesInConsole = true,
showEventMessagesInConsole = true,
showInfoMessagesInConsole = true,
@@ -144,7 +145,9 @@ function Options.setOption(key, value)
value = 0
end
if graphicsPanel then graphicsPanel:getChildById('backgroundFrameRateLabel'):setText(tr('Game framerate limit: %s', text)) end
if graphicsPanel then
graphicsPanel:getChildById('backgroundFrameRateLabel'):setText(tr('Game framerate limit: %s', text))
end
g_app.setBackgroundPaneMaxFps(value)
elseif key == 'foregroundFrameRate' then
local text = value
@@ -153,7 +156,9 @@ function Options.setOption(key, value)
value = 0
end
if graphicsPanel then graphicsPanel:getChildById('foregroundFrameRateLabel'):setText(tr('Interface framerate limit: %s', text)) end
if graphicsPanel then
graphicsPanel:getChildById('foregroundFrameRateLabel'):setText(tr('Interface framerate limit: %s', text))
end
g_app.setForegroundPaneMaxFps(value)
elseif key == 'painterEngine' then
g_graphics.selectPainterEngine(value)

View File

@@ -64,7 +64,8 @@ function CombatControls.init()
onGameEnd = CombatControls.offline,
onFightModeChange = CombatControls.update,
onChaseModeChange = CombatControls.update,
onSafeFightChange = CombatControls.update
onSafeFightChange = CombatControls.update,
onWalk = CombatControls.check
})
if g_game.isOnline() then
@@ -97,7 +98,8 @@ function CombatControls.terminate()
onGameEnd = CombatControls.offline,
onFightModeChange = CombatControls.update,
onChaseModeChange = CombatControls.update,
onSafeFightChange = CombatControls.update
onSafeFightChange = CombatControls.update,
onWalk = CombatControls.check
})
CombatControls = nil
@@ -120,6 +122,14 @@ function CombatControls.update()
safeFightButton:setChecked(not safeFight)
end
function CombatControls.check()
if(Options.getOption('autoChaseOverride')) then
if(g_game.isAttacking() and g_game.getChaseMode() == ChaseOpponent) then
g_game.setChaseMode(DontChase)
end
end
end
function CombatControls.online()
combatControlsWindow:setVisible(combatControlsButton:isOn())
CombatControls.update()

View File

@@ -94,7 +94,9 @@ local function onCreatureSpeak(name, level, speaktype, message, channelId, creat
if speaktype.private then
Console.addPrivateText(composedMessage, speaktype, name, false, name)
if Options.getOption('showPrivateMessagesOnScreen') then
TextMessage.displayPrivate(name .. ':\n' .. message)
if(speakType.speakType ~= privateNpcToPlayer) then
TextMessage.displayPrivate(name .. ':\n' .. message)
end
end
else
local channel = tr('Default')