Merge pull request #350 from conde2/master
Fix Keyboard unbind, WASD walk, Mount Frames, Fix #349, #344, #304, #253 Thanks @conde2!
This commit is contained in:
commit
2c36ca7215
|
@ -157,14 +157,14 @@ function g_keyboard.unbindKeyDown(keyComboDesc, arg1, arg2)
|
||||||
disconnect(widget.boundKeyDownCombos, keyComboDesc, callback)
|
disconnect(widget.boundKeyDownCombos, keyComboDesc, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.unbindKeyUp(keyComboDesc, widget)
|
function g_keyboard.unbindKeyUp(keyComboDesc, arg1, arg2)
|
||||||
local callback, widget = getUnbindArgs(arg1, arg2)
|
local callback, widget = getUnbindArgs(arg1, arg2)
|
||||||
if widget.boundKeyUpCombos == nil then return end
|
if widget.boundKeyUpCombos == nil then return end
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
disconnect(widget.boundKeyUpCombos, keyComboDesc, callback)
|
disconnect(widget.boundKeyUpCombos, keyComboDesc, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.unbindKeyPress(keyComboDesc, widget, callback)
|
function g_keyboard.unbindKeyPress(keyComboDesc, arg1, arg2)
|
||||||
local callback, widget = getUnbindArgs(arg1, arg2)
|
local callback, widget = getUnbindArgs(arg1, arg2)
|
||||||
if widget.boundKeyPressCombos == nil then return end
|
if widget.boundKeyPressCombos == nil then return end
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
|
|
|
@ -89,8 +89,8 @@ function bindKeys()
|
||||||
end
|
end
|
||||||
|
|
||||||
function bindWalkKey(key, dir)
|
function bindWalkKey(key, dir)
|
||||||
g_keyboard.bindKeyDown(key, function() changeWalkDir(dir) end, gameRootPanel)
|
g_keyboard.bindKeyDown(key, function() changeWalkDir(dir) end, gameRootPanel, true)
|
||||||
g_keyboard.bindKeyUp(key, function() changeWalkDir(dir, true) end, gameRootPanel)
|
g_keyboard.bindKeyUp(key, function() changeWalkDir(dir, true) end, gameRootPanel, true)
|
||||||
g_keyboard.bindKeyPress(key, function() smartWalk(dir) end, gameRootPanel)
|
g_keyboard.bindKeyPress(key, function() smartWalk(dir) end, gameRootPanel)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ MessageTypes = {
|
||||||
[MessageModes.Blue] = MessageSettings.consoleBlue,
|
[MessageModes.Blue] = MessageSettings.consoleBlue,
|
||||||
[MessageModes.PrivateFrom] = MessageSettings.consoleBlue,
|
[MessageModes.PrivateFrom] = MessageSettings.consoleBlue,
|
||||||
|
|
||||||
|
[MessageModes.GamemasterBroadcast] = MessageSettings.consoleRed,
|
||||||
|
|
||||||
[MessageModes.DamageDealed] = MessageSettings.status,
|
[MessageModes.DamageDealed] = MessageSettings.status,
|
||||||
[MessageModes.DamageReceived] = MessageSettings.status,
|
[MessageModes.DamageReceived] = MessageSettings.status,
|
||||||
[MessageModes.Heal] = MessageSettings.status,
|
[MessageModes.Heal] = MessageSettings.status,
|
||||||
|
|
|
@ -458,6 +458,11 @@ void Creature::updateWalkAnimation(int totalPixelsWalked)
|
||||||
|
|
||||||
int footAnimPhases = getAnimationPhases() - 1;
|
int footAnimPhases = getAnimationPhases() - 1;
|
||||||
int footDelay = getStepDuration(true) / 3;
|
int footDelay = getStepDuration(true) / 3;
|
||||||
|
// Since mount is a different outfit we need to get the mount animation phases
|
||||||
|
if(m_outfit.getMount() != 0) {
|
||||||
|
ThingType *type = g_things.rawGetThingType(m_outfit.getMount(), m_outfit.getCategory());
|
||||||
|
footAnimPhases = type->getAnimationPhases() - 1;
|
||||||
|
}
|
||||||
if(footAnimPhases == 0)
|
if(footAnimPhases == 0)
|
||||||
m_walkAnimationPhase = 0;
|
m_walkAnimationPhase = 0;
|
||||||
else if(m_footStepDrawn && m_footTimer.ticksElapsed() >= footDelay && totalPixelsWalked < 32) {
|
else if(m_footStepDrawn && m_footTimer.ticksElapsed() >= footDelay && totalPixelsWalked < 32) {
|
||||||
|
|
Loading…
Reference in New Issue