CMlScriptIngame::Page::MainFrame

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

CMlScriptIngame::Page::MainFrame

Post by steeffeen »

Hi,

I tried developing some functionality to toggle the complete server controller UI based on events.
However, I couldn't manage to get the toggling working out of the box without having to add a dedicated Frame control.

I thought I could use Page.MainFrame.Visible but it seems like this property is ignored completely as the manialink elements stay visible. If I set it to False it will be True again on the next tick. Tested in TM & SM.

So I wonder if Page & MainFrame are even supposed to work in an ingame manialink (especially when sent by a server controller).
The properties are always filled (!= Null) but the frame doesn't have a ControlId. Is it possible to supply this MainFrame somehow? E.g. by using a specific control id for a frame in an own manialink?

It would be great if there would be an easy possibility to completely hide a manialink out of the box but I couldn't find one other than using an own frame element or something similar.
Does anyone have a solution for this?

Many thanks in advance!

Best regards,
steeffeen
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    Nerpson
    Translator
    Translator
    Posts: 1554
    Joined: 27 Sep 2013, 18:02
    Location: France
    Contact:

    Re: CMlScriptIngame::Page::MainFrame

    Post by Nerpson »

    Hello steeffeen,

    Have you tried the property IsVisible from the CUILayer class?

    Nerp.
    ImageImageImageImage
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: CMlScriptIngame::Page::MainFrame

    Post by steeffeen »

    Nerpson wrote: 01 Jul 2017, 22:55Have you tried the property IsVisible from the CUILayer class?
    I don't think a CMlScriptIngame can access any CUILayer. If it does, please show me how. :)
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      Nerpson
      Translator
      Translator
      Posts: 1554
      Joined: 27 Sep 2013, 18:02
      Location: France
      Contact:

      Re: CMlScriptIngame::Page::MainFrame

      Post by Nerpson »

      If it's a CMlScriptIngame, you have UI and ClientUI attributes which are CUIConfig objects. You can access layers trough them. (CUIConfig.UILayers)
      ImageImageImageImage
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: CMlScriptIngame::Page::MainFrame

      Post by steeffeen »

      That's right but the Layers are empty and there's no way to create one for manialinks sent by server controllers. Again, please prove me wrong. :)
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        User avatar
        spaii
        Posts: 1075
        Joined: 19 Jun 2010, 00:04
        Location: Rémy - France
        Contact:

        Re: CMlScriptIngame::Page::MainFrame

        Post by spaii »

        In case of, have you tested with Page.MainFrame.Show() and Page.MainFrame.Hide() ?
        What is your manialink version number ?

        Edit:
        concerning UILayers, you could try ParentApp.UILayers, ParentApp.UI etc...
        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2463
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: CMlScriptIngame::Page::MainFrame

        Post by steeffeen »

        spaii wrote: 03 Jul 2017, 20:58In case of, have you tested with Page.MainFrame.Show() and Page.MainFrame.Hide() ?
        Tried that, it does the same as setting .Visible = False -> The variable becomes False but returns to True on the next tick without actually hiding the manialink elements.

        spaii wrote: 03 Jul 2017, 20:58What is your manialink version number?
        I'm using v3

        spaii wrote: 03 Jul 2017, 20:58Edit: concerning UILayers, you could try ParentApp.UILayers, ParentApp.UI etc...
        ParentApp is Null :(


        also tried Page.MainFrame.ClipWindowXY, sizes and positions => everything is being ignored
        however, it's interesting that the MainFrame actually contains the elements of your manialink as its .Controls - so there is at least some use to it :D
        unfortunately i can't just loop through the controls and toggle them (even though this would actually hide them) because this would interfere with other logic that toggles certain controls like menus, tooltips, paging, etc.
        therefore the only solution I see currently is do add a wrapping frame around everything - though i don't want to do that, for one because of complexity and also because all the containing controls would share the z-index of the wrapper frame which causes other issues

        keep the ideas coming! :thx:
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks
          User avatar
          spaii
          Posts: 1075
          Joined: 19 Jun 2010, 00:04
          Location: Rémy - France
          Contact:

          Re: CMlScriptIngame::Page::MainFrame

          Post by spaii »

          steeffeen wrote: 03 Jul 2017, 22:36ParentApp is Null :(
          Oups, effectively, it's only for solo.

          Another "in case of", why not This.Page.MainFrame.Visible = False; ? :D
          User avatar
          steeffeen
          Translator
          Translator
          Posts: 2463
          Joined: 14 Oct 2012, 16:22
          Location: Germany

          Re: CMlScriptIngame::Page::MainFrame

          Post by steeffeen »

          spaii wrote: 04 Jul 2017, 00:41Another "in case of", why not This.Page.MainFrame.Visible = False; ? :D
          not helpful! :D
            Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

            ManiaControl, FancyManiaLinks
            User avatar
            noyranea
            Nadeo
            Nadeo
            Posts: 187
            Joined: 29 Apr 2014, 14:50
            Location: Paris, France

            Re: CMlScriptIngame::Page::MainFrame

            Post by noyranea »

            Hi there !

            The Page.MainFrame attribute is read-only, as many of it's parameters (including visibility) are computed by the game, depending on various parameters.

            Creating a dedicated root frame control looks like a good way to achieve your goal. What makes you want to find an other way ?

            Have a nice day,

            -- noyranea
            Post Reply

            Return to “ManiaScript”

            Who is online

            Users browsing this forum: No registered users and 2 guests