• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Shell options

Started by Red Spot, May 14, 2009, 01:00:55 PM

Previous topic - Next topic

Red Spot

Have set up an option in the shell to switch teamcolors, beter said, give the host the option to tweak the teamcolors from within the shell.


This works nicelly, however now you need to press the "Custom" button before the values at the bottom are read by the dll.
I can also set it up so the buttons do no longer highlight the selected color but update the RGB values at the bottom, so I can just let the dll read the RGB values.

However I would really like it to do both, so say when you select the "light blue" color button it stays highlighted but also updates the below values to 0.0.255 (or whatever values are set).

The difference between the 2 settings is caused by the "Radio" flag in the shell file, is there some way to cause them both to work?


eg:
this highlights the button, but ignores the 'button pressed event'
CreateControl("NoColorsA", "BUTTON")
{
ColorGroup("BLACKBLUE");
Geometry("LEFT", "TOP");
Pos(50, 20); //
Size(60, 9); //
BorderSize(3);
BevelSize(3);
Style("ROLLOVER", "RADIO", "OUTLINE");
Cursor("Highlight");
Font("TINY");
Text("No Color");
UseVar("network.session.ivar35");
Value(0);
NotifyParent("Button::Press", "bNoColorsA");
}

OnEvent("bNoColorsA")
{
Cmd("network.session.ivar37 0");
Cmd("network.session.ivar38 0");
Cmd("network.session.ivar39 0");
}


This uses the 'button pressed event' but always highlights the button
CreateControl("NoColorsA", "BUTTON")
{
ColorGroup("BLACKBLUE");
Geometry("LEFT", "TOP");
Pos(50, 20); //
Size(60, 9); //
BorderSize(3);
BevelSize(3);
Style("ROLLOVER", "OUTLINE"); // ("ROLLOVER", "RADIO", "OUTLINE");
Cursor("Highlight");
Font("TINY");
Text("No Color");
UseVar("network.session.ivar35");
Value(0);
NotifyParent("Button::Press", "bNoColorsA");
}

OnEvent("bNoColorsA")
{
Cmd("network.session.ivar37 0");
Cmd("network.session.ivar38 0");
Cmd("network.session.ivar39 0");
}


Thanks :)
*Something intelligent, yet funny*

mrtwosheds

Well done. hmm shouldn't there be 2 lots of numeric entry box's, one for each team?

Red Spot

There will be, I was testing how it all worked.
*Something intelligent, yet funny*

AHadley

Does this work with all maps, or just yours?

Red Spot

Quote from: AHadley on May 14, 2009, 01:28:11 PM
Does this work with all maps, or just yours?

It is set by the dll, so it is map-specific. But in the maps inf file you can set which teamcolor should be used when selecting the map, even custom colors can be specified, or both.

ivar35 = 0..16 // Team A pre-set color.
ivar36 = 0..16 // Team B pre-set color.

ivar37 = 0..255 // Team A custom color "Red" value.
ivar38 = 0..255 // Team A custom color "Green" value.
ivar39 = 0..255 // Team A custom color "Blue" value.

ivar40 = 0..255 // Team B custom color "Red" value.
ivar41 = 0..255 // Team B custom color "Green" value.
ivar42 = 0..255 // Team B custom color "Blue" value.
*Something intelligent, yet funny*

General BlackDragon

Hi. You're local shell expert here.  :-D

To switch between radio buttons and normal press buttons, you must change 2 things:

1: If radio is in the style, you have to change the notify parent to this: NotifyParent("Button::Select", "NAMEHERE");

When removing Radio, or not using Radio in the style, you must change it back to Button::Press

Your welcome :)



*****General BlackDragon*****

Red Spot

Quote from: General BlackDragon on May 14, 2009, 03:15:40 PM
Hi. You're local shell expert here.  :-D

To switch between radio buttons and normal press buttons, you must change 2 things:

1: If radio is in the style, you have to change the notify parent to this: NotifyParent("Button::Select", "NAMEHERE");

When removing Radio, or not using Radio in the style, you must change it back to Button::Press

Your welcome :)

Many thanks :)
Works like a charm
CreateControl("NoColorsA", "BUTTON")
{
ColorGroup("BLACKBLUE");
Geometry("LEFT", "TOP");
Pos(50, 20); //
Size(60, 9); //
BorderSize(3);
BevelSize(3);
Style("ROLLOVER", "RADIO", "OUTLINE");
Cursor("Highlight");
Font("TINY");
Text("No Color");
UseVar("network.session.ivar35");
Value(0);
NotifyParent("Button::Select", "bNoColorsA");
}

OnEvent("bNoColorsA")
{
Cmd("network.session.ivar37 0");
Cmd("network.session.ivar38 0");
Cmd("network.session.ivar39 0");
}
*Something intelligent, yet funny*

Red Spot

Do you by any chance also know if I can make the "Custom" button the selected button if you edit one of the numeric boxes at the bottom ?

This doesnt work, nor does the 'button pressed' event:
CreateControl("ColorA1", "EDIT")
{
ColorGroup("BLACKBLUE");
Geometry("LEFT", "TOP");
Position(40, 220);
Size(22, 9);
BorderSize(3);
BevelSize(3);
JustifyText("center");
Font("TINY");
Style("ROLLOVER", "OUTLINE");
Cursor("Highlight");
UseVar("network.session.ivar37");
SetIntegerRange("network.session.ivar37", 0, 255);
NotifyParent("Button::Select", "bCustomA");
}

OnEvent("bCustomA")
{
Cmd("network.session.ivar35 16");
}
*Something intelligent, yet funny*

General BlackDragon

um...not really, maybe. you might could just leave a note for the user in the bottom saying they have to press it if using the fields above.



*****General BlackDragon*****

Red Spot

#9
Quote from: General BlackDragon on May 14, 2009, 04:00:11 PM
um...not really, maybe. you might could just leave a note for the user in the bottom saying they have to press it if using the fields above.

Its not really a big problem, the color-buttons now update the RGB-values at the bottom. So I now can have the dll check if the pre-set color ivars are on 0 or 1 (no teamcolors, or use localprefs), the rest can than be done by letting the dll use the other ivars. But it would have been nice if the button jumps to "Custom" if you do edit a color .. just shows a bit clearer which color you are actually using.

edit: This works if you press enter after typing a value, but as when you tab out of the box or select the next box and it wont trigger its not really that usefull ..
"Edit::Enter"
*Something intelligent, yet funny*

TheJamsh

This is going to be a problem for people with modified localprefs teamcolors.


BZII Expansion Pack Development Leader. Coming Soon.

Red Spot

*Something intelligent, yet funny*

Nielk1

How are you accounting for the gamprefs system? You better note dare phase it out? There are DLL functions to get that data so default should cause the team color system to be used. I can also see this causing monstrous issues if players choose to override team colors. How have you coded to ensure that the client side override and server side gameprefs style settings work?

Click on the image...

General BlackDragon

how are babies made?  :-D :lol:

Sorry, random thought.

Yeah, the client side gameprefs may be overridden but not overwritten.



*****General BlackDragon*****

Red Spot

This worked in 1.2, and so far works in 1.3 as well ... Thats all I'm doing.
if (m_HumanTeamColor == 0)
{
ClearTeamColor(m_StratTeam);
}
else if (m_HumanTeamColor > 1)
{
SetTeamColor(m_StratTeam, m_HumanTColorRed, m_HumanTColorGreen, m_HumanTColorBlue);
}
if (m_CPUTeamColor == 0)
{
ClearTeamColor(m_CPUTeamNumber);
}
else if (m_CPUTeamColor > 1)
{
SetTeamColor(m_CPUTeamNumber, m_CPUTColorRed, m_CPUTColorGreen, m_CPUTColorBlue);
}


From map "MPI: Instant Test" :):
*Something intelligent, yet funny*