Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

HALLP... It makes the label but doesn't apply the style sheet... what am I doing wrong??

NitsujaNitsuja Member Posts: 0

function GetRoomExits()

roomexits = nil

for i,v in pairs(gmcp.Room.Info.exits) do

if not roomexits then

roomexits = string.upper(i)

else

roomexits = roomexits..","..string.upper(i)

end

end

roomexits = roomexits or "TRAPPED!"

roomlabel: setFgColor("red")

roomlabel:echo("Exits - <br>" ..roomexits, nil, "c")

roomLabel.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ADADAD, stop: 1 #9E9E9E);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;

]])

roomLabel.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #575757 stop: 1 #454545);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;

]])

end

roomlabel = Geyser.Label:new({name="Room Exits",x=1200, y=410,width=150, height=30,})

roomlabel : setFgColor("red")

registerAnonymousEventHandler("gmcp.Room.Info", "GetRoomExits")




Comments

  • OrzaansynOrzaansyn Member Posts: 663 @@ - Legendary Achaean

    Which client is it about? Which script language?

    image
  • KeneanungKeneanung ✭✭✭✭ - Eminent Member Posts: 616 ✭✭✭✭ - Eminent

    Looks like Mudlet/lua.

    When you try to apply your stylesheet, you access roomLabel while you create roomlabel. Also labels only have setStyleSheet but no back or front members.

  • CynlaelCynlael Member Posts: 3,257 @@ - Legendary Achaean
    edited May 2014

    ^ this.

    Also

    [spoiler] function GetRoomExits()

    roomexits = nil

    for i,v in pairs(gmcp.Room.Info.exits) do

    if not roomexits then

    roomexits = string.upper(i)

    else

    roomexits = roomexits..","..string.upper(i)

    end [/spoiler]


    That code can simply be shortened to:

    roomexits = table.concat(gmcp.Room.Info.exits, ", ")

    roomexits = string.upper(roomexits)  (if you want it capitalised)


Sign In to Comment.