Wish: Same possibilities in GUIMultiImage.cs that you have in GUIImageControl.cs (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Hi

    I have a process prlugin and I want to set the path of a multiimage through this. This can easily be done on labels, but how can I address a multiimage?

    Code:
    <control>
    	<description>background rotation</description>
    	<id>0</id>
    	<type>multiimage</type>
    	<posx>0</posx>
    	<posy>0</posy>
    	<width>1280</width>
    	<height>720</height>
    	<imagepath>#bgpath</imagepath>
    	<timeperimage>100</timeperimage>
    	<fadetime>700</fadetime>
    	<loop>yes</loop>
    	<randomize>False</randomize>
    </control>

    Using GUIPropertyManager.SetProperty("#bgpath", "TV"); doesn't seem to have any affect, although the multiimage works when I hardcode imagepath to "TV".

    Help?
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #2
    OK, I tried the following that doesn't work:

    GUIMultiImage mymulti = new GUIMultiImage(0, 597, 0, 0, 1280, 720, "TV", 1000, 700, true, true);

    GUIMultiImage.SetControlLabel(0, 598, "TV"); //I have a multiimage with ID 598

    I don't get it...is it at all possible to modify a multiimage??

    Who developed this? And why is it that I have to browse to half the sourcecode to find weird things like this, withou any note about actually accessing properties. Grr...
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #3
    Never got this working...this is why MP needs an API documentation.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #4
    Checked out the sourcecode and you cannot set the imagepath dynamically. What a bummer...

    My wish:

    Implement the same possibilities in GUIMultiImage.cs that you have in GUIImageControl.cs.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Checked out the sourcecode and you cannot set the imagepath dynamically. What a bummer...

    My wish:

    Implement the same possibilities in GUIMultiImage.cs that you have in GUIImageControl.cs.

    My wish, someone please provide a (nice looking) patch to add such functionality.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #6
    Checked out the sourcecode and you cannot set the imagepath dynamically. What a bummer...

    My wish:

    Implement the same possibilities in GUIMultiImage.cs that you have in GUIImageControl.cs.

    My wish, someone please provide a (nice looking) patch to add such functionality.

    I have been trying for the last 5 days to do so, but it's kinda hard when the API is undocumented and you have no idea where to start or end. Nowhere is it written what the difference between process and window plugins are.

    I have modified GUIMultiImage a lot but still can't create MultiImages from a process-plugin. So: my question is simple, can I do that?
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #7
    In a window-plugin I can do this to render a label:

    Code:
            public override void AllocResources()
            {
                base.AllocResources();
                mylabel = new GUILabelControl(5678, 999, 300, 400, 200, 100, string.Empty, "bubabab", 0xFFFFFFFF, GUIControl.Alignment.Left, false);
                mylabel.Label = "blaaa";
                mylabel.TextColor = 0xFFFFFFFF;
                mylabel.AllocResources();
            }
    
            public override void Render(float timePassed)
            {
                mylabel.Render(timePassed);
            }

    Is it possible in a process-plugin?

    Visual Studio doesn't know AllocResources when I refer to base, but I guess I'm missing something...
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #8
    ok...made some progress today, got it working in a window-plugin with GUIPropertyManager.SetProperty("#bgpath", "TV");

    Off to check if it works in process-plugins...the code needs a bit of cleanup but I'm happy :)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Off to check if it works in process-plugins...the code needs a bit of cleanup but I'm happy :)

    Actually process plugins shouldn't be used to interact with the GUI (thats why they are called process plugins and not something else :p).
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #10
    Off to check if it works in process-plugins...the code needs a bit of cleanup but I'm happy :)

    Actually process plugins shouldn't be used to interact with the GUI (thats why they are called process plugins and not something else :p).

    Yeah...but when you (my own example) want to be able to modify myHome on-the-fly without editing the core-files you can do what I did with the MediaStream plugin. It's been working since 1.0 RC2 (when I created it). No way was I gonna build a new Core.dll with every RC, SVN, Alpha etc ;)

    As far as I can tell the logic thing is that MultiImage can be used in similar way as a normal Image.

    If I clean up the code and check that I haven't made any obvious endless loops or stuff like that, would one of you consider adding a patch to SVN?
     

    Users who are viewing this thread

    Top Bottom