// #autoload // #name = ChannelChangePopup // #version = Beta 0.1 // #date = 25/05/2002 // #author = J!6enX // #email = mail@chicki.de // #web = www.chicki.de // #description = Shows the voice program channel you just chnaged to // #status = In Development. ////////////////////////////////// /// You can edit these options./// ////////////////////////////////// //Channel Message 1 $chanmsg1 = "channel 1 - general"; //Channel Message 2 $chanmsg2 = "channel 2 - defense"; //Channel Message 3 $chanmsg3 = "channel 3 - offense"; //Switch MSG $switchmsg = "You switched to"; $UseChat = true; $UseHud = true; //Do we want to announce our channel in team chat? $UseTeamChat = true; //bold popup text? $boldpopup = true; //transparent popup? $transpopup = true; //Hex values please $color1 = FF0000; $color2 = DBC880; //popup time in ms - default = 5000 $popuptime = 5000; ////////////////////////////// /// You can no longer edit./// ////////////////////////////// package ChannelHud { function ChannelhudSetup() { if (!$transpopup) { $transornot = "GuiChatBackProfile"; } else { $transornot = "GuiButtonProfile"; } if (!$boldpopup) { $GrenHudFont = "Univers Condensed"; } else { $GrenHudFont = "Univers Bold"; } new GuiControlProfile ("ChannelHudProfile") { fontType = $ChannelHudFont; fontSize = 16; justify = "center"; }; } function ChannelChangeHud1(%this) { if(%this) { if($UseChat) { addMessageHudLine("\c3" @ $switchmsg @ "\c5" @ $chanmsg1); } if($UseTeamChat) { %message1 = "\c3" @ $switchmsg @ "\c5" @ $chanmsg1; commandToServer('TeamMessageSent', %message1); } if($UseHud) { ChannelHudText.setText("" @ $switchmsg @ "" @ $chanmsg1); ChannelHud.setVisible(true); ChannelCyclerHud.scheduleTask = ChannelHud.schedule($popuptime, setVisible, false); } } } function ChannelChangeHud3(%this) { if(%this) { if($UseChat) { addMessageHudLine("\c3" @ $switchmsg @ "\c5" @ $chanmsg3); } if($UseTeamChat) { %message3 = "\c3" @ $switchmsg @ "\c5" @ $chanmsg3; commandToServer('TeamMessageSent', %message3); } if($UseHud) { ChannelHudText.setText("" @ $switchmsg @ "" @ $chanmsg3); ChannelHud.setVisible(true); ChannelCyclerHud.scheduleTask = ChannelHud.schedule($popuptime, setVisible, false); } } } function ChannelChangeHud2(%this) { if(%this) { if($UseChat) { addMessageHudLine("\c3" @ $switchmsg @ "\c5" @ $chanmsg2); } if($UseTeamChat) { %message2 = "\c3" @ $switchmsg @ "\c5" @ $chanmsg2; commandToServer('TeamMessageSent', %message2); } if($UseHud) { ChannelHudText.setText("" @ $switchmsg @ "" @ $chanmsg2); ChannelHud.setVisible(true); ChannelCyclerHud.scheduleTask = ChannelHud.schedule($popuptime, setVisible, false); } } } function OptionsDlg::onWake(%this) { if(!$ChanHudbind) { $RemapName[$RemapCount]="ChannelHud 1"; $RemapCmd[$RemapCount]="ChannelChangeHud1"; $RemapCount++; $RemapName[$RemapCount]="ChannelHud 2"; $RemapCmd[$RemapCount]="ChannelChangeHud2"; $RemapCount++; $RemapName[$RemapCount]="ChannelHud 3"; $RemapCmd[$RemapCount]="ChannelChangeHud3"; $RemapCount++; $ChanHudbind = true; } parent::onWake(%this); } function ChannelHudCreate() { ChannelHudDestroy(); new ShellFieldCtrl(ChannelHud) { profile = $transornot; horizSizing = "left"; vertSizing = "top"; position = "200 0"; extent = "250 26"; minExtent = "8 8"; visible = "0"; setFirstResponder = "0"; new GuiMLTextCtrl(ChannelHudText) { profile = "ChannelProfile"; horizSizing = "center"; vertSizing = "center"; position = "3 5"; extent = "244 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; maxChars = "-1"; }; }; playgui.add(ChannelHud); } function ChannelHudDestroy() { if (isObject(ChannelHud)) { playGui.remove(ChannelHud); ChannelHud.delete(); } } function DispatchLaunchMode() { ChannelHudSetup(); parent::DispatchLaunchMode(); } function LoadingGui::onWake(%this) { if(!$ChannelHudSetup) { ChannelHudCreate(); if(isObject(HudMover)) { hudmover::addhud(ChannelHud, "Change Channel Hud"); } $ChannelHudSetup = true; } parent::onWake(%this); } }; activatePackage(ChannelHud);