Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 25

///////////////////////////////////////////////////////////////////////////////

//
// Pandemic Studios
//
// MultiPlayer Interface Configuration
//

ConfigureInterface()
{
CreateColorGroup("Client::ColorSlot", "Sys::Texture")
{
AllTextures("if_Interfacealpha_shell.tga", 39, 1, 17, 17);
}

CreateColorGroup("Client::PlayerColor", "Sys::Texture")
{
AllTextures("if_Interfacealpha_shell.tga", 8, 19, 7, 7);
}

CreateColorGroup("Client::Launch", "Sys::Texture")
{
AllTextures("if_Interface_shell.tga", 35, 1, 21, 21);
}

CreateColorGroup("Client::PlayerSlot", "Sys::Texture")
{
NormalBg(255, 255, 255, 0);
HilitedBg(255, 255, 0, 32);
SelectedBg(255, 255, 0, 64);
HilitedSelBg(255, 255, 0, 96);
DisabledBg(255, 255, 255, 0);
NormalFg(220, 220, 170, 255);
HilitedFg(255, 255, 220, 255);
SelectedFg(255, 255, 220, 255);
DisabledFg(220, 220, 170, 180);
HilitedSelFg(255, 255, 220, 255);
}

CreateColorGroup("Shell::ChatText")
{
AllBg(255, 255, 255, 0);
AllFg(220, 220, 170, 255);
}

CreateColorGroup("Client::Kick", "Sys::Texture")
{
NormalTexture("if_Interface_shell.tga", 1, 115, 21, 21);
HilitedTexture("if_Interface_shell.tga", 23, 115, 21, 21);
SelectedTexture("if_Interface_shell.tga", 45, 115, 21, 21);
HilitedSelTexture("if_Interface_shell.tga", 45, 115, 21, 21);
}

// A single player slot


DefineControlType("MultiPlayer::Setup::Players::Slot",
"MultiPlayer::Players::Slot")
{
Align("^");
Geometry("HInternal", "Bottom");
Style("Transparent");
ColorGroup("Sys::Texture");
Size(300, 26);

CreateControl("SlotColorBkgnd", "Static")
{
ColorGroup("Sys::Texture");
Size(21, 21);
Pos(4, -2);
Geometry("Bottom");
Image("if_Interface_shell.tga", 67, 115, 21, 21);
}

CreateControl("SlotColor", "MultiPlayer::Players::SlotColor")
{
Size(7, 7);
Pos(11, -9);
Geometry("Bottom");
ColorGroup("Client::PlayerColor");
}

CreateControl("SlotColorHilite", "Static")
{
Size(7, 7);
Pos(11, -9);
Geometry("Bottom");
Image("if_Interfacealpha_shell.tga", 16, 19, 7, 7);
ColorGroup("Sys::Texture");
}

CreateControl("Launch", "Static")
{
Size(21, 21);
Geometry("Bottom");
Pos(274, -2);
ColorGroup("Client::Launch");
}

CreateControl("NoLaunch", "Static")
{
Skin("Shell::Panel");
Style("!Dropshadow", "!VGradient", "Transparent");
Geometry("Bottom");
Pos(274, -2);
Size(21, 21);
}

CreateControl("Name", "Static")
{
CreateControl("NameBorder", "Static")
{
ColorGroup("Sys::Texture");
Geometry("ParentWidth", "ParentHeight");
Skin("Shell::Panel");
Style("Transparent");
}
ColorGroup("Client::PlayerSlot");
Style("!Inert");
JustifyText("Left");
Geometry("Bottom");
TextOffset(3, 0);
Size(146, 21);
Pos(26, -2);
Font("System");

TranslateEvent("Event::Press1",
"MultiPlayer::Players::Slot::Message::Select", "<");
}

CreateControl("Kick", "Button")
{
ColorGroup("Client::Kick");
Style("!Dropshadow", "!VGradient", "SelectWhenDown");
Geometry("Bottom");
Pos(174, -2);
Size(21, 21);
TranslateEvent("Button::Notify::Pressed",
"MultiPlayer::Players::Slot::Message::Kick", "<");
}

CreateControl("NoKick", "Static")
{
Skin("Shell::Panel");
Style("!Dropshadow", "!VGradient", "Transparent");
Geometry("Bottom");
Pos(174, -2);
Size(21, 21);
}

CreateControl("DisableBkgnd", "Static")
{
ColorGroup("Sys::Texture");
Size(-2, 0);
Image()
{
Image("if_InterfaceAlpha_shell.tga", 1, 19, 6, 6);
Mode("Stretch");
Filter(0);
}

Geometry("ParentWidth", "ParentHeight");
}

CreateControl("Group", "DropList")
{
ReadRegData("Reg::Shell::DropList");
Geometry("Bottom");
Style("SafePullDown");
Pos(197, -2);
Height(134);
Size(75, 21);
UseVar("$<.group");

ListBox("ListBox")
{
ReadTemplate("shell::DropListBox");
AddTextItem("0", "#multiplayer.setup.teams.0");
AddTextItem("1", "#multiplayer.setup.teams.1");
AddTextItem("2", "#multiplayer.setup.teams.2");
AddTextItem("3", "#multiplayer.setup.teams.3");
AddTextItem("4", "#multiplayer.setup.teams.4");
AddTextItem("5", "#multiplayer.setup.teams.5");
AddTextItem("6", "#multiplayer.setup.teams.6");
AddTextItem("7", "#multiplayer.setup.teams.7");
}
}

CreateControl("SeparatorBase", "Static")
{
ColorGroup("Sys::Texture");
Image("if_Interfacealpha_shell.tga", 19, 14, 12, 2);
Geometry("ParentWidth", "Top");
Size(-5, 2);
Pos(2, 0);
}

CreateControl("SeparatorBaseBottom", "Static")
{
ColorGroup("Sys::Texture");
Image("if_Interfacealpha_shell.tga", 19, 17, 12, 1);
Geometry("ParentWidth", "Bottom");
Size(-5, 1);
Pos(2, 0);
}

CreateControl("Separator", "Static")
{
ColorGroup("Sys::Texture");
Image("if_Interface_shell.tga", 23, 67, 21, 3);
Geometry("ParentWidth");
Size(-8, 3);
Pos(4, -1);
CreateControl("SeparatorLEnd", "Static")
{
ColorGroup("Sys::Texture");
Image("if_Interface_shell.tga", 20, 67, 2, 3);
Geometry("Left");
Size(2, 3);
Pos(-2, 0);
}
CreateControl("SeparatorLEnd", "Static")
{
ColorGroup("Sys::Texture");
Image("if_Interface_shell.tga", 45, 67, 2, 3);
Geometry("Right");
Size(2, 3);
Pos(2, 0);
}
}

// The slot is being used by a player


OnEvent("MultiPlayer::Players::Notify::Slot::On")
{
Enable();
Deactivate("DisableBkgnd");
Activate("SlotColorBkgnd");
Activate("SlotColor");
Activate("SlotColorHilite");
Activate("Name");
Activate("Launch");
Activate("NoLaunch");
Activate("Group");
DisableRecurse("Group");
}

// No player in this slot


OnEvent("MultiPlayer::Players::Notify::Slot::Off")
{
Deactivate("SlotColorBkgnd");
Deactivate("SlotColor");
Deactivate("SlotColorHilite");
Deactivate("Launch");
Deactivate("NoLaunch");
Deactivate("Name");
Deactivate("Kick");
Deactivate("NoKick");
Deactivate("Group");
Deactivate("Separator");
Activate("DisableBkgnd");
Disable();
}

// Enable and disable the group drop list


OnEvent("Multiplayer::Players::Notify::Group::Disable")
{
DisableRecurse("Group");
}

OnEvent("Multiplayer::Players::Notify::Group::Enable")
{
EnableRecurse("Group");
}

// Turn the kick button on / off


OnEvent("MultiPlayer::Players::Notify::Kick::On")
{
Activate("Kick");
Deactivate("NoKick");
}

OnEvent("MultiPlayer::Players::Notify::Kick::Off")
{
Deactivate("Kick");
Activate("NoKick");
}

// Change the launch status


OnEvent("MultiPlayer::Players::Notify::Launch::On")
{
Activate("Launch");
Deactivate("NoLaunch");
}

OnEvent("MultiPlayer::Players::Notify::Launch::Off")
{
Activate("NoLaunch");
Deactivate("Launch");
}

// Turn the group separator on / off


OnEvent("Multiplayer::Players::Notify::Separator::On")
{
Activate("Separator");
Select("Separator");
}

OnEvent("Multiplayer::Players::Notify::Separator::Off")
{
Deactivate("Separator");
}

// I'm a client and this is my slot


OnEvent("Multiplayer::Players::Notify::LocalClient::On")
{
Select("Name");
}

// I'm a client and this is not my slot


OnEvent("Multiplayer::Players::Notify::LocalClient::Off")
{
Disable("Name");
}

// Slot is selected
OnEvent("Multiplayer::Players::Notify::Selected::On")
{
Select("Name");
}

// Slot is deslected
OnEvent("Multiplayer::Players::Notify::Selected::Off")
{
Deselect("Name");
}
}

// A single host button


DefineControlType("MultiPlayer::Setup::HostButton", "Button")
{
ReadTemplate("Shell::LockButton");
Geometry("Bottom");
Size(95, 25);
Font("System");
}

// A single color selector


DefineControlType("MultiPlayer::Setup::ColorSelect::Selector",
"MultiPlayer::ColorSelect::Selector")
{
Size(17, 17);
ColorGroup("Client::ColorSlot");

OnEvent("Multiplayer::ColorSelect::Selector::On")
{
Activate();
}

OnEvent("Multiplayer::ColorSelect::Selector::Off")
{
Deactivate();
}
}

CreateControl("Shell::MultiPlayer::Setup", "Window")
{
Size(640, 480);
Geometry("HCentre", "VCentre");

CreateControl("Background640x480", "Static")
{
Size(640, 480);
Style("Transparent");
ColorGroup("Sys::Texture");
Geometry("HCentre", "VCentre");

CreateControl("TopLeft", "Static")
{
Size(256, 256);
Pos(0, 0);
ColorGroup("Sys::Texture");
Image("if_background_TL.tga", 0, 0, 256, 256);
}
CreateControl("Top", "Static")
{
Size(256, 256);
ColorGroup("Sys::Texture");
Image("if_background_T.tga", 0, 0, 256, 256);
Pos(256, 0);
}
CreateControl("TopRight", "Static")
{
Size(128, 256);
ColorGroup("Sys::Texture");
Image("if_background_R.tga", 0, 0, 128, 256);
Pos(512, 0);
}
CreateControl("BottomLeft", "Static")
{
Size(256, 224);
ColorGroup("Sys::Texture");
Image("if_background_BL.tga", 0, 0, 256, 224);
Pos(0, 256);
}
CreateControl("Bottom", "Static")
{
Size(256, 224);
ColorGroup("Sys::Texture");
Image("if_background_B.tga", 0, 0, 256, 224);
Pos(256, 256);
}
CreateControl("BottomRight", "Static")
{
Size(128, 224);
ColorGroup("Sys::Texture");
Image("if_background_R.tga", 128, 0, 128, 224);
Pos(512, 256);
}

CreateControl("DropShadowBL", "Static")
{
Size(3, 3);
Pos(0, 3);
ColorGroup("Sys::Texture");
Geometry("Bottom");
Image("if_interfacealpha_shell.tga", 24, 25, 3, 3);
}

CreateControl("DropShadowB", "Static")
{
Size(642, 3);
Pos(3, 3);
ColorGroup("Sys::Texture");
Geometry("Bottom");
Image("if_interfacealpha_shell.tga", 24, 19, 1, 3);
}

CreateControl("DropShadowBR", "Static")
{
Size(3, 3);
Pos(3, 3);
ColorGroup("Sys::Texture");
Geometry("Bottom", "Right");
Image("if_interfacealpha_shell.tga", 26, 19, 3, 3);
}

CreateControl("DropShadowR", "Static")
{
Size(3, 480);
Pos(3, 3);
ColorGroup("Sys::Texture");
Geometry("Right");
Image("if_interfacealpha_shell.tga", 24, 23, 3, 1);
}

CreateControl("DropShadowTR", "Static")
{
Size(3, 3);
Pos(3, 0);
ColorGroup("Sys::Texture");
Geometry("Right");
Image("if_interfacealpha_shell.tga", 28, 25, 3, 3);
}
}

ColorGroup("Sys::Texture");

//
// Top title bar
//
CreateControl("TitleBar", "Static")
{
Geometry("ParentWidth");
Style("Transparent");
Size(0, 20);
Pos(2, -2);

CreateControl("Players", "Static")
{
Size(0, 20);
Pos(-170, 4);
Geometry("AutoSizeX", "HCentre");
Style("Transparent");
Font("Debriefing");
Colorgroup("shell::headertext");
Text("#multiplayer.setup.titlebar.players");

CreateControl("PlayersWingsRight", "Static")
{
Size(32, 17);
Geometry("Right");
Pos(36, 2);
Image("if_interfacealpha_shell.tga", 0, 46, 32, 17);
Colorgroup("Sys::Texture");
}

CreateControl("PlayersWingsLeft", "Static")
{
Size(32, 17);
Pos(-36, 2);
Image("if_interfacealpha_shell.tga", 32, 46, 32, 17);
Colorgroup("Sys::Texture");
}
}

CreateControl("Chat", "Static")
{
Size(0, 20);
Pos(170, 4);
Geometry("HCentre", "AutoSizeX");
Style("Transparent");
Font("Debriefing");
Colorgroup("shell::headertext");
Text("#multiplayer.setup.titlebar.chat");

CreateControl("ChatWingsRight", "Static")
{
Size(32, 17);
Geometry("Right");
Pos(36, 2);
Image("if_interfacealpha_shell.tga", 0, 46, 32, 17);
Colorgroup("Sys::Texture");
}

CreateControl("ChatWingsLeft", "Static")
{
Size(32, 17);
Pos(-36, 2);
Image("if_interfacealpha_shell.tga", 32, 46, 32, 17);
Colorgroup("Sys::Texture");
}
}

//
// Player slots
//
CreateControl("Players", "Multiplayer::Players")
{
Size(300, 205);
Pos(8, 26);
Style("Transparent");

Behavior("Setup");

CreateControl("Bkgnd", "Static")
{
Geometry("ParentWidth", "ParentHeight");
Size(0, 7);
Pos(0, -3);
Skin("Shell::CutInBorder");
Style("Transparent");
}

CreateControl("Alignment", "Static")
{
Style("Transparent");
}

CreateControl("Slot0", "Multiplayer::Setup::Players::Slot")
{
Size(300, 25);

OnEvent("Window::Notify::Activated")
{
Deactivate("SeparatorBase");
}
}
CreateControl("Slot1", "Multiplayer::Setup::Players::Slot") { }
CreateControl("Slot2", "Multiplayer::Setup::Players::Slot") { }
CreateControl("Slot3", "Multiplayer::Setup::Players::Slot") { }
CreateControl("Slot4", "Multiplayer::Setup::Players::Slot") { }
CreateControl("Slot5", "Multiplayer::Setup::Players::Slot") { }
CreateControl("Slot6", "Multiplayer::Setup::Players::Slot") { }
CreateControl("Slot7", "Multiplayer::Setup::Players::Slot")
{
OnEvent("Window::Notify::Activated")
{
Deactivate("SeparatorBaseBottom");
}
}

OnEvent("Multiplayer::Players::Notify::AddTeam::On")
{
Enable("<HostButtons.AddAI");
}

OnEvent("Multiplayer::Players::Notify::AddTeam::Off")
{
Disable("<HostButtons.AddAI");
}

OnEvent("Multiplayer::Players::Notify::Locked::On")
{
If("multiplayer.flags.ishost", "==", 0)
{
Activate("<LockDisplay");
}
}

OnEvent("Multiplayer::Players::Notify::Locked::Off")
{
If("multiplayer.flags.ishost", "==", 0)
{
Deactivate("<LockDisplay");
}
}
}

//
// Host-only buttons
//
CreateControl("HostButtons", "Static")
{
Style("Transparent");
Size(300, 36);
Pos(8, 234);

CreateControl("Map", "MultiPlayer::Setup::HostButton")
{
Pos(0, -5);
Text("#multiplayer.setup.host.mission");
OnEvent("Button::Notify::Pressed")
{
ActivateScroll("|Shell::MultiPlayer::Setup.HostConfig", "Top", 0.2);
}
}

CreateControl("AddAI", "MultiPlayer::Setup::HostButton")
{
Pos(0, -5);
Text("#multiplayer.setup.host.addai");
Geometry("HCentre");
OnEvent("Button::Notify::Pressed")
{
Cmd("multiplayer.setup.addai");
}
}

CreateControl("Lock", "MultiPlayer::Setup::HostButton")
{
Pos(0, -5);

Style("Toggle");
Geometry("Right");
UseVar("multiplayer.flags.islocked");
Text("#multiplayer.setup.host.lock");
}
}

//
// Displays the game's locked status to clients
//
CreateControl("LockDisplay", "Static")
{
Size(286, 25);
Pos(14, 239);
Skin("Shell::Panel");
ColorGroup("Shell::HeaderText");
Style("Transparent", "NoAutoActivate");
Font("System");
Text("#multiplayer.setup.locked");

CreateControl("RivetTL", "Static")
{
Pos(3, 3);
ColorGroup("Sys::Texture");
Image("if_interfacealpha_shell.tga", 25, 30, 2, 2);
Size(2, 2);
}

CreateControl("RivetTR", "Static")
{
Geometry("Right");
Pos(-3, 3);
ColorGroup("Sys::Texture");
Image("if_interfacealpha_shell.tga", 25, 30, 2, 2);
Size(2, 2);
}

CreateControl("RivetBR", "Static")
{
Geometry("Bottom", "Right");
Pos(-3, -3);
ColorGroup("Sys::Texture");
Image("if_interfacealpha_shell.tga", 25, 30, 2, 2);
Size(2, 2);
}

CreateControl("RivetBL", "Static")
{
Geometry("Bottom");
Pos(3, -3);
ColorGroup("Sys::Texture");
Image("if_interfacealpha_shell.tga", 25, 30, 2, 2);
Size(2, 2);
}

//
// Minimap and color selection
//
CreateControl("InfoPanel", "Static")
{
Style("Transparent");
Size(300, 138);
Pos(8, 270);

CreateControl("MinimapBkgnd", "Static")
{
Size(136, 136);
Pos(6, 0);
Skin("Shell::CutInBorder");
Style("Transparent");
}

CreateControl("Preview", "MultiPlayer::Mission")
{
Size(128, 128);
Pos(10, 4);
Style("Transparent");
ColorGroup("Sys::Texture");

LocationAvailable("if_interfacealpha_shell.tga", 19, 33, 12, 12);


LocationAvailableSelected("if_interfacealpha_shell.tga", 32, 29, 16, 16);
LocationAssigned("if_interfacealpha_shell.tga", 32, 29, 16, 16);
LocationAssignedSelected("if_interfacealpha_shell.tga", 48, 29, 16, 16);
}

CreateControl("ColorBkgnd", "Static")
{
Size(136, 136);
Pos(157, 0);
Skin("shell::panel");
Style("Transparent");
}

CreateControl("Choose", "Static")
{
Size(120, 20);
Skin("Shell::CutInBorder");
ColorGroup("Shell::ButtonColor");
Geometry("Top", "Left");
Pos(165, 5);
Style("Transparent");
JustifyText("Centre");
Font("System");
Text("#multiplayer.setup.choosecolor");
}

CreateControl("EmptyColor", "Static")
{
Geometry("Top", "Left");
Style("Transparent");
Size(104, 104);
Pos(173, 28);

CreateControl("Blank0", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(1, 1);
}
CreateControl("Blank1", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(35, 1);
}
CreateControl("Blank2", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(69, 1);
}
CreateControl("Blank3", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(1, 35);
}
CreateControl("Blank4", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(35, 35);
}
CreateControl("Blank5", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(69, 35);
}
CreateControl("Blank6", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(1, 69);
}
CreateControl("Blank7", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(35, 69);
}
CreateControl("Blank8", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(34, 34);
Image("if_Interface_shell.tga", 0, 0, 34, 34);
Pos(69, 69);
}
}

CreateControl("Colors", "MultiPlayer::ColorSelect")
{
Geometry("Top", "Left");
Style("Transparent");
Size(104, 104);
Pos(173, 28);

// First row
CreateControl("Selector0", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(9, 9);
}

CreateControl("Selector1", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(43, 9);
}

CreateControl("Selector2", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(77, 9);
}

// Second row
CreateControl("Selector3", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(9, 43);
}

CreateControl("Selector4", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(43, 43);
}

CreateControl("Selector5", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(77, 43);
}

// Third row
CreateControl("Selector6", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(9, 77);
}

CreateControl("Selector7", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(43, 77);
}
CreateControl("Selector8", "MultiPlayer::Setup::ColorSelect::Selector")
{
Pos(77, 77);
}
}

CreateControl("ColorHilite", "Static")
{
Geometry("Top", "Left");
Style("Transparent");
Size(104, 104);
Pos(173, 28);

CreateControl("Blank0", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(9, 9);
}
CreateControl("Blank1", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(43, 9);
}
CreateControl("Blank2", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(77, 9);
}
CreateControl("Blank3", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(9, 43);
}
CreateControl("Blank4", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(43, 43);
}
CreateControl("Blank5", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(77, 43);
}
CreateControl("Blank6", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(9, 77);
}
CreateControl("Blank7", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(43, 77);
}
CreateControl("Blank8", "Static")
{
Geometry("Top", "Left");
ColorGroup("Sys::Texture");
Size(17, 17);
Image("if_Interfacealpha_shell.tga", 1, 27, 17, 17);
Pos(77, 77);
}
}

OnEvent("Window::Notify::Activated")
{
If("multiplayer.flags.ishost")
{
SendNotifyEvent("Preview",
"MultiPlayer::Mission::Message::EnableSelection");
}
}
}

//
// Chat panel
//
CreateControl("Chat", "Static")
{
Size(321, 384);
Pos(-8, 21);
Style("Transparent");
Geometry("Right");

CreateControl("Viewer", "ConsoleViewer")
{
ReadTemplate("Shell::SliderListBox");
Geometry("ParentHeight");
Size(319, -29);
Pos(2, 2);
WrapAdjust(22);
Filters()
{
Add("MultiMessage");
Add("MultiError");
Add("ChatMessage");
Add("ChatQuote");
Add("ChatLocal");
Add("ChatPrivate");
}
ItemConfig()
{
Font("System");
Geometry("AutoSizeY", "ParentWidth");
// Size(-20, 0);
ColorGroup("Shell::ChatText");
}
Style("NoSelection", "SmartScroll");
}

CreateControl("EditBkgnd", "Static")
{
Geometry("ParentWidth", "Bottom");
Skin("Shell::CutInBorder");
Style("Transparent");
Size(-2, 22);
Pos(2, 0);
}

CreateControl("Edit", "MultiPlayer::Chat::Edit")
{
Geometry("ParentWidth", "Bottom");
Style("Transparent");
ColorGroup("Shell::EditText");
TextOffset(0, -1);
Size(-6, 16);
Pos(6, -2);
MaxLength(100);
}
}

//
// Select mission
//
CreateControl("HostConfig", "Game::MissionSelection")
{
ColorGroup("Sys::Texture");
Style("Modal", "AdjustWindow", "NoAutoActivate", "UseDescription");
Geometry("HCentre", "VCentre");
Size(640, 480);

CreateControl("Background640x480", "Static")
{
Size(640, 480);
Style("Transparent");
ColorGroup("Sys::Texture");
Geometry("HCentre", "VCentre");

CreateControl("TopLeft", "Static")
{
Size(256, 256);
Pos(0, 0);
ColorGroup("Sys::Texture");
Image("if_background_TL.tga", 0, 0, 256, 256);
}
CreateControl("Top", "Static")
{
Size(256, 256);
ColorGroup("Sys::Texture");
Image("if_background_T.tga", 0, 0, 256, 256);
Pos(256, 0);
}
CreateControl("TopRight", "Static")
{
Size(128, 256);
ColorGroup("Sys::Texture");
Image("if_background_R.tga", 0, 0, 128, 256);
Pos(512, 0);
}
CreateControl("BottomLeft", "Static")
{
Size(256, 224);
ColorGroup("Sys::Texture");
Image("if_background_BL.tga", 0, 0, 256, 224);
Pos(0, 256);
}
CreateControl("Bottom", "Static")
{
Size(256, 224);
ColorGroup("Sys::Texture");
Image("if_background_B.tga", 0, 0, 256, 224);
Pos(256, 256);
}
CreateControl("BottomRight", "Static")
{
Size(128, 224);
ColorGroup("Sys::Texture");
Image("if_background_R.tga", 128, 0, 128, 224);
Pos(512, 256);
}

CreateControl("DropShadowBL", "Static")
{
Size(3, 3);
Pos(0, 3);
ColorGroup("Sys::Texture");
Geometry("Bottom");
Image("if_interfacealpha_shell.tga", 24, 25, 3, 3);
}

CreateControl("DropShadowB", "Static")
{
Size(642, 3);
Pos(3, 3);
ColorGroup("Sys::Texture");
Geometry("Bottom");
Image("if_interfacealpha_shell.tga", 24, 19, 1, 3);
}

CreateControl("DropShadowBR", "Static")
{
Size(3, 3);
Pos(3, 3);
ColorGroup("Sys::Texture");
Geometry("Bottom", "Right");
Image("if_interfacealpha_shell.tga", 26, 19, 3, 3);
}

CreateControl("DropShadowR", "Static")
{
Size(3, 480);
Pos(3, 3);
ColorGroup("Sys::Texture");
Geometry("Right");
Image("if_interfacealpha_shell.tga", 24, 23, 3, 1);
}

CreateControl("DropShadowTR", "Static")
{
Size(3, 3);
Pos(3, 0);
ColorGroup("Sys::Texture");
Geometry("Right");
Image("if_interfacealpha_shell.tga", 28, 25, 3, 3);
}
}

CreateControl("Title", "Static")
{
Skin("Shell::RaisedBorderDark");
Geometry("ParentWidth", "HCentre", "Top");
Style("Transparent");
TextOffset(0, 1);
ColorGroup("Shell::HeaderText");
Pos(0, 6);
TextOffset(0, -1);
Size(-14, 25);
Font("Debriefing");
Text("#multiplayer.setup.selectmission.title");
}

DefaultGroup("missions\mp");

CreateControl("MinimapTitle", "Static")
{
Skin("Shell::SolidClient");
Geometry("Right");
Font("System");
Size(136, 20);
Pos(-10, 41);
ColorGroup("Shell::Text");
Style("Transparent");
Text("#multiplayer.setup.selectmission.map");
TextOffset(0, -1);
}

CreateControl("MinimapBkgnd", "Static")
{
Size(136, 136);
Pos(-10, 63);
Geometry("Right");
Skin("Shell::CutInBorder");
Style("Transparent");
}

CreateControl("Preview", "Static")
{
Pos(-14, 67);
Geometry("Right");
Size(128, 128);
ColorGroup("Sys::Texture");
}

CreateControl("MissionList", "ListBox")
{
ReadTemplate("shell::sliderListBox");
Pos(10, 36);
Size(468, 372);
UseVar("$<.mission");
}

CreateControl("MissionSize", "Static")
{
Skin("Shell::Panel");
Geometry("Right");
Font("System");
Size(136, 20);
Pos(-10, 201);
ColorGroup("Shell::Text");
Style("Transparent");
UseVar("$<.missionSize");
FormatSpec("Mission Size: {1:d}m");
TextOffset(0, -1);
}

CreateControl("MissionNumTeams", "Static")
{
Geometry("Bottom", "HCentre", "ParentWidth");
Font("System");
Size(-30, 20);
Pos(0, -41);
Skin("Shell::Panel");
ColorGroup("Shell::Text");
TextOffset(0, -1);
Style("Transparent");
UseVar("$<.missionTeams");
FormatSpec("#multiplayer.setup.selectmission.players");
}

CreateControl("Controls", "Static")
{
Size(155, 25);
Pos(10, -8);
Geometry("Bottom", "HCentre");
Style("Transparent");

CreateControl("OK", "Button")
{
ReadTemplate("shell::button");
Size(75, 25);
Font("System");
Text("#std.buttons.ok");

OnEvent("Button::Notify::Pressed")
{
SendNotifyEvent("<<",
"Shell::MultiPlayer::Setup::HostConfig::SelectMission");
DeactivateScroll("<<", "Top", 0.2);
}
}

CreateControl("Random", "Button")
{
ReadTemplate("shell::button");
Size(75, 25);
Geometry("Right");
Font("System");
Text("Random");

OnEvent("Button::Notify::Pressed")
{
Cmd("multiplayer.setup.setrandommission missions\mp");
DeactivateScroll("<<", "Top", 0.2);
}
}
}

OnEvent("Game::MissionSelection::Notify::PreviewInvalid")
{
Deactivate("Preview");
}

OnEvent("Game::MissionSelection::Notify::PreviewValid")
{
Activate("Preview");
}

OnEvent("Game::MissionSelection::Notify::Ready")
{
Cmd("multiplayer.setup.getmission |Shell::MultiPlayer::Setup.HostConfig");
}

OnEvent("Shell::MultiPlayer::Setup::HostConfig::SelectMission")
{
Cmd("multiplayer.setup.setmission |Shell::MultiPlayer::Setup.HostConfig");
}
}

//
// Back button
//
CreateControl("Back", "Shell::BackButton")
{
Pos(5, -5);

OnEvent("Button::Notify::Pressed")
{
If("multiplayer.flags.waslobby")
{
Cmd("multiplayer.abort");
Cmd("quit");
}
Else()
{
SendNotifyEvent("<", "GameSetup::Message::Leaving");
Deactivate("<");
Cmd("multiplayer.abort");
ActivateScroll("|Shell::MultiPlayer::Sessions", "Top", 0.2);
}
}
}

//
// Launch button
//
CreateControl("Offline", "Shell::PlayButton")
{
Pos(-70, -5);

Text("Offline");
OnEvent("Button::Notify::Pressed")
{
Op("multiplayer.flags.islocked", "=", 1);
MessageBox()
{
Title("Start Offline Play");
Message("Are You Sure?");
Button0("#std.buttons.ok", "ok");
Button1("Cancel", "Cancel");
}
}

OnEvent("ok")
{
Cmd("gamegod.missions.launch");
}

OnEvent("Cancel")
{
Op("multiplayer.flags.islocked", "=", 0);
}
}

//
// Launch button
//
CreateControl("Launch", "Shell::PlayButton")
{
Pos(-5, -5);

OnEvent("Button::Notify::Pressed")
{
Cmd("multiplayer.setup.launch");
}
}

//
// Current mission title
//
CreateControl("MissionTitle", "Static")
{
Font("Debriefing");
Skin("Shell::CutInBorder");
Style("Transparent");
Geometry("HCentre", "Bottom");
Size(423, 53);
Pos(-32, -10);
TextOffset(0, 0);
ColorGroup("Shell::HeaderText");
Text("");
}

CreateControl("MissionBorder", "Static")
{
Size(433, 63);
Geometry("HCentre", "Bottom");
Skin("Shell::Panel");
Style("Transparent");
ColorGroup("Sys::Texture");
Pos(-32, -5);
}

// Created a session
OnEvent("GameSetup::Message::Created")
{
Cmd("multiplayer.setup.created");
}

// Joined a session
OnEvent("GameSetup::Message::Joined")
{
Cmd("multiplayer.setup.joined");
}

OnEvent("GameSetup::Message::Entered")
{
Cmd("multiplayer.register.setup Shell::MultiPlayer::Setup");

ConConvert("MultiMessage", "Multi::Old");
ConConvert("MultiError", "Multi::Old");
ConConvert("ChatMessage", "Multi::Old");
ConConvert("ChatQuote", "Multi::Old");
ConConvert("ChatLocal", "Multi::Old");

Notify("Chat.Viewer", "ConsoleViewer::Message::Rebuild");
}

// Leaving a session
OnEvent("GameSetup::Message::Leaving")
{
Cmd("multiplayer.setup.leaving");
}

// Startup
OnEvent("Window::Notify::Activated")
{
If("multiplayer.flags.ishost")
{
Activate("HostButtons.Map");
Activate("HostButtons.Lock");
Activate("HostButtons.AddAI");
Enable("Offline");

Activate("|Shell::Multiplayer::Setup.HostConfig");
Cmd("multiplayer.setup.setrandommission missions\mp");
Deactivate("|Shell::Multiplayer::Setup.HostConfig");
Op("user.vars.difficulty", "=", 2);
}
Else()
{
Deactivate("HostButtons.Map");
Deactivate("HostButtons.Lock");
Deactivate("HostButtons.AddAI");
Disable("Offline");
}

SetFocus("Chat.Edit");
}
}

You might also like