Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- */
- ============================
- myPC - A Garry's Mod OS
- by Wolfie!
- v0.4 BUILT 0158
- ============================
- TABLE OF CONTENTS:
- && - MainPanel
- && - myBIOS-Main
- && - myBIOS-LoadingOS
- && - myOS-Welcome //Coming soon...
- && - myOS-Main
- && - myOS-Menu-SecurityCenter //Coming soon...
- */
- CreateConVar("myPC_loadingos", "0");
- CreateConVar("myPC_successload", "0");
- CreateConVar("myPC_Debug", "1");
- CreateConVar("myPC_Development", "1");
- function MainPanel()
- local MainPanel = vgui.Create( "DFrame" );
- MainPanel:SetPos( 50, 50 );
- MainPanel:SetSize( 800, 620 );
- MainPanel:SetTitle( "myPC v0.4 - a Garrys Mod OS - by Wolfie!" );
- MainPanel:SetVisible( true );
- MainPanel:SetDraggable( false );
- MainPanel:ShowCloseButton( true ); //I've set that to true for debugging options. I'll set that later to false again.
- MainPanel:MakePopup();
- end
- function myBIOSMain()
- local MyBIOSMainImg = vgui.Create( "DPanel", MainPanel );
- MyBIOSMainImg:SetPos( 0, 20 );
- MyBIOSMainImg:SetSize( 800, 600 );
- MyBIOSMainImg.Paint = function()
- surface.SetDrawColor( 60, 60, 60, 255 );
- surface.DrawRect( 0, 0, MyBIOSMainImg:GetWide(), MyBIOSMainImg:GetTall() );
- end
- /*
- //I will add an picture for MyBIOS in there, or maybe not...
- myBIOSImg = vgui.Create( "DImage", MyBIOSMainImg );
- myBIOSImg:SetPos( 25, 50 );
- myBIOSImg:SetSize( &&, && );
- myBIOSImg:SetImage( "Brick/brickfloor001a.vtf" );
- */
- timer.Simple( 1, (Label1 = vgui.Create( "DLabel", MainPanel );
- Label1:SetText("myBIOS - v1.4");
- Label1:SetPos( 25, 50 );
- ));
- timer.Simple( 1.5, (Label2 = vgui.Create( "DLabel", MainPanel );
- Label2:SetText("by Wolfie!");
- Label2:SetPos( 25, 50 );
- ));
- timer.Simple( 2, (Label3 = vgui.Create( "DLabel", MainPanel );
- Label3:SetText("Checking GMOD version...");
- Label3:SetPos( 25, 50 );
- ));
- timer.Simple( 2.5, (Label4 = vgui.Create( "DLabel", MainPanel );
- Label4:SetText("success!");
- Label4:SetPos( 25, 50 );
- ));
- timer.Simple( 3, (Label5 = vgui.Create( "DLabel", MainPanel );
- Label5:SetText("Checking myPC version...");
- Label5:SetPos( 25, 50 );
- ));
- timer.Simple( 3.5, (Label6 = vgui.Create( "DLabel", MainPanel );
- Label6:SetText("success!");
- Label6:SetPos( 25, 50 );
- ));
- timer.Simple( 4, (Label7 = vgui.Create( "DLabel", MainPanel );
- Label7:SetText("Starting myPC v0.4...");
- Label7:SetPos( 25, 50 );
- ))
- timer.Simple( 5.8, SetConVarNumber("myPC_successload","1") );
- timer.Simple( 5.9, SetConVarNumber("myPC_loadingos","1") );
- function StartLoadingOS()
- if GetConVarNumber("myPC_loadingos") == 1 and GetConVarNumber("myPC_successload") == 1 then
- myBIOSImg:Remove;
- Label1:Remove;
- Label2:Remove;
- Label3:Remove;
- Label4:Remove;
- Label5:Remove;
- Label6:Remove;
- Label7:Remove;
- myBIOSLoadingOS();
- else
- Label8 = vgui.Create( "DLabel", MainPanel );
- Label8:SetText("Starting myPC v0.4 FAILED!");
- Label8:SetPos( 25, 50 );
- end
- end
- timer.Simple( 6, StartLoadingOS );
- end
- concommand.Add( "myPC_start", myBIOSMain );
- function myBIOSLoadingOS()
- local MyBIOSLoadingImg = vgui.Create( "DPanel", MainPanel );
- MyBIOSLoadingImg:SetPos( 0, 20 );
- MyBIOSLoadingImg:SetSize( 800, 600 );
- MyBIOSLoadingImg.Paint = function()
- surface.SetDrawColor( 60, 60, 60, 255 );
- surface.DrawRect( 0, 0, MyBIOSLoadingImg:GetWide(), MyBIOSLoadingImg:GetTall() );
- end
- LoadingLabel = vgui.Create( "DLabel", MainPanel );
- LoadingLabel:SetText("loading...");
- LoadingLabel:SetPos( 25, 50 );
- myPCMainImg = vgui.Create( "DImageButton", MainPanel );
- myPCMainImg:SetPos( 25, 50 );
- myPCMainImg:SetSize( 50, 50 );
- myPCMainImg:SetImage( "Brick/brickfloor001a.vtf" );
- --------------------------------------------
- timer.Simple( 1, (LoadingKernel = vgui.Create( "DLabel", MainPanel );
- LoadingKernel:SetText("Loading 'Kernel' ...");
- LoadingKernel:SetPos( 25, 50 );
- ));
- timer.Simple( 1.5, (LoadingKernelSuccess = vgui.Create( "DLabel", MainPanel );
- LoadingKernelSuccess:SetText(" done!");
- LoadingKernelSuccess:SetPos( 25, 50 );
- ));
- --------------------------------------------
- timer.Simple( 2, (LoadingPrograms = vgui.Create( "DLabel", MainPanel );
- LoadingPrograms:SetText("Loading 'Programs' ...");
- LoadingPrograms:SetPos( 25, 50 );
- ));
- timer.Simple( 2.5, (LoadingProgramsSuccess = vgui.Create( "DLabel", MainPanel );
- LoadingProgramsSuccess:SetText(" done!");
- LoadingProgramsSuccess:SetPos( 25, 50 );
- ));
- --------------------------------------------
- timer.Simple( 3, (LoadingThemes = vgui.Create( "DLabel", MainPanel );
- LoadingThemes:SetText("Loading 'Themes' ...");
- LoadingThemes:SetPos( 25, 50 );
- ));
- timer.Simple( 3.5, (LoadingThemesSuccess = vgui.Create( "DLabel", MainPanel )
- LoadingThemesSuccess:SetText(" done!")
- LoadingThemesSuccess:SetPos( 25, 50 )
- ));
- --------------------------------------------
- timer.Simple( 4, (LoadingInterface = vgui.Create( "DLabel", MainPanel );
- LoadingInterface:SetText("Loading 'Interface' ...");
- LoadingInterface:SetPos( 25, 50 );
- ));
- timer.Simple( 4.5, (LoadingInterfaceSuccess = vgui.Create( "DLabel", MainPanel );
- LoadingInterfaceSuccess:SetText(" done!");
- LoadingInterfaceSuccess:SetPos( 25, 50 );
- ));
- --------------------------------------------
- timer.Simple( 5.3, SetConVar("myPC_successload","1") );
- timer.Simple( 5.4, SetConVar("myPC_loadingos","1") );
- --------------------------------------------
- function StartOurOS()
- if GetConVarNumber("myPC_loadingos") == 1 and GetConVarNumber("myPC_successload") == 1 then
- LoadingLabel:Remove;
- myPCMainImg:Remove;
- --------------------------------------------
- LoadingKernel:Remove;
- LoadingKernelSuccess:Remove;
- --------------------------------------------
- LoadingPrograms:Remove;
- LoadingProgramsSuccess:Remove;
- --------------------------------------------
- LoadingThemes:Remove;
- LoadingThemesSuccess:Remove;
- --------------------------------------------
- LoadingInterface:Remove;
- LoadingInterfaceSuccess:Remove;
- myOSWelcome();
- else
- OSStartFailed = vgui.Create( "DLabel", MainPanel );
- Label8:SetText("Starting myPC v0.4 FAILED!");
- Label8:SetPos( 25, 50 );
- end
- end
- timer.Simple( 5.5, StartOurOS );
- end
- function myOS-Welcome()
- //Coming soon...
- myOS-Main();
- end
- function myOSMain()
- //myPC Desktop
- local myOSDesktop = vgui.Create( "DPanel", MainPanel );
- myOSDesktop:SetPos( 0, 20 );
- myOSDesktop:SetSize( 800, 600 );
- myOSDesktop.Paint = function()
- surface.SetDrawColor( 60, 60, 60, 255 );
- surface.DrawRect( 0, 0, myOSDesktop:GetWide(), myOSDesktop:GetTall() );
- end
- //myPC Taskbar
- local myOSTaskbar = vgui.Create( "DPanel", myOSDesktop );
- myOSTaskbar:SetPos( 0, 0 );
- myOSTaskbar:SetSize( 800, 20 );
- myOSTaskbar.Paint = function()
- surface.SetDrawColor( 50, 50, 50, 239 );
- surface.DrawRect( 0, 0, myOSTaskbar:GetWide(), myOSTaskbar:GetTall() );
- end
- ---------------------------------------------------------------------------------------------------------
- local MenuItemSelected = function()
- Derma_Message( "Opening an Item will be added later. Now use Terminal!" );
- end
- ---------------------------------------------------------------------------------------------------------
- //Start button
- local StartButton = vgui.Create( "DButton" );
- StartButton:SetParent( myOSTaskbar );
- StartButton:SetText( "Start >" );
- StartButton:SetPos( 0, 0 );
- StartButton:SetSize( 50, 20 );
- StartButton.DoClick = function ( btn )
- local StartButtonMenu = DermaMenu();
- local StartButtonSubMenu = menu:AddSubMenu( "Programs" );
- StartButtonSubMenu:AddOption( "GNotepad", MenuItemSelected );
- StartButtonSubMenu:AddOption( "GMediaPlayer", MenuItemSelected );
- StartButtonSubMenu:AddOption( "MuseX", MenuItemSelected );
- StartButtonSubMenu:AddOption( "Terminal", MenuItemSelected );
- StartButtonMenu:AddOption("Control Panel", MenuItemSelected );
- StartButtonMenu:AddOption("Turn Off", myOSShutDown );
- StartButtonMenu:Open( 0, 20 );
- end
- ------------------------------
- //Clock func
- T_HOURS = 12;
- T_MINUTES = 44;
- function RefreshClockHours()
- timer.Simple( 3600, T_HOURS = T_HOURS + 1 );
- if T_HOURS == 24 then T_HOURS = 0 end;
- end
- function RefreshClockMinutes()
- timer.Simple( 60, T_MINUTES = T_MINUTES + 1 );
- if T_MINUTES == 60 then T_MINUTES = 0 end;
- end
- function RefreshClock()
- RefreshClockHours();
- RefreshClockMinutes();
- end
- RefreshClock();
- ------------------------------
- //Clock
- TaskbarClock = vgui.Create( "DLabel", MainPanel );
- Label8:SetText( "" ..T_HOURS.. ":" ..T_MINUTES.. "" ); //When this doesn't work, then I will use the "tostring" function!!!
- Label8:SetPos( 25, 50 );
- /*--------------------------------------
- BELOW: ServerManager
- --------------------------------------*/
- local ServerManagerTask = vgui.Create("DCollapsibleCategory", myOSTaskbar );
- ServerManagerTask:SetPos( 25,50 );
- ServerManagerTask:SetSize( 200, 50 ;
- ServerManagerTask:SetExpanded( 0 );
- ServerManagerTask:SetLabel( "ServerManager(C)" );
- ServerManagerList = vgui.Create( "DPanelList" );
- ServerManagerList:SetAutoSize( true );
- ServerManagerList:SetSpacing( 5 );
- ServerManagerList:EnableHorizontal( false );
- ServerManagerList:EnableVerticalScrollbar( true );
- ServerManagerTask:SetContents( ServerManagerList );
- local CategoryContentOne = vgui.Create( "DCheckBoxLabel" );
- CategoryContentOne:SetText( "God Mode" );
- CategoryContentOne:SetConVar( "sbox_godmode" );
- CategoryContentOne:SetValue( 1 );
- CategoryContentOne:SizeToContents();
- ServerManagerList:AddItem( CategoryContentOne );
- local CategoryContentTwo = vgui.Create( "DCheckBoxLabel" );
- CategoryContentTwo:SetText( "Player Damage" );
- CategoryContentTwo:SetConVar( "sbox_plpldamage" );
- CategoryContentTwo:SetValue( 1 );
- CategoryContentTwo:SizeToContents();
- ServerManagerList:AddItem( CategoryContentTwo );
- local CategoryContentThree = vgui.Create( "DCheckBoxLabel" );
- CategoryContentThree:SetText( "Fall Damage" );
- CategoryContentThree:SetConVar( "mp_falldamage" );
- CategoryContentThree:SetValue( 1 );
- CategoryContentThree:SizeToContents();
- ServerManagerList:AddItem( CategoryContentThree );
- local CategoryContentFour = vgui.Create( "DCheckBoxLabel" );
- CategoryContentFour:SetText( "Noclip" );
- CategoryContentFour:SetConVar( "sbox_noclip" );
- CategoryContentFour:SetValue( 1 );
- CategoryContentFour:SizeToContents();
- ServerManagerList:AddItem( CategoryContentFour );
- local CategoryContentFive = vgui.Create( "DCheckBoxLabel" );
- CategoryContentFive:SetText( "All Talk" );
- CategoryContentFive:SetConVar( "sv_alltalk" );
- CategoryContentFive:SetValue( 1 );
- CategoryContentFive:SizeToContents();
- ServerManagerList:AddItem( CategoryContentFive );
- local CategoryContentSix = vgui.Create( "DNumSlider" );
- CategoryContentSix:SetSize( 150, 50 );
- CategoryContentSix:SetText( "Max Props" );
- CategoryContentSix:SetMin( 0 );
- CategoryContentSix:SetMax( 99999 );
- CategoryContentSix:SetDecimals( 0 );
- CategoryContentSix:SetConVar( "sbox_maxprops" );
- ServerManagerList:AddItem( CategoryContentSix );
- local CategoryContentSeven = vgui.Create( "DSysButton" );
- CategoryContentSeven:SetType( "close" );
- CategoryContentSeven.DoClick = function();
- Derma_Message("ERROR: Cannot close that! -Wolfie!");
- error("LOL:using .DoClick, reports nil -Wolfie!");
- //This is one of the FUN-Part. It will get an Error-Message when he presses the "X" button. lol
- end
- ServerManagerList:AddItem( CategoryContentSeven );
- //The "Turn Off" func! :D
- function myOSShutDown()
- //myOSDesktop:Remove
- myOSDesktop.Paint = function()
- surface.SetDrawColor( 50, 50, 50, 255 );
- surface.DrawRect( 0, 0, myOSDesktop:GetWide(), myOSDesktop:GetTall() );
- end
- myOSTaskbar:Remove;
- StartButton:Remove;
- TaskbarClock:Remove;
- ServerManagerTask:Remove;
- //MainPanel:Remove;
- //"//"'ed them because the User should turn it off himself!
- TheEndMessage = vgui.Create( "DLabel", myOSDesktop );
- Label8:SetText( "This is 'The End'.\n\nYou can turn your PC off now." );
- Label8:SetPos( 10, 10 );
- end
- end
- function myOSMenuSecurityCenter()
- //Coming soon...
- end
- //This is only for debugging and developing!!!
- if GetConVarNumber("myPC_Debug") == 1 or GetConVarNumber("myPC_Development") == 1 then
- concommand.Add( "myPC_DEBUG_MainPanel", MainPanel );
- concommand.Add( "myPC_DEBUG_StartLoadingOS", myBIOS-LoadingOS );
- concommand.Add( "myPC_DEBUG_StartWelcome", myOS-Welcome );
- concommand.Add( "myPC_DEBUG_StartOS", myOS-Main );
- concommand.Add( "myPC_DEBUG_StartSecCenter", myOS-Menu-SecurityCenter );
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement