Problem description:
Title says it all mostly, but is it possible to create a window / windowskin component on the fly? Without putting them in the windowskin (where someone could potentially be altered.)
IE:
1) A temporary window with a progress bar and a label, the progress bar accessible by using winset() proc so it can be updated as a separate procedure progresses, and then closed when the progress has been completed.
2) A temporary window with a browser inside it that opens up with specific information, closable when the player reads the information and not accessible again.
![]() Nov 19 2013, 5:57 am
Best response
|
|
Have you checked the Skin Reference? It has a section on creating interface elements in code.
|
I voted Kaiacho, if you go into the Skin References it's all there (dream maker->help->skin references). Or you could set client/control_freak to disable skin alterations.
|
This works for controls it says, but is it possible to create a completely new window using this?
mob/verb/Test2() Tried this, but it doesn't seem to do anything |
If you want to create a window just make a blank window in your interface file and use winclone() to clone that into a new window and build your controls from there.
|
I must admit, you had me curious because I had never tried to do this. So I ran some tests and did some reading. It turns out winclone() can be used to create a "blank" window with no reference to it.
winclone(src,"window","newwindow") If you copy and paste that into your game, it should create a new window for you. *Edit* To clarify, I ran that script to create a new blank window, and I did "not" have a parent window named "window" already. All I had was one named "default". Like I said, it was interesting XD. |
I totally forgot about winclone() doing that, good catch. Keep in mind that it only works with "window", "pane", "menu", and "macro", not other values, otherwise you'll get an 'element not found' error. Tis in the reference.
|
Thanks, the winclone proc worked, and the skin reference section helped create controls on said window.
End Result: mob/verb/Test2() Creates a window and a button for 5 seconds then closes it. Don't know if it properly 'disposes' of it though, would this be correct? |
I'm not sure if it matters, but the dm reference example for closing is to set parent to none.
winset(usr, "newwindow", "parent=none") |