//LoadScreens 0.435 BETA //By Smokescreen //I know it has bugs. Its beta. package LoadScreensPKG { function GMJ_Browser::onSelect( %this, %address ) { parent::onSelect( %this, %address ); cancel($ThrottledselectSchedule); $ThrottledselectSchedule = schedule(0, 0, "Throttledselect"); } function Throttledselect() { %info = GMJ_Browser.getServerInfoString(); %bitmapName = getRecord( %info, 5 ); switch$ ( %bitmapName ) { case "Casern Cavite": %bitmapName = "Casern_Cavite"; } %bitmapName = strreplace(%bitmapName, "'", ""); %bitmapName = strreplace(%bitmapName, " ", ""); if (!isDemo()) %loadBmp = "gui/load_" @ %bitmapName @ ".png"; else %loadBmp = "gui/load_" @ %bitmapName @ ".bm8"; if ( !isFile( "textures/" @ %loadBmp ) ) { if (getsubstr(%bitmapName,strlen(%bitmapName)-2,strlen(%bitmapName)) $= "++") %bitmapname = getsubstr(%bitmapName,0,strlen(%bitmapName)-2); if (getsubstr(%bitmapName,strlen(%bitmapName)-1,strlen(%bitmapName)) $= "V") %bitmapname = getsubstr(%bitmapName,0,strlen(%bitmapName)-1); if (!isDemo()) %loadBmp = "gui/load_" @ %bitmapName @ ".png"; else %loadBmp = "gui/load_" @ %bitmapName @ ".bm8"; if ( !isFile( "textures/" @ %loadBmp ) ) %loadBmp = ""; } Debrief_MapPic3.setBitmap( %loadBmp ); } function LoadingGui::onWake(%this) { DebriefResultText.setText($Load::Result); Canvas.setContent( DebriefGui ); parent::onWake( %this ); } function LobbyPlayerList::initColumns( %this ) { %this.clear(); %this.clearColumns(); %this.addColumn( 0, " ", 24, 24, 24, "center" ); // Flag column %this.addColumn( 6, "lobby_headset", 36, 36, 36, "headericon" ); // Voice Com column %this.addColumn( 1, "Player", $pref::Lobby::Column1, 50, 200 ); if ( $clTeamCount > 1 ) %this.addColumn( 2, "Team", $pref::Lobby::Column2, 50, 200 ); %this.addColumn( 3, "Score", $pref::Lobby::Column3, 25, 200, "numeric center" ); %this.addColumn( 4, "Ping", $pref::Lobby::Column4, 25, 200, "numeric center" ); %this.addColumn( 5, "PL", $pref::Lobby::Column5, 25, 200, "numeric center" ); if ( $InLobby ) commandToServer( 'getScores' ); } function handleClientJoin(%msgType, %msgString, %clientName, %clientId, %targetId, %isAI, %isAdmin, %isSuperAdmin, %isSmurf, %guid) { parent::handleClientJoin(%msgType, %msgString, %clientName, %clientId, %targetId, %isAI, %isAdmin, %isSuperAdmin, %isSmurf, %guid); if (%isAdmin) %bla = "A"; if (%isSuperAdmin) %bla = "SA"; %word = detag( %clientName ); if (!$LoadScreen::Paired) { $LoadScreen::Pair = %word; $LoadScreen::Paired = 1; } else { LoadScreen::Pairs( %msgType, %msgString, $LoadScreen::Pair, %word ); $LoadScreen::Paired = 0; } } function LoadScreen::Pairs( %msgType, %msgString, %clientName, %clientName2 ) { handleDebriefLineMessage( %msgType, %msgString, "" @ %clientName @ "" @ %clientName2 ); } function DebriefGui::onWake( %this ) { $Load::Firsttime2 = true; parent::onwake( %this ); debriefMap.bind( keyboard, insert, voteYes ); debriefMap.bind( keyboard, delete, voteNo ); DB_LoadingProgressTxt.setValue("Waiting"); DB_scrolltimer(); } function DB_scrolltimer() { DB_ChatScroll.scrollToBottom(); $DB_scrolltimerSchedule = schedule(1000, 0, "DB_scrolltimer"); } function DebriefGui::onSleep( %this ) { parent::onSleep(%this); cancel($DB_scrolltimerSchedule); DebriefResultText.setText( "" ); DebriefText.setText( "" ); Canvas.popDialog( DB_ChatDlg ); } function disconnect() { parent::disconnect(); DebriefText.setText( "" ); $LoadScreen::Paired = 0; } function handleGameOverMessage( %msgType, %msgString ) { %obj = DB_ResultScroll.getObject(0); %obj.remove(LOAD_MapText); DB_LoadingProgressTxt.setValue("Waiting"); parent::handleGameOverMessage( %msgType, %msgString ); } function handleLoadInfoMessage( %msgType, %msgString, %bitmapName, %mapName, %missionType ) { parent::handleLoadInfoMessage( %msgType, %msgString, %bitmapName, %mapName, %missionType ); if (!isDemo()) %loadBmp = "gui/load_" @ %bitmapName @ ".png"; else %loadBmp = "gui/load_" @ %bitmapName @ ".bm8"; if ( !isFile( "textures/" @ %loadBmp ) ) { if (getsubstr(%bitmapName,strlen(%bitmapName)-2,strlen(%bitmapName)) $= "++") %bitmapname = getsubstr(%bitmapName,0,strlen(%bitmapName)-2); if (getsubstr(%bitmapName,strlen(%bitmapName)-1,strlen(%bitmapName)) $= "V") %bitmapname = getsubstr(%bitmapName,0,strlen(%bitmapName)-1); if (!isDemo()) %loadBmp = "gui/load_" @ %bitmapName @ ".png"; else %loadBmp = "gui/load_" @ %bitmapName @ ".bm8"; if ( !isFile( "textures/" @ %loadBmp ) ) %loadBmp = ""; } Debrief_MapPic.setBitmap( %loadBmp ); Debrief_MapPic2.setBitmap( %loadBmp ); $Load::Result = "Next: " @ %mapName @ " (" @ %missionType @ ")"; if ($Load::Firsttime2) handleDebriefResultMessage( %msgType, %msgString, $Load::Result); $Load::Firsttime2 = false; } function clientCmdMissionStartPhase1(%seq, %missionName, %musicTrack) { parent::clientCmdMissionStartPhase1(%seq, %missionName, %musicTrack); DB_LoadingProgressTxt.setValue("Validating shapes"); } function clientCmdMissionStartPhase2(%seq, %missionName) { parent::clientCmdMissionStartPhase2(%seq, %missionName); DB_LoadingProgressTxt.setValue("Cleaning up"); DB_LoadingProgress.setValue( 0 ); } function clientCmdMissionStartPhase3(%seq, %missionName) { parent::clientCmdMissionStartPhase3(%seq, %missionName); DB_LoadingProgressTxt.setValue("Lighting mission"); DB_LoadingProgress.setValue( 0 ); } function ghostAlwaysStarted(%ghostCount) { parent::ghostAlwaysStarted(%ghostCount); DB_LoadingProgressTxt.setValue("Ghosting objects"); } function ClientReceivedDataBlock(%index, %total) { parent::ClientReceivedDataBlock(%index, %total); %pct = %index / %total; DB_LoadingProgress.setValue( %pct ); Canvas.repaint(); } function Initmappiq() { new GuiChunkedBitmapCtrl(Debrief_MapPic) { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "height"; position = "0 0"; extent = "237 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = ""; useVariable = "0"; }; new GuiChunkedBitmapCtrl(Debrief_MapPic2) { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "height"; position = "0 0"; extent = "237 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = ""; useVariable = "0"; }; new GuiChunkedBitmapCtrl(Debrief_MapPic3) { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "height"; position = "0 0"; extent = "237 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = ""; useVariable = "0"; }; %obj = DebriefGui.getObject(0); %obj2 = DebriefGui.getObject(1); %obj3 = DebriefGui.getObject(2); DebriefGui.add(Debrief_MapPic); DebriefGui.remove(%obj); DebriefGui.add(%obj); DebriefGui.remove(%obj2); DebriefGui.add(%obj2); DebriefGui.remove(%obj3); DebriefGui.add(%obj3); //LobbyGui.variable = ""; //LobbyGui.useVariable = "0"; //LobbyGui.profile = "GuiContentProfileNoClear"; %obj = LobbyGui.getObject(0); LobbyGui.add(Debrief_MapPic2); LobbyGui.remove(%obj); LobbyGui.add(%obj); Gamegui.add(Debrief_MapPic3); Gamegui.remove(GM_Frame); Gamegui.add(GM_Frame); %obj = DebriefGui.getObject(4); %obj.setposition(478,417); %obj = DebriefGui.getObject(5); DebriefGui.remove(%obj); ShellProgressBarTextProfile.fontColor = "500 500 0"; } function DispatchLaunchMode() { Initmappiq(); parent::DispatchLaunchMode(); } function debriefContinue() { MessageBoxYesNo( "DISCONNECT", "Disconnect?", "Disconnect();" ); } }; activatePackage(LoadScreensPKG);