CMlScriptIngame::Page::MainFrame

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

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

CMlScriptIngame::Page::MainFrame

Post by steeffeen » 01 Jul 2017, 13:32

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: 1525
    Joined: 27 Sep 2013, 18:02
    Location: France
    Contact:

    Re: CMlScriptIngame::Page::MainFrame

    Post by Nerpson » 01 Jul 2017, 22:55

    Hello steeffeen,

    Have you tried the property IsVisible from the CUILayer class?

    Nerp.
    ImageImageImageImage

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

    Re: CMlScriptIngame::Page::MainFrame

    Post by steeffeen » 01 Jul 2017, 23:41

    Nerpson wrote:
    01 Jul 2017, 22:55
    Have 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: 1525
      Joined: 27 Sep 2013, 18:02
      Location: France
      Contact:

      Re: CMlScriptIngame::Page::MainFrame

      Post by Nerpson » 02 Jul 2017, 10:25

      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: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: CMlScriptIngame::Page::MainFrame

      Post by steeffeen » 03 Jul 2017, 11:03

      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: 1100
        Joined: 19 Jun 2010, 00:04
        Location: Rémy - France
        Contact:

        Re: CMlScriptIngame::Page::MainFrame

        Post by spaii » 03 Jul 2017, 20:58

        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: 2472
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: CMlScriptIngame::Page::MainFrame

        Post by steeffeen » 03 Jul 2017, 22:36

        spaii wrote:
        03 Jul 2017, 20:58
        In 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:58
        What is your manialink version number?
        I'm using v3

        spaii wrote:
        03 Jul 2017, 20:58
        Edit: 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: 1100
          Joined: 19 Jun 2010, 00:04
          Location: Rémy - France
          Contact:

          Re: CMlScriptIngame::Page::MainFrame

          Post by spaii » 04 Jul 2017, 00:41

          steeffeen wrote:
          03 Jul 2017, 22:36
          ParentApp 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: 2472
          Joined: 14 Oct 2012, 16:22
          Location: Germany

          Re: CMlScriptIngame::Page::MainFrame

          Post by steeffeen » 04 Jul 2017, 08:00

          spaii wrote:
          04 Jul 2017, 00:41
          Another "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: 185
            Joined: 29 Apr 2014, 14:50
            Location: Paris, France

            Re: CMlScriptIngame::Page::MainFrame

            Post by noyranea » 12 Jul 2017, 08:39

            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 0 guests