Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#301 Saffith

Saffith

    IPv7 user

  • Members

Posted 15 October 2016 - 08:38 PM

Tango_SaveMenuState() and Tango_RestoreMenuState(). Set up all the menus and save their states, then restore the one you want to activate first. When you want to switch, save the active menu's state again and restore another one.

If they're text menus, you'll also need to save and restore the slot states with Tango_SaveSlotState() and Tango_RestoreSlotState().
  • ywkls likes this

#302 ywkls

ywkls

    Master

  • Members

Posted 16 October 2016 - 12:16 AM

Tango_SaveMenuState() and Tango_RestoreMenuState(). Set up all the menus and save their states, then restore the one you want to activate first. When you want to switch, save the active menu's state again and restore another one.

If they're text menus, you'll also need to save and restore the slot states with Tango_SaveSlotState() and Tango_RestoreSlotState().

 

Would I need to save those as separate functions for each menu or one large function?

 

Also, I presume I'd need different arrays for each menu to save the slotstate and menustate.

 

Otherwise, it sounds like it would work reasonably easily.



#303 Saffith

Saffith

    IPv7 user

  • Members

Posted 16 October 2016 - 10:22 AM

Would I need to save those as separate functions for each menu or one large function?

I'd probably use separate functions just on general principle, but it shouldn't really matter.

Also, I presume I'd need different arrays for each menu to save the slotstate and menustate.

Yep, one array each.

#304 ywkls

ywkls

    Master

  • Members

Posted 16 October 2016 - 04:57 PM

I'd probably use separate functions just on general principle, but it shouldn't really matter.

Yep, one array each.

 

I'm a bit unsure about how to do this, since it would seem to me that you've have to be able to detect the separate arrays whenever you switched between menus. In other words, menu A can detect it's slotstate array fine; but it'd have to be able to know the value of menu B's slotstate array in order to restore it.

 

It seems like a large function, which has separate arrays for every submenu; would be the easier way to accomplish this.

 

Another thing I forgot to ask, but do separate Window Slots that are active at the same time have to use separate window styles? I've had some issues in the past where that whenever I opened a new slot but didn't have it as a different style; the new slot didn't look right.



#305 ywkls

ywkls

    Master

  • Members

Posted 16 October 2016 - 07:30 PM

Alright, I threw together the basics of my potential subscreen code as one function rather than several (since I'm not entirely sure how to do the latter yet) and I've already run into problems. For one, if any of the subsidiary menus open; I can't get them to close properly.

 

I'm not sure where I've gone wrong with this. Here's the code so maybe a fresh set of eyes can point me in the right direction.

 

Experimental Tango Subscreen

 

The multiple menus are showing up, but I'm not switching between them. I may need to use another button than left or right, since those are used by the menus themselves. They're also not exiting whenever I press Ex4.


Edited by ywkls, 16 October 2016 - 07:30 PM.


#306 Saffith

Saffith

    IPv7 user

  • Members

Posted 16 October 2016 - 09:52 PM

Hmm, there's a detail I overlooked. You want the menu to be active when you save its state, but a text menu won't be active until the frame after you activate it. It'll have to be like

Activate slot 1
Waitframe
Save slot 1 state
Activate slot 2
Waitframe
Save slot 2 state

And so on. Hopefully, that's all it needs.
 

Another thing I forgot to ask, but do separate Window Slots that are active at the same time have to use separate window styles?

No, it shouldn't be a problem for them to share styles.

#307 Gégé

Gégé

    Senior

  • Members
  • Real Name:Gérard
  • Location:France

Posted 18 October 2016 - 12:08 PM

Hello :)
 
void Tango_DrawInteger(int num, int font, int cset, int color, int x, int y, int layer)
{
    int numStr[13];
    itoa(numStr, 0, num);
    Tango_DrawString(numStr, font, cset, color, x, y, layer);
}
I try to use TF_CENTERED and TF_RIGHT but I fails :shiver: .
How can do Please ?

#308 ywkls

ywkls

    Master

  • Members

Posted 18 October 2016 - 01:56 PM

Hmm, there's a detail I overlooked. You want the menu to be active when you save its state, but a text menu won't be active until the frame after you activate it. It'll have to be like

Activate slot 1
Waitframe
Save slot 1 state
Activate slot 2
Waitframe
Save slot 2 state

And so on. Hopefully, that's all it needs.

 

At the moment, I'm moving to a mouse-based subscreen interface because I can't figure the intricacies of tango menus out. But at least I know there is a way, if I ever try again.

 

 

 

No, it shouldn't be a problem for them to share styles.

 

So, is there a reason why there are only three styles normally set by tango?



#309 Saffith

Saffith

    IPv7 user

  • Members

Posted 19 October 2016 - 10:45 AM

I try to use TF_CENTERED and TF_RIGHT but I fails :shiver: .
How can do Please ?

Hm, it's been a while. I think this should work:
void Tango_DrawInteger(int num, int font, int cset, int color, int x, int y, int format, int layer)
{
    int numStr[13];
    itoa(numStr, 0, num);
    Tango_DrawString(numStr, font, cset, color, x, y, format, layer);
}
The TF_ argument is the next-to-last one.

So, is there a reason why there are only three styles normally set by tango?

It's set to allow only a few by default because most people don't need many, and there's no point wasting a lot of space on data that won't be used.

#310 Gégé

Gégé

    Senior

  • Members
  • Real Name:Gérard
  • Location:France

Posted 19 October 2016 - 01:03 PM

Thank you very much  :love:  :)


#311 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 30 October 2016 - 07:11 PM

@Saffith

is there a way to make Tango overwrite normal string messages?

for example if I had a script that uses default zc messages is there a way I override the default messages so that when they come onto screen they are closed before they draw and then trigger a Tango string with the same massage?



#312 Saffith

Saffith

    IPv7 user

  • Members

Posted 30 October 2016 - 07:33 PM

No. There's no way to detect when a message is displayed by the built-in system, so you can't have it trigger anything.

#313 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 30 October 2016 - 08:08 PM

hmm ok then so when your instuctions say..

1: Find a free text slot (Tango_GetFreeSlot())
2: Clear any data already in the slot (Tango_ClearSlot())
3: Load text into the slot (Tango_LoadString() or Tango_LoadMessage())
4: Set a style (Tango_SetSlotStyle())
5: Set the position (Tango_SetSlotPosition())
6: Activate the text slot (Tango_ActivateSlot())
 
does that mean in order with no code blocks or functions between it?


#314 Saffith

Saffith

    IPv7 user

  • Members

Posted 30 October 2016 - 09:33 PM

You can do things in between, but I don't see any reason to.

#315 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 30 October 2016 - 09:56 PM

ok thankyou

 

Edit: @Saffith

why does my string disappear immediately when it is longer then the text box?

it doesn't even show the message

 

I am using the GB chest script from the data base however I edited it a bit for Tango.zh

Spoiler

 

Edit: I realized I didn't have Tango_SetSlotPosition() however I added it it still doesn't display the string


Edited by Shadowblitz16, 31 October 2016 - 12:38 AM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users