Mistar Runar

Evita
02-13-2003, 11:26 AM
Is this possible?

Upon opening commander gui (commandGui::onOpen), automatically turn the default tv (default FearGui::CmdObserve) to the current flag carrier?

I got an idea....

Rosco-SS
02-13-2003, 11:42 AM
I am a banana

EliteTrackStar
02-13-2003, 11:47 AM
Rosco-SS is a fruit

Runar
02-13-2003, 11:51 AM
Here's the hook, might wanna set the TVButton to true also:

function CommandGui::onOpen()
{
//initialize the commander buttons

if ($pref::mapFilter & 0x0001) Control::setValue(IDCTG_C MDO_PLAYERS, "TRUE");
else Control::setValue(IDCTG_C MDO_PLAYERS, "FALSE");

if ($pref::mapFilter & 0x0002) Control::setValue(IDCTG_C MDO_TURRETS, "TRUE");
else Control::setValue(IDCTG_C MDO_TURRETS, "FALSE");

if ($pref::mapFilter & 0x0004) Control::setValue(IDCTG_C MDO_ITEMS, "TRUE");
else Control::setValue(IDCTG_C MDO_ITEMS, "FALSE");

if ($pref::mapFilter & 0x0008) Control::setValue(IDCTG_C MDO_OBJECTS, "TRUE");
else Control::setValue(IDCTG_C MDO_OBJECTS, "FALSE");

if (String::ICompare($pref:: mapSensorRange, "TRUE") == 0) Control::setValue(IDCTG_C MDO_RADAR, "TRUE");
else Control::setValue(IDCTG_C MDO_RADAR, "FALSE");

if (String::ICompare($pref:: mapNames, "TRUE") == 0) Control::setValue(IDCTG_C MDO_EXTRA, "TRUE");
else Control::setValue(IDCTG_C MDO_EXTRA, "FALSE");

Control::setValue("TVButton", false);

Event::Trigger(eventGuiOp en, CommandGui);
}

function CommandGui::onClose()
{
Event::Trigger(eventGuiCl ose, CommandGui);
}


Here's what I do in TV.cs to activate it:

// Enable observer mode
Client::ToggleCmdObserver ("True");

// Observe flag-carrier/client
Client::cmdObservePlayer( %clientId);



Hope this is what you need..

Evita
02-13-2003, 01:04 PM
Ya, thats what I tried last night. It works fine if you select the player out of the list, then close the command gui, then re-open. I need it to automatically set the player in the list based off a passed variable.

This is the code I was testing with:

function CommandGui::onOpen()
{
//initialize the commander buttons

if ($pref::mapFilter & 0x0001) Control::setValue(IDCTG_C MDO_PLAYERS, "TRUE");
else Control::setValue(IDCTG_C MDO_PLAYERS, "FALSE");

if ($pref::mapFilter & 0x0002) Control::setValue(IDCTG_C MDO_TURRETS, "TRUE");
else Control::setValue(IDCTG_C MDO_TURRETS, "FALSE");

if ($pref::mapFilter & 0x0004) Control::setValue(IDCTG_C MDO_ITEMS, "TRUE");
else Control::setValue(IDCTG_C MDO_ITEMS, "FALSE");

if ($pref::mapFilter & 0x0008) Control::setValue(IDCTG_C MDO_OBJECTS, "TRUE");
else Control::setValue(IDCTG_C MDO_OBJECTS, "FALSE");

if (String::ICompare($pref:: mapSensorRange, "TRUE") == 0) Control::setValue(IDCTG_C MDO_RADAR, "TRUE");
else Control::setValue(IDCTG_C MDO_RADAR, "FALSE");

if (String::ICompare($pref:: mapNames, "TRUE") == 0) Control::setValue(IDCTG_C MDO_EXTRA, "TRUE");
else Control::setValue(IDCTG_C MDO_EXTRA, "FALSE");

Control::setValue("TVButton", true);

Client::ToggleCmdObserver ("True");

$dood = getClientByName("Evita");
Client::cmdObservePlayer( $dood); //THIS NO WORKIE, HAS NO EFFECT

}



I have to be overlooking something simple.

Evita
02-14-2003, 09:15 PM
bump

cmon runar

:D

Runar
02-15-2003, 08:30 AM
Oh.. I didn't realise you were waiting for me :)

I'd try a delay on Client::cmdObservePlayer( $dood);

Evita
02-15-2003, 04:34 PM
Im out of town at the moment.

I get back in tomorrow nite.

Im not sure the delay would work though. I tried running the commands straight in the console with no luck.

Do you happen to have a list of all the Client::* functions? They are not in the functions list I have.