• Visit Rebornbuddy
  • Would appreciate some information about various remote window members

    Discussion in 'Community Developer Forum' started by mistahmikey, Oct 26, 2015.

    1. mistahmikey

      mistahmikey New Member

      Joined:
      Jun 29, 2015
      Messages:
      161
      Likes Received:
      3
      Trophy Points:
      0
      RaptureATKUnitManager.GetWindowByName:

      Is there any easy way to determine what "name" string to use? If not, would it be possible for the devs to provide a function to enumerate them from the game?

      RaptureATKUnitManager.Update:

      Could you please explain what this function does and when it makes sense to use it? In particular, does it synchronize the caller with the current state of the underlying windowing system?

      RaptureATKUnitManager.Controls/GetRawControls:

      What is the difference between "Controls" and "RawControls"? When would I want to use one over the other?

      <RemoteWindow>.IsOpen versus <AtkAddonControl>.IsValid:

      What does IsValid true/false actually mean and under what circumstances does it's value change? Does IsOpen check IsValid, or should I be doing that before calling IsOpen?
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,232
      Likes Received:
      364
      Trophy Points:
      83
      1)
      Code:
      foreach (var foundwindow in RaptureAtkUnitManager.GetRawControls)
       {
      Log("{0}",foundwindow);
       }
      

      GetRawControls does not use caching and just retrieves the list of active windows, this should be used when operating in a thread outside the main bot thread.
      Update updates the caching list and is called via the pulsator, the rebornconsole is kinda naughty and just pulses everything via Pulsator.Pulse(PulseFlags.All); since its operating in a different thread. This is something that you should never do in an actual plugin.

      All the RemoteWindow classes are implemented a bit strangely, they all inherit atkaddoncontrol which also inherits remoteobject which provides the IsVaid (which checks to make sure the objects pointer is not zero). Most of the remote window functions are declared as static to make them easier to access and are implemented along these lines

      Code:
              public static bool IsOpen
              {
                  get
                  {
                      var window = RaptureAtkUnitManager.GetWindowByName("Request");
                      if (window != null)
                      {
                          return true;
                      }
                      return false;
                  }
              }
      
      You can assume if window isopen is true then it is also valid but not the other way around.
       
    3. mistahmikey

      mistahmikey New Member

      Joined:
      Jun 29, 2015
      Messages:
      161
      Likes Received:
      3
      Trophy Points:
      0
      Thanks very much for that explanation. Very helpful.
       

    Share This Page