Is there possiblity how to get from custom menu to painter?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
adamkooo2
Posts: 1143
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Is there possiblity how to get from custom menu to painter?

Post by adamkooo2 » 05 Aug 2017, 18:31

Is there possiblity how to get from custom menu to painter? Or other things that we have access from menu. I think yes, Nadeo has done it in their MP4 titles. Can you give us the action name? In docs there are only few actions.

Isn't it something like

Code: Select all

editors_paint
?


Thanks :thx:
Arkady Smurf.wip
Image

User avatar
Qlex
Nadeo
Nadeo
Posts: 220
Joined: 03 Jun 2012, 13:17

Re: Is there possiblity how to get from custom menu to painter?

Post by Qlex » 07 Aug 2017, 10:09

Hi,

The documentation regarding class CTitleFlow generally gives you all these tools :

https://maniaplanet.github.io/maniascri ... _flow.html

In your example :

Code: Select all

TitleFlow.EditSkins();
Should work :)

Hope that helps!

User avatar
adamkooo2
Posts: 1143
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: Is there possiblity how to get from custom menu to painter?

Post by adamkooo2 » 07 Aug 2017, 17:47

Qlex wrote:
07 Aug 2017, 10:09
Hi,

The documentation regarding class CTitleFlow generally gives you all these tools :

https://maniaplanet.github.io/maniascri ... _flow.html

In your example :

Code: Select all

TitleFlow.EditSkins();
Should work :)

Hope that helps!
Thank you very much!!! :thx:
That was thing I needed a long time :thumbsup:
Arkady Smurf.wip
Image

User avatar
adamkooo2
Posts: 1143
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: Is there possiblity how to get from custom menu to painter?

Post by adamkooo2 » 12 Aug 2017, 18:29

Qlex wrote:
07 Aug 2017, 10:09
Hope that helps!
Just

Code: Select all

TitleFlow.EditSkins();
doesn't work, I had to declare CTitleFlow

I have created test menu manialink with default buttons and added my paint button
After some time of trying, I've got this:
Image


Can you tell me where I am wrong please?
I will try to get it working
Arkady Smurf.wip
Image

zocka
Posts: 196
Joined: 15 Jun 2010, 17:56

Re: Is there possiblity how to get from custom menu to painter?

Post by zocka » 12 Aug 2017, 19:30

I expect you to have the context CManiaAppTitle (https://maniaplanet.github.io/maniascri ... title.html) which should have to property TitleFlow so you would call
TitleFlow.EditSkins();
(In the screenshot you missed the () as well)
Maybe this helps
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka

User avatar
adamkooo2
Posts: 1143
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: Is there possiblity how to get from custom menu to painter?

Post by adamkooo2 » 12 Aug 2017, 19:36

zocka wrote:
12 Aug 2017, 19:30
I expect you to have the context CManiaAppTitle (https://maniaplanet.github.io/maniascri ... title.html) which should have to property TitleFlow so you would call
TitleFlow.EditSkins();
(In the screenshot you missed the () as well)
Maybe this helps
Thanks, I've tried it. In ML editor it shows no errors, but after click on my paint button in my menu it shows this:

Code: Select all

ERR [8, 15] Invalid access to parameter (Null object or elem not found in array) : >EditSkins
	media::Main() [8, 15]
EDIT: Same happens if I try other class members, I've tried:

Code: Select all

TitleFlow.PlayMap("A01", "", ""); 
Arkady Smurf.wip
Image

zocka
Posts: 196
Joined: 15 Jun 2010, 17:56

Re: Is there possiblity how to get from custom menu to painter?

Post by zocka » 12 Aug 2017, 21:00

[I haden't done anything with titlepacks before so this might not be the best way to do things]

I created a main-script, which I set as menu in the titlepack xml (/maniaplanet_title/menu/manialink) looking like this:

Code: Select all

#RequireContext CManiaAppTitle

#Const ScriptName "Menu.Script.txt"

Text MainView() {
	return """
	<manialink version="3">
		<label text="skins" scriptaction="openeditor'skins"/>
	</manialink>
	""";
}

main() {
	declare Layer = UILayerCreate();
	Layer.ManialinkPage = MainView();
	while(True) {
		yield;
		foreach (Event in PendingEvents) {
			if (Event.Type == CManiaAppEvent::EType::LayerCustomEvent) {
				if (Event.CustomEventType == "openeditor") {
					switch (Event.CustomEventData[0]) {
						case "skins": {
							TitleFlow.EditSkins();
						}
					}
				}
			}
		}
	}
}
This does what I understand is what you want to achieve. Again I don't know if there are better ways to handle such events rather than catching every little thing in the parent app.
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka

User avatar
adamkooo2
Posts: 1143
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: Is there possiblity how to get from custom menu to painter?

Post by adamkooo2 » 13 Aug 2017, 09:08

Thank you, it works! :thx:
Now, I will try some experiments with the code :mrgreen:
Arkady Smurf.wip
Image

Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest