PDA

View Full Version : [Fixed] per section colours in ioB2


eger
11-12-2005, 03:08 AM
Just wondering if there are colors per sections (%scolor) in ioB2. I was reading a lot about the %scolor variable in v20. But i'm not sure if v20 is the same as ioB2. I also went looking in the tcl files and can't find an refernce to scolor. So maybe it wasn't added or was removed.

Just want to find out so I can stop looking and just make the skin without it =)

Thanks!

eger
11-12-2005, 04:04 AM
Hmm... maybe i'm on the right track.

I was editing some of the code in ioBanana.tcl to get colors per section and did this:

Added:
set output [ioB:replacevar $output "%scolour" $colour($section)]

Inside proc ioB:basicreplace and added colour as a global. Then in the announce section I added:
set colour(APPS) 8

Then in my skin made [c]%scolour %section[c]

It looks liek it's working. But I am too tired to continue testing... Though it didn't work for a section that started with a number (like 0DAY) so I had to add the space. Is there a way to escape it or put 2 variables next to eachother and not conflict?

Maybe someone can help me out there =)

EDIT: Guess this wasn't that easy... everything breaks except sections that have colors set. Still trying to find out why.

Harm
11-12-2005, 02:24 PM
You're getting close indeed. Perhaps I should readd that to the next release. I don't use it myself and was probably too focused on implementing core features to think about this one.

You should be able to achieve that using something like this:

proc ioB:basicreplace {section strin} {
global ioBvar colour
if {[info exists colour($section)]} {
set col $colour($section)
} else {
set col $ioBvar(colour)
}
set output [ioB:replacevar $strin "%sitename" $ioBvar(sitename)]
set output [ioB:replacevar $output "%colour" $ioBvar(colour)]
set output [ioB:replacevar $output "%scolour" $col]
set output [ioB:replacevar $output "%section" $section]
return "$output"
}

You then need to define the $colour($section) variables.

You have indeed spotted a weakness of the irc colour system. If the coloured word starts with a number, this one might be interpreted as a part of the coulour code itself. You can add a space after the colour number or use a two digits colour number.

eger
11-12-2005, 02:30 PM
I was working on exactly that Harm!!

But... not knowing tcl or the syntax I was getting lost. Thanks a bunch!

If I modify it or get it working well I will let you know and maybe you can add it to the next release.

ioB2 is coming along nicely. Keep it up =)

EDIT: Also. To get around having the space I was able to stop the color processing by adding a [b][b]. So color would stop at the bold, and the bold would open up again to keep everything the way it was. Seems to work OK.

eger
11-13-2005, 04:02 AM
Harm,

That new basicreplace works perfect for color per section. For anyone wanting to try, make the code adjustment to proc ioB:basicreplace posted by Harm above. Then be sure to add the colors to ioBanana.tcl:

set ioBvar(colour) 7
set colour(APPS) 5
set colour(0DAY) 5
set colour(MP3) 2


Then in your skin you can use the %scolour variable for that sections color. Example NEWDIR:

set announce(NEWDIR) "\[[b][c]%scolour[b][b]%section[c]-[c]%colourNEW[c][b]\] [b]%user[b]/%group has just started [b]%relname[b]."


Thanks Harm!