mIRC Homepage
Posted By: Skeletor If $resolution == ??? - 19/02/06 05:38 PM
Hi guys,

I am using an MTS theme engine for my thems, now all is well part from some of the images being to large as I am using a 1600 x 1200 resolution. I want to be able to accomodate for a resolution of 1024 x 768. I have managed to get the background images sorted, It just the toolbar images and the menubar image that are not working out...

Code:
 ImageToolbar Fill Vtec Topbar.jpg
ImageSwitchbar Fill Vtec Sidebar.jpg
ImageMirc Fill Vtec Status.jpg
ImageStatus Fill Vtec Status.jpg
Imagechan Fill Vtec Status.jpg
Imagequery Fill Vtec Status.jpg
Imagebuttons Buttons.PNG 


Is there any way that I could chage it so that if the resolution of 1024 x 768 is being used then it could load another image, I am using a moo.dll to state my stats:

Code:
 .Screen Resolution:/screenstat 


so for example sreen resolution is 1280 x 1024 then it will use image 1 and screen res of 1600 x 1200 will use image 2 and so on...

Any help would be really great
Cheers
Posted By: hixxy Re: If $resolution == ??? - 19/02/06 05:40 PM
Code:
alias getimage {
  var %res = $+($window(-1).w,x,$window(-1).h)
  if (%res == 1600x1200) return <path to image for 1600x1200 resolution>
  elseif (%res == 1280x1024) return <path to image for 1280x1024 resolution>
  ; Etc...
}
Posted By: Skeletor Re: If $resolution == ??? - 19/02/06 05:50 PM
No where abouts should I use that code?

in the mts theme itself

Code:
BASECOLORS 10,10,13,12
RGBCOLORS 255,255,255 0,0,0 0,0,128 0,144,0 255,0,0 128,0,0 160,0,160 255,128,0 91,173,246 46,150,243 117,186,249 91,173,246 7,123,228 160,208,252 128,128,128 208,208,208
COLORS  1,10,10,11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,1,0,1,0,15

ImageToolbar fill Vtec Topbar-16by12.jpg
ImageSwitchbar fill Vtec Sidebar-16by12.jpg
ImageMirc Center Vtec Logo.jpg
ImageStatus Center Vtec Logo.jpg
Imagechan Center Vtec Logo.jpg
Imagequery Center Vtec Logo.jpg
Imagebuttons Buttons.PNG

CLINEOP 4
CLINEHOP 13
CLINEVOICE 3
CLINEREGULAR 13
CLINEOWNER 13
CLINEENEMY 11
CLINEFRIEND 10
CLINEME 15

CLINECHAROWNER .
CLINECHAROP @
CLINECHARHOP %
CLINECHARVOICE +
CLINECHARREGULAR

FONTDEFAULT Tahoma,12
FONTCHAN Tahoma,12
FONTQUERY Tahoma,12

PREFIX  <c4>キ09 キ
PARENTEXT <c4>: [<c3> <text> <c4>]
TIMESTAMP on
TIMESTAMPFORMAT <c4>[11 HH:nn:ss <c4>]  
Posted By: hixxy Re: If $resolution == ??? - 19/02/06 06:03 PM
You have to use the !Script operation in the theme file. I can't remember exactly how to use this as it's been a while since I've used MTS. Check the latest MTS draft.
Posted By: Skeletor Re: If $resolution == ??? - 19/02/06 06:12 PM
Where would be the place to find that?
Posted By: hixxy Re: If $resolution == ??? - 19/02/06 06:21 PM
The original draft (a text document) is here but there's a help file documenting mts here.
Posted By: Skeletor Re: If $resolution == ??? - 19/02/06 06:23 PM
Cheers, Nice one!!!
Posted By: Skeletor Re: If $resolution == ??? - 19/02/06 07:10 PM
I can't seem to make sence of this tut confused

Please someone help blush
Posted By: hixxy Re: If $resolution == ??? - 19/02/06 07:25 PM
Ok instead of these parts:

Code:
ImageToolbar fill Vtec Topbar-16by12.jpg
ImageSwitchbar fill Vtec Sidebar-16by12.jpg
ImageMirc Center Vtec Logo.jpg
ImageStatus Center Vtec Logo.jpg
Imagechan Center Vtec Logo.jpg
Imagequery Center Vtec Logo.jpg
Imagebuttons Buttons.PNG


You have to use something like this:

Code:
ImageToolbar !Script theme.imagetoolbar
ImageSwitchbar !Script theme.imageswitchbar


Then in your [mts] section you need to type this:

Script <file.mrc>

<file.mrc> should be a script file in the same directory as the theme.mts file and it should contain the aliases you specified above in the ImageToolbar and ImageSwitchbar sections. These aliases are responsible for choosing and displaying the images.
Posted By: Skeletor Re: If $resolution == ??? - 20/02/06 12:06 AM
So...

Code:
ImageToolbar !Script theme.imagetoolbar
ImageSwitchbar !Script theme.imageswitchbar
ImageMirc Center Vtec Logo.jpg
ImageStatus Center Vtec Logo.jpg
Imagechan Center Vtec Logo.jpg
Imagequery Center Vtec Logo.jpg
Imagebuttons Buttons.PNG  


in the .mts file.

Code:
 alias side {
  var %res = $+($window(-1).w,x,$window(-1).h)
  if (%res == 1600x1200) return Vtec Sidebar.jpg
  else (%res == 1280x1024) return Vtec Sidebar12by10.jpg
  elseif (%res == 1024x768) return Vtec Sidebar10by7.jpg

}

alias top {
  var %res = $+($window(-1).w,x,$window(-1).h)
  if (%res == 1600x1200) return Vtec Topbar.jpg
  else (%res == 1280x1024) return Vtec Topbar12by10.jpg
  elseif (%res == 1024x768) return Vtec Topbar10by7.jpg

} 


In the remotes?
Posted By: hixxy Re: If $resolution == ??? - 20/02/06 12:31 AM
Code:
ImageToolbar !Script side
ImageSwitchbar !Script top


Also, the code in the mrc file should set the image on the toolbar and switchbar (using /background), not return the path to it.
Posted By: Skeletor Re: If $resolution == ??? - 20/02/06 12:55 AM
This is from my .mrc file...

Code:
alias blue.whoisstart {
  %:echo  $+ %::c4   [11 /whois $+ %::c3 %::nick  $+ %::c4 $+ ] 覧覧覧覧覧覧覧覧覧覧覧覧覧覧
  %:echo  $+ %::c4         : 11 Address  $+ %::c4 $+ : $+ %::c3 %::address
  %:echo  $+ %::c4         : 11 Name  $+ %::c4 $+ : $+ %::c3 %::realname
}

alias blue.whowasstart {
  %:echo  $+ %::c4   [11 /whowas $+ %::c3 %::nick  $+ %::c4 $+ ] 覧覧覧覧覧覧覧覧覧覧覧覧覧覧
  %:echo  $+ %::c4         : 11 Address  $+ %::c4 $+ : $+ %::c3 %::address
  %:echo  $+ %::c4         : 11 Name  $+ %::c4 $+ : $+ %::c3 %::realname
}

alias blue.side {
  var %res = $+($window(-1).w,x,$window(-1).h)
  if (%res == 1600x1200) return Vtec Sidebar.jpg
  else (%res == 1280x1024) return Vtec Sidebar12by10.jpg
  elseif (%res == 1024x768) return Vtec Sidebar10by7.jpg

}

alias blue.top {
  var %res = $+($window(-1).w,x,$window(-1).h)
  if (%res == 1600x1200) return Vtec Topbar.jpg
  else (%res == 1280x1024) return Vtec Topbar12by10.jpg
  elseif (%res == 1024x768) return Vtec Topbar10by7.jpg

}  


This is from the .mts file...

Code:
[mts]
Name VTEC ァcriptョ
Author Oxedizer
Email oxedizer@gmail.com
Website www.dameet.co.uk
Description VTEC ァcriptョ Multiple Coloured Themes
Version 1.0
MTSVersion 1.1
VERSION 3.5
SCRIPT vtecGOLD.mrc

BASECOLORS 10,10,13,12
RGBCOLORS 255,255,255 0,0,0 0,0,128 0,144,0 255,0,0 128,0,0 160,0,160 255,128,0 91,173,246 46,150,243 117,186,249 91,173,246 7,123,228 160,208,252 128,128,128 208,208,208
COLORS  1,10,10,11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,1,0,1,0,15

ImageToolbar !Script blue.top
ImageSwitchbar !Script blue.side
ImageMirc Center Vtec Logo.jpg
ImageStatus Center Vtec Logo.jpg
Imagechan Center Vtec Logo.jpg
Imagequery Center Vtec Logo.jpg
Imagebuttons Buttons.PNG  


it is not loading the images... what that about Return ?

All the .jpg's and .mts and .mrc files are in the same folder called /Themes/
Posted By: HobophobE Re: If $resolution == ??? - 20/02/06 02:30 AM
Code:
alias get.res { return $+($window(-1).w,x,$window(-1).h)  }

alias blue.side.f {
  var %res = $get.res
  if (%res == 1600x1200) { return Vtec Sidebar.jpg }
  elseif (%res == 1280x1024) { return Vtec Sidebar12by10.jpg }
  else { return Vtec Sidebar10by7.jpg }
}

alias blue.top.f {
  var %res = $get.res
  if (%res == 1600x1200) { return Vtec Topbar.jpg }
  elseif (%res == 1280x1024) { return Vtec Topbar12by10.jpg }
  else { return Vtec Topbar10by7.jpg }
}

alias blue.top { background [color:red]-l[/color] $blue.top.f }
alias blue.side { background [color:red]-h[/color] $blue.side.f }

change these as follows:
[for the sidebar if you want it filled, stretched, etc. add the letter to -h. example: -hf to make it filled]
-cfnrtp = center, fill, normal, stretch, tile, photo
[for the 'top' depending if it's buttons, change -l to -u]
-l = toolbar
-u = toolbar buttons


This will only choose between 1600x1200,1280x1024, and 1024x768. If you want it to go lower you will need to add 'elseif' statements based on the examples, and change the final 'else' statement to reflect the lowest resolution image.

hope this helps,

HobophobE
Posted By: Skeletor Re: If $resolution == ??? - 20/02/06 03:04 AM
Okay I have C/P all the code above, into my .mrc file

Now do i still leave the .mts as follows?

Code:
ImageToolbar !Script blue.top
ImageSwitchbar !Script blue.side 


If so, its not loading up

I don't understand his "!Script" Sorry for being a pain, its my first time with Themes
Posted By: Skeletor Re: If $resolution == ??? - 20/02/06 07:23 PM
Anyone know what or how the "!script" function is?
Posted By: HobophobE Re: If $resolution == ??? - 21/02/06 01:20 AM
I've not used this theme setup, but based on the code you showed,
Code:
ImageToolbar !Script blue.top

ImageSwitchbar !Script blue.side 


I'm guessing that the !Script notes that you want the aliases above to use the other aliases.

If you look at the code of one of the above aliases (ImageToolbar, ImageSwitchbar), for the !Script word, you can probably determine what it is wanting to do. If not, feel free to post the code of one of the aliases so that we can try to figure it out.

HobophobE
Posted By: Skeletor Re: If $resolution == ??? - 21/02/06 03:36 AM
My entire .mts file....

[code] [mts]
Name VTEC ァcriptョ
Author Oxedizer
Email oxedizer@gmail.com
Website www.dameet.co.uk
Description VTEC ァcriptョ For Resolutions of 1600x1200
Version 2.0
MTSVersion 1.1
VERSION 3.5
SCRIPT vtec LIGHT Themes.mrc

[snipped]
Posted By: HobophobE Re: !script - 22/02/06 08:53 AM
When the theme engine is going through the .mts file and sees this:
Code:
property !script alias

instead of the regular:
Code:
property filename/setting


(example:
Code:
ImageToolbar file.jpg
ImageToolbar !script blue.top

)

It will execute the alias instead of what it normally does with the filename/setting

So in this case, it normally gets file.jpg, and sends that to the /kte_setbg alias (from kte_applybg, from kte_doload) which actually does the /background command. Instead, the blue.top alias gets triggered, which would, in your case, manually do the /background command with the appropriate .jpg file. Or it should.

Is it working now?
Posted By: Skeletor Re: !script - 22/02/06 11:31 PM
I have put this in my .mts file...

Code:
 ImageToolbar !Script blue.top
ImageSwitchbar !Script blue.side 


Thats instead of the...
Code:
ImageToolbar &lt;image.jpg&gt;
ImageSwitchbar &lt;image.jpg&gt;  


I have also added this into my .mrc file

Code:
 alias get.res { return $+($window(-1).w,x,$window(-1).h)  }

alias blue.side.f {
  var %res = $get.res
  if (%res == 1600x1200) { return Vtec Sidebar.jpg }
  elseif (%res == 1280x1024) { return Vtec Sidebar12by10.jpg }
  else { return Vtec Sidebar10by7.jpg }
}

alias blue.top.f {
  var %res = $get.res
  if (%res == 1600x1200) { return Vtec Topbar.jpg }
  elseif (%res == 1280x1024) { return Vtec Topbar12by10.jpg }
  else { return Vtec Topbar10by7.jpg }
}

alias blue.top { background -l $blue.top.f }
alias blue.side { background -h $blue.side.f } 


It wont load any images, regardless of any resolution that I use.

What Else do I need to add to either the .mrc or .mts files to get it to load?
Posted By: HobophobE Re: !script - 23/02/06 01:15 AM
I believe the problem is simply with the lines that say 'return [Vtec file].jpg not returning the path to the files.

Since the files are in the same directory as the script, we can use $scriptdir. Below should be the right code.

Code:
alias blue.top { background -l $qt($+($scriptdir,$blue.top.f)) }
alias blue.side { background -h $qt($+($scriptdir,$blue.side.f)) } 


As far as I can tell everything was fine, except that we weren't specifying the path to the files, so mIRC didn't know where to find them.
Posted By: Skeletor Re: !script - 23/02/06 02:31 AM
Thankyou, it manages to load the Side bar perfectly, as for the topbar, it doesnt. I have looked at all the filenames and they seem okay, I have tried multiple paths as well with out any luck.
© mIRC Discussion Forums