Shoutbox

[Request]Help B4 I Go INSANE - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Request]Help B4 I Go INSANE (/showthread.php?tid=78555)

[Request]Help B4 I Go INSANE by waynewilson2 on 10-31-2007 at 06:11 AM

:S I looked around the forums(with the search, of course) and found nothing for this...

i was wondering, is it possible to change the color of the windows created using MsgPlus.CreateWnd, if so, HOW??:S:S:S This has been hastling me for almost a week now, and its kinda gettin annoyin...lol, i have tried diff ways pf doing it, but just can't seem to

the way i have been trying to do it, is through the XML file, if its possible to do it in there, then its much more ideal, although i will still appreciate it alot if you can give me a way to do it through a script... Thanks in advance

--------Wayne Wilson


RE: [Request]Help B4 I Go INSANE by NanaFreak on 10-31-2007 at 06:39 AM

you dont want to do it with the script... it would be better if you do it with the xml... though you could do some xml work with the script to edit it before load...

anyway here is the code to do it:

code:
<Window Id="WindowName" Version="1">
[...]
<WindowTmpl>
<BackGroundColor>
<Red>255</Red>
<Green>0</Green>
<Blue>0</Blue>
<Alpha>255</Alpha>
</BackGroundColor>
</WindowTmpl>
[...]
</Window>

that should make the window red...

also you can make a Figure Element span the whole window and make that a color...

code:
<Element xsi:type="FigureElement" Id="RectMiddleColor">
<Position Top="-1" Left="-1" Width="202" Height="202"/>
<Figure><RoundRect><Radius>0</Radius></RoundRect></Figure>
<Fill>
<PlainColor>
<Red>255</Red>
<Green>0</Green>
<Blue>0</Blue>
<Alpha>255</Alpha>
</PlainColor>
</Fill>
</Element>

that will make the window red for a 200x200 window :)


I hope this is what you wanted...

please tell me if you need the code to edit the xml before loading the window... and i will try my best for you :)
RE: [Request]Help B4 I Go INSANE by waynewilson2 on 10-31-2007 at 08:23 PM

ok, ty, but the first method did not seem to work, and i have not tried the second one, also, i'm using a DialogTmpl, not WindowTmpl...lol

EDIT::
:::::::::::::::::::::::::::::::::::::::::
and unfortunately i dont understand the second method :S


RE: [Request]Help B4 I Go INSANE by NanaFreak on 10-31-2007 at 08:37 PM

ok... with the first one you can only use windowtmpl not dialogtmpl

and with the second one... you put it in the <Elements> tag and then you make the width and heights 2 more than the window (so that it makes sure all of it is done...


RE: [Request]Help B4 I Go INSANE by waynewilson2 on 10-31-2007 at 08:53 PM

ok, TYVM

EDIT::
::::::::::::::::::::
I Just Made A New Window, To Test The First One, And It Is Not Working...


RE: [Request]Help B4 I Go INSANE by RaceProUK on 10-31-2007 at 09:40 PM

quote:
Originally posted by NanaFreak
you dont want to do it with the script
It should be possible though, with MSXML. Mind you, it's been a while since I've looked at scripting Plus!, so I don't recall exactly how window XML is loaded.
RE: [Request]Help B4 I Go INSANE by waynewilson2 on 11-01-2007 at 12:31 AM

and another thing i was wonderin about, how would i put my own images into a window?


RE: [Request]Help B4 I Go INSANE by markee on 11-01-2007 at 12:44 AM

quote:
Originally posted by waynewilson2
and another thing i was wonderin about, how would i put my own images into a window?
I'm not exactly too sure about what you wanted to do, just have an image that you can pre-define (like as in hard code into the XML) or change an image with a script.  have a look at Download file for the latter.  There is also the XML code for an Image element in one post as well which goes in the elements area, you can define the path to the image in there.  I won't give you the actual XML code because I get NanaFreak to do that stuff for me but if you need it I'm sure someone else can give it to you, I just don't want you complaining when I give you bad code :P
RE: [Request]Help B4 I Go INSANE by waynewilson2 on 11-01-2007 at 02:33 AM

using the xml file to load it into a window when the window starts, i got the pictures, but i don't know how to incorperate them into the window...Thanks In Advance

Edit::
:::::::::::::::::::
and sorry about the last time i got pissed at ya markee...i was in a bad mood that day, and u just happened to be the one i ended up taking it out on....


RE: [Request]Help B4 I Go INSANE by waynewilson2 on 11-01-2007 at 05:23 AM

ok, i got that done now, so now i got it all :D but...anyone know how to do a damn timer? i have been trying to figure it out for almost 3 hours now...lmao, not a smart move on my end, but...what can ya do, right?
--------Wayne Wilson


RE: [Request]Help B4 I Go INSANE by NanaFreak on 11-01-2007 at 05:50 AM

a timer like MsgPlus.AddTimer([string] TimerId, [number] Elapse) ?


RE: [Request]Help B4 I Go INSANE by Matti on 11-01-2007 at 08:35 AM

For a timer, you need to first create one:

code:
MsgPlus.AddTimer(/* TIMERID */ "MyTimer", /* ELAPSE (in ms) */ 100);
and have an event for it:
code:
function OnEvent_Timer(TimerId) {
   switch(TimerId) {
      case "MyTimer":
         /* Do stuff here */
         MsgPlus.AddTimer("MyTimer", 100); //Optionally, you can create a loop by re-adding the timer
         break;
   }
}

Of course, you can have multiple timers, like "MyTimer" and "MyOtherTimer". To make those work, call MsgPlus.AddTimer whenever you want for one of them and add a "case"-statement to the "switch"-block in the OnEvent_Timer function. ;)
RE: [Request]Help B4 I Go INSANE by waynewilson2 on 11-01-2007 at 07:36 PM

lol, ok, tyvm :D