clickable text in miniconsoles
clickable text in miniconsoles
What I'm trying to do is create clickable text in a "who here" miniconsole that, when a player's name is clicked, sends the "honours <player name>" command to the mainwindow, essentially displaying his/her honours.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: clickable text in miniconsoles
Try something like this for each playerName, you will probably want to tweak the colours white on a magenta background:
Code: Select all
local command=string.format("honours %s", playerName)
setBgColor("playerWindow", 128, 0, 128)
setFgColor("playerWindow", 255, 255, 255)
echo("playerWindow","\n")
echoLink("playerWindow", playerName, command, "Get player's honours", true)
cecho("playerWindow","<reset>")
Re: clickable text in miniconsoles
Where would I paste that? What will I have to tweak besides the colors? Sorry, I'm kind of high-maintenance.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: clickable text in miniconsoles
You'd paste it in the loop of code that writes out the list of players you have found/captured/stored - I've no idea how you got them (some sort of trigger that responds to the MUD server's response, typically to who or perhaps by logging all the people who Xxxx tells you, Xxxx says, Xxxx chats, Xxx yells,... etc.) the precise mechanisms are something you will have to work out - or crib from others' code. This sample will just provide the clickable link to send the command you requested for each name...