OP
Hoopy frood
Joined: Apr 2005
Posts: 1,008 |
reimaging if you look on right side, you see preview window, on some bizzarre irony it wont show any theme preview at all... now this code might be longish :P and clumzy (i didnt made it :tongue: just trying to make it work on new mirc)
dialog Themes {
title "Themes"
size -1 -1 263 120
icon $mircdirsystem\domin.icl, 10
option dbu
box "", 4, 4 12 256 91
box "", 9, 4 12 137 91
text "Current theme: ", 1, 4 4 40 6
text $theme(name), 3, 44 4 100 6
list 2, 5 16 134 86, size
button "&Load", 5, 205 107 27 10
button "&Close", 8, 232 107 27 10, cancel
button "&Hide", 99, 0 0 0 0, hide Ok
;text "- Preview Window -", 17, 175 8 54 6
icon 50, 142 17 116 84
}
on *:dialog:Themes:init:0:{
dll $mircdirsystem\dlls\mdx.dll MarkDialog $dname
dll $mircdirsystem\dlls\mdx.dll SetMircVersion $version
dll $mircdirsystem\dlls\mdx.dll SetControlMDX $dname 2 ListView headerdrag report rowselect flatsb showsel nosortheader single > $views
did -i $dname 2 1 headerdims 130 110 90 200
did -i $dname 2 1 headertext Theme $chr(9) Author $chr(9) Background $chr(9) Description
dll $mircdirsystem\dlls\mdx.dll SetFont $dname 2 12 1 verdana
dll $mircdirsystem\dlls\mdx.dll SetFont $dname 1 12 1 verdana
dll $mircdirsystem\dlls\mdx.dll SetFont $dname 3 12 1 verdana
var %n = 0
While (%n < $findfile(themes,*.dom,0)) {
did -a $dname 2 $calc(%x +1) $readini($findfile(themes,*.dom,$calc(%n +1)),info,name) $chr(9) $readini($findfile(themes,*.dom,$calc(%n +1)),info,author) $chr(9) $readini($findfile(themes,*.dom,$calc(%n +1)),info,background) $chr(9) $readini($findfile(themes,*.dom,$calc(%n +1)),info,description)
inc %n
}
}
on 1:dialog:themes:sclick:5: { _loadthm }
on 1:dialog:themes:sclick:2: { previewtheme }
on 1:dialog:themes:dclick:2: { _loadthm }
....
rest is not important coz its more for LOADING themes
which you fixed
in this case this should matter:
alias previewtheme {
[color:green]
;you add here your new theme preview alias
;like i said above (just for background, black, teal, green atc...)
;from where window reads some values of font, background
;to display in this preview window
[/color]
if ($gettok($did(themes,2,$did(themes,2).sel),7,32) == Black) { did -v themes 50 | preview-black }
elseif ($gettok($did(themes,2,$did(themes,2).sel),7,32) == White) { did -v themes 50 | preview-white }
elseif ($gettok($did(themes,2,$did(themes,2).sel),7,32) == Teal) { did -v themes 50 | preview-teal }
elseif ($gettok($did(themes,2,$did(themes,2).sel),7,32) == Blue) { did -v themes 50 | preview-light_blue }
else { did -v themes 50 | nopreview }
}
alias nopreview {
[color:green]
;this should be section where he cant get preview so
;as on image (above) shows "no preview aveliable"
[/color]
window -c @themes
if ($window(@themes) == $null) {
window -ph +d @themes 300 200 229 165 verdana 11
drawfill @themes 0 0 0 0
}
var %. = drawtext -p @themes 1 verdana 10 x
%. 76 01,00 $str($chr(160),7) Preview not available!
drawsave @themes themes\thmprvw.bmp
if $dialog(themes) {
did -g themes 50 themes\thmprvw.bmp
}
.remove themes\thmprvw.bmp
window -c @themes
}
here comes main part, the preview alias of each theme based on background as stated above. Here is BLACK theme example:
alias preview-black {
var %temp = $theme(name) | If (%temp == $null) { .nopreview | halt }
did -v themes 50
var %thm.file $mircdirthemes\ $+ $theme(name) $+ .dom
.unload -a %thm.file
_loadthmfile $did(themes,2,$did(themes,2).sel)
var %rgb = 0 | while (%rgb < 16) { color -r %rgb | inc %rgb }
var %temp = $readini themes\ $+ $theme(name) $+ .dom colours rgb | if (%temp != $null) { _rgb $readini themes\ $+ $theme(name) $+ .dom colours rgb }
window -c @themes
if ($window(@themes) == $null) { window -ph +d @themes 300 200 229 165 verdana 11 | drawfill @themes 1 1 1 1 }
var %. = drawtext -pb @themes 0 1 verdana 10 x
%. 4 $str($chr(160),1) $theme(joinme,#domination) $str($chr(160),7)
%. 16 $str($chr(160),1) $theme(me,$me,is choosing a theme!) $str($chr(160),7)
%. 28 $str($chr(160),1) $theme(nick,$me,Guest376705) $str($chr(160),7)
%. 40 $str($chr(160),1) $theme(notice,Nickserv,Password accepted now you can [censored] off!) $str($chr(160),7)
%. 52 $str($chr(160),1) $timestamps $+ $theme(logo) $+ $gettok($readini(system\ $+ $theme(name) $+ .dom,colours,colours),12,44) $+ Can't change Nick while you're banned $str($chr(160),7)
%. 64 $str($chr(160),1) $theme(attention,TCP Alert in port 80 (http) from $IP) $str($chr(160),7)
%. 76 $str($chr(160),1) $theme(quit,rOlling,Quit: Ping timeout) $str($chr(160),7)
%. 88 $str($chr(160),1) $theme(echoaway,Off - away time: 17s) $str($chr(160),7)
%. 100 $str($chr(160),1) $theme(joins,Raptor,domi@raptor.tech.nu) $str($chr(160),7)
%. 112 $str($chr(160),1) $theme(part,$me,id@localhost) $str($chr(160),7)
%. 124 $str($chr(160),1) $theme(metext,$me,Hi! How are you?)
%. 136 $str($chr(160),1) $theme(wsl,pRonEtIvAgO)
%. 148 $str($chr(160),1) $theme(raw311name,pRonEtIvAgO,www.domination.pt.vu)
drawsave @themes themes\thmprvw.bmp
if $dialog(themes) { did -g themes 50 themes\thmprvw.bmp }
.remove themes\thmprvw.bmp
.unload -a themes\ $+ $theme(name) $+ .dom
.load -a %thm.file
var %rgb = 0 | while (%rgb < 16) { color -r %rgb | inc %rgb }
var %temp = $readini themes\ $+ $theme(name) $+ .dom colours rgb | if (%temp != $null) { _rgb $readini themes\ $+ $theme(name) $+ .dom colours rgb }
window -c @themes
}
any help would be greatly apreciated =)
|