Fix for chat commands #s #w #y
* Some progressbar changes
This commit is contained in:
parent
07dd78002b
commit
62f38d678d
|
@ -38,7 +38,7 @@ CreatureButton < UICreatureButton
|
|||
margin-left: 2
|
||||
phantom: true
|
||||
|
||||
ProgressBar
|
||||
LifeProgressBar
|
||||
id: lifeBar
|
||||
height: 5
|
||||
anchors.left: spacer.right
|
||||
|
|
|
@ -1,19 +1,23 @@
|
|||
ProgressBar < UIProgressBar
|
||||
height: 16
|
||||
background-color: red
|
||||
border: 1 black
|
||||
image-source: /images/ui/progressbar
|
||||
image-border: 1
|
||||
font: verdana-11px-rounded
|
||||
text-offset: 0 2
|
||||
on: true
|
||||
|
||||
$!on:
|
||||
visible: false
|
||||
margin-top: 0
|
||||
margin-bottom: 0
|
||||
height: 0
|
||||
|
||||
LifeProgressBar < UIProgressBar
|
||||
height: 16
|
||||
background-color: green
|
||||
border: 1 black
|
||||
font: verdana-11px-rounded
|
||||
text-offset: 0 2
|
||||
margin: 2
|
||||
|
||||
ProgressRect < UIProgressRect
|
||||
anchors.fill: parent
|
||||
phantom: true
|
||||
|
|
|
@ -4,6 +4,7 @@ UIProgressBar = extends(UIWidget)
|
|||
function UIProgressBar.create()
|
||||
local progressbar = UIProgressBar.internalCreate()
|
||||
progressbar:setFocusable(false)
|
||||
progressbar:setOn(true)
|
||||
progressbar.min = 0
|
||||
progressbar.max = 100
|
||||
progressbar.value = 0
|
||||
|
|
|
@ -605,18 +605,36 @@ function sendMessage(message, tab)
|
|||
end
|
||||
|
||||
-- handling chat commands
|
||||
local channel = tab.channelId
|
||||
local originalMessage = message
|
||||
local chatCommandSayMode
|
||||
local chatCommandPrivate
|
||||
local chatCommandPrivateReady
|
||||
local chatCommandMessage
|
||||
|
||||
local chatCommandMessage = message:match("^%#y (.*)")
|
||||
if chatCommandMessage ~= nil then chatCommandSayMode = 'yell' end -- player used yell command
|
||||
message = chatCommandMessage or message
|
||||
-- player used yell command
|
||||
chatCommandMessage = message:match("^%#y (.*)")
|
||||
if chatCommandMessage ~= nil then
|
||||
chatCommandSayMode = 'yell'
|
||||
channel = 0
|
||||
message = chatCommandMessage
|
||||
end
|
||||
|
||||
-- player used whisper
|
||||
local chatCommandMessage = message:match("^%#w (.*)")
|
||||
if chatCommandMessage ~= nil then chatCommandSayMode = 'whisper' end -- player used whisper
|
||||
message = chatCommandMessage or message
|
||||
if chatCommandMessage ~= nil then
|
||||
chatCommandSayMode = 'whisper'
|
||||
message = chatCommandMessage
|
||||
channel = 0
|
||||
end
|
||||
|
||||
-- player say
|
||||
local chatCommandMessage = message:match("^%#s (.*)")
|
||||
if chatCommandMessage ~= nil then
|
||||
chatCommandSayMode = 'say'
|
||||
message = chatCommandMessage
|
||||
channel = 0
|
||||
end
|
||||
|
||||
local findIni, findEnd, chatCommandInitial, chatCommandPrivate, chatCommandEnd, chatCommandMessage = message:find("([%*%@])(.+)([%*%@])(.*)")
|
||||
if findIni ~= nil and findIni == 1 then -- player used private chat command
|
||||
|
@ -643,15 +661,15 @@ function sendMessage(message, tab)
|
|||
end
|
||||
|
||||
local speaktypedesc
|
||||
if (tab.channelId or tab == defaultTab) and not chatCommandPrivateReady then
|
||||
if (channel or tab == defaultTab) and not chatCommandPrivateReady then
|
||||
if tab == defaultTab then
|
||||
speaktypedesc = chatCommandSayMode or SayModes[consolePanel:getChildById('sayModeButton').sayMode].speakTypeDesc
|
||||
if speaktypedesc ~= 'say' then sayModeChange(2) end -- head back to say mode
|
||||
else
|
||||
speaktypedesc = 'channelYellow'
|
||||
speaktypedesc = chatCommandSayMode or 'channelYellow'
|
||||
end
|
||||
|
||||
g_game.talkChannel(SpeakTypesSettings[speaktypedesc].speakType, tab.channelId, message)
|
||||
g_game.talkChannel(SpeakTypesSettings[speaktypedesc].speakType, channel, message)
|
||||
return
|
||||
else
|
||||
local isPrivateCommand = false
|
||||
|
|
|
@ -4,6 +4,7 @@ HealthBar < ProgressBar
|
|||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin: 1
|
||||
|
||||
ManaBar < ProgressBar
|
||||
id: manaBar
|
||||
|
@ -11,6 +12,7 @@ ManaBar < ProgressBar
|
|||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin: 1
|
||||
margin-top: 3
|
||||
|
||||
ExperienceBar < ProgressBar
|
||||
|
@ -19,9 +21,8 @@ ExperienceBar < ProgressBar
|
|||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin: 1
|
||||
margin-top: 3
|
||||
//margin-top: 6
|
||||
//height: 12
|
||||
|
||||
SoulLabel < GameLabel
|
||||
id: soulLabel
|
||||
|
|
Loading…
Reference in New Issue