Support #10642

Help with spectator buttons

Added by columdrum almost 5 years ago. Updated almost 5 years ago.

Status:Closed Start date:05/13/2010
Priority:Normal Due date:
Assignee:Xeno % Done:

100%

Category:Script
Target version:1.2
Component:ace_sys_spectator Affected Version:
Close Reason:

Description

Hi, i'm trying to use the new spectator buttons. I have looked at the code and it looks like that it's not posible to configure the text of the 4 butons. I have used:

ace_sys_spectator_RevButtons = ["Base 1", "movile respawn", "movile respawn 2", "X"];

And ,as spected, the names of the buttons are still "respawn 1", "respawn 2",....

The second try was to change the buttons via ctrlSetText. I have tried both:

ctrlSetText [50018, "Base 1"];

And:
_disp = (findDisplay 55001);
_button1 = _disp displayctrl 50018;
_button1 ctrlSetText "Base 1";

But the text don't change :(.

I had no problems to change the buttons action via:

 buttonSetAction [50018, "call myfunction;"];

So the question is: there is a temporal way to change the text of the buttons? or i must wait for newer versions ?
Any help would be appreciated thanks.

BUttonTest.utes.rar - Mision (3.6 kB) columdrum, 05/18/2010 18:59

buttons.JPG - Screen of the buttons (135.3 kB) columdrum, 05/18/2010 18:59

Associated revisions

Revision d6ce3e35
Added by Xeno almost 5 years ago

~FIXED: ctrlSetText was missing for the revive buttons in spectator, refs #10642

History

Updated by rocko almost 5 years ago

  • Category set to Documentation
  • Assignee set to ViperMaul
  • Target version set to Planned (Needs Contributors)

Updated by ViperMaul almost 5 years ago

Attach the mission you have. And we will see what's going on.

Updated by columdrum almost 5 years ago

Thanks, i have uploaded it right now. Some variable names and mensages are in spanish, i have removed everything that was not related to the "revive" part of it.

I am trying to change the text of the buttons that has the spectator mode(image attached) using just that i said on my first post.

Updated by ViperMaul almost 5 years ago

Well it appears the we may need to add some code to fix this.
So far it looks like a bug in our spectator. I will look to fix.

Updated by ViperMaul almost 5 years ago

  • Status changed from New to Assigned

Updated by Dr_Eyeball almost 5 years ago

What button type is it? (Edit: I just saw image, they are shortcut buttons.)
Most buttons are now becoming CT_SHORTCUT_BUTTON type, which use type structured text, not string.
So instead of ctrlSetText, you would need ctrlSetStructuredText parseText.

Updated by Xeno almost 5 years ago

  • % Done changed from 0 to 50

ctrlSetText was missing.

You don't need buttonSetAction.

Just create the following functions (also changable during a mission).

ace_sys_spectator_fnc_rbutton1 = {
    // add code here that executes when button 1 gets pressed
};

ace_sys_spectator_fnc_rbutton2 = {
    // add code here that executes when button 2 gets pressed
};

ace_sys_spectator_fnc_rbutton3 = {
    // add code here that executes when button 3 gets pressed
};

ace_sys_spectator_fnc_rbutton4 = {
    // add code here that executes when button 4 gets pressed
};

Updated by Xeno almost 5 years ago

  • Category changed from Documentation to Script
  • Status changed from Assigned to Closed
  • Assignee changed from ViperMaul to Xeno
  • Target version changed from Planned (Needs Contributors) to 1.2
  • % Done changed from 50 to 100
  • Component set to ace_sys_spectator

Updated by columdrum almost 5 years ago

Thanks Dr_Eyeball, using ctrlSetStructuredText worked :).

By the way Xeno you have used:

(_disp displayCtrl _cRButton3) ctrlSetText (GVAR(RevButtons) select 2)

In the fix: http://dev-heaven.net/projects/ace-mod2/repository/revisions/d6ce3e356fb5fd3aee2975b8e3d108eab5efe874

You should use:

(_disp displayCtrl _cRButton3) ctrlSetStructuredText parseText (GVAR(RevButtons) select 2)

Updated by Xeno almost 5 years ago

Na, ctrlSetText works fine for those buttons.

It was simply completely missing (accidentally removed before commit).

Also available in: Atom PDF