Xmovewindow translation

Xlobby plugin development

Postby P3rv3rt B3ar on Sat Dec 23, 2006 1:39 am

First of all thanks for this exellent plugin.

It might be that i dont fully know all the functionality, so if this suggestion is actually already implemented just ignore it.

But i have little problem when i actually edit the skin containing stuff loaded by Xmovewindow or Xvis, just because stuff is already loaded in front.

So i was wondering, that mayby u could change the behavior when user has entered skin edit?

I know this concept will work, cause i just implemented it in xPerT for editing mapcats, basicly i just have piece of code running on background which cheks if there is visible window named "Skin Edittor".

Again if there already is feature like this, then just nevermind.

EDIT: ok realised u have show/hide, but it wouldnt be bad idea to hide automaticly when skin editor is entered.

I also realised i have embarrasing bug in xPerT and in order to fix it, i need to know one of your trade secrets... Please tell me, how on earth u get the current screen? is there some variable for that, or are u using some workaround?
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby S Pittaway on Sat Dec 23, 2006 8:42 am

there is a screenname variable, its mentioned in the changleog.txt file in the xlobby folder :)


a nicer way is to use the delegate stuff and make use of the xlevent (i think thas its name?) it calls your code whenever a screen is entered or an overlay is shown....

its very usefull i use it in my skin to peform searches whenever i enter a music screen (you dont see any updating...)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby P3rv3rt B3ar on Sat Dec 23, 2006 8:56 am

S Pittaway wrote:there is a screenname variable, its mentioned in the changleog.txt file in the xlobby folder



Thanx pittaway.

hehe i was already wondering about doin it hardway... Mimicing XNet client with mimic feature turned on :)

u save me the trouble of sniffing...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby badubo on Sat Dec 23, 2006 9:06 pm

EDIT: ok realised u have show/hide, but it wouldnt be bad idea to hide automaticly when skin editor is entered.

This feature was already in the functionalities.
But it seems that, for some obscur reasons, the class name of the main xlobby window changed in one of the last xlobby2.exe, so, the plugin never detect the editor or setup :cry:

During hollidays, I will probably have to check the code of several plugins about this issue :wink:
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby P3rv3rt B3ar on Sun Dec 24, 2006 12:49 am

S Pittaway wrote:a nicer way is to use the delegate stuff and make use of the xlevent (i think thas its name?) it calls your code whenever a screen is entered or an overlay is shown....


Hmm im bit rusty with that whole delegate/event stuff... mayby if u could show relevant parts of your code that would help the bear get going...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby S Pittaway on Mon Dec 25, 2006 9:23 am

i had never used it before either, but a bit of playing gave this (more than enuff to get you going) -

Code: Select all

      /// <summary>
      /// Set the helper class
      /// </summary>
      public void SetHelper(XPluginHelper xhelper)
      {
        m_Helper = xhelper;
        m_Helper.XLEvent += new XLPluginEventHandler(OnXlEvent);
      }//SetHelper


    /// <summary>
    ///
    /// </summary>
    public void OnXlEvent(object sender, XPluginSDK.XLEventArgs Data)
    {
      if ( m_Helper == null )
        return;

      //WHAT HAPPENED?
      switch ( Data.eventEnum )
      {
        case XLEventEnum.newscreen:
        {
           do something
           break;
        }
        case XLEventEnum.overlayAdded:
        {
           do something
           break;
        }
        case XLEventEnum.overlayRemoved:
        {
           do something
           break;
        }
      }
    }//OnXlEvent(


S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby P3rv3rt B3ar on Tue Dec 26, 2006 2:03 am

Thanx a lot Pittaway!

That will definetely get me going...

Just wondering are u aware if there are other kind of events too beyond ones related to new screens and overlay?
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby S Pittaway on Tue Dec 26, 2006 9:53 am

they are the only ones that show up in devstudio....
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Previous