Snippets

Greek2me Dedicated Server GUI

Created by Greek2me last modified
//--- OBJECT WRITE BEGIN ---
new GuiControl(DedicatedServerGUI) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";

   new GuiSwatchCtrl() {
      profile = "GuiDefaultProfile";
      horizSizing = "width";
      vertSizing = "height";
      position = "0 0";
      extent = "640 480";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      color = "200 200 200 255";

      new GuiScrollCtrl() {
         profile = "GuiScrollProfile";
         horizSizing = "width";
         vertSizing = "height";
         position = "200 10";
         extent = "430 430";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         willFirstRespond = "0";
         hScrollBar = "dynamic";
         vScrollBar = "alwaysOn";
         constantThumbHeight = "0";
         childMargin = "0 0";
         rowHeight = "40";
         columnWidth = "30";

         new GuiConsole() {
            profile = "GuiConsoleProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "1 -7551";
            extent = "986 8172";
            minExtent = "8 2";
            enabled = "1";
            visible = "1";
            clipToParent = "1";
         };
      };
      new GuiConsoleEditCtrl(ConsoleEntry) {
         profile = "GuiTextEditProfile";
         horizSizing = "width";
         vertSizing = "top";
         position = "200 452";
         extent = "430 18";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         altCommand = "ConsoleEntry::eval();";
         maxLength = "255";
         historySize = "20";
         password = "0";
         tabComplete = "0";
         sinkAllKeyEvents = "1";
         useSiblingScroller = "1";
      };
      new GuiScrollCtrl() {
         profile = "GuiScrollProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "10 10";
         extent = "180 200";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         willFirstRespond = "0";
         hScrollBar = "alwaysOff";
         vScrollBar = "dynamic";
         constantThumbHeight = "0";
         childMargin = "0 0";
         rowHeight = "40";
         columnWidth = "30";

         new GuiTextListCtrl(DedicatedServerGUI_PlayerList) {
            profile = "GuiTextListProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            position = "1 1";
            extent = "178 2";
            minExtent = "8 2";
            enabled = "1";
            visible = "1";
            clipToParent = "1";
            enumerate = "0";
            resizeCell = "1";
            columns = "0";
            fitParentWidth = "1";
            clipColumnText = "0";
         };
      };
   };
};
//--- OBJECT WRITE END ---
// TO USE: Execute this file from "config/main.cs". Recommend using Support_PreLoad

// setLogMode(1);
// package DediCanvasCursor
// {
	// function GuiCanvas::setContent(%this,%obj)
	// {
		// %obj.onWake();
		// %this.checkCursor();
	// }
	
	// function GuiCanvas::checkCursor(%this)
	// {
		// %this.setCursor(DefaultCursor);
	// }
// };
// activatePackage(DediCanvasCursor);


error("BEGIN");
trace(1);
// exec("base/client/init.cs"); //THESE SEEM TO BE UNNEEDED
// initBaseClient();
// exec("base/client/audio.cs");
// exec("base/client/defaults.cs");
// exec("base/client/canvas.cs");
initCanvas("Blockland Dedicated Server");
setScreenMode(640,480,32,0,60);
exec("base/client/message.cs"); //THIS IS TO PREVENT CONSOLE SPAM WHEN EXECUTING allClientScripts.cs
exec("base/client/scripts/allClientScripts.cs"); //COMMENT THIS OUT IF YOU WANT YOUR GAME TO CRASH
//exec("base/client/ui/allClientGuis.gui"); //UNCOMMENT THIS TO ENABLE DEFAULT GUIs
// echo("loading profiles");
// exec("base/profiles.cs");
canvas.setCursor(DefaultCursor);
echo("loading GUI");
exec("base/DedicatedServerGUI.gui"); //EXEC MY TEST GUI
echo("setting content");
canvas.setContent(DedicatedServerGUI);
//trace(0);
echo("DEDI GUI READY");

//FYI - the canvas uses the client config from "config/client/prefs.cs"
//it would be nice to bypass this and set up a 640x480 window, but I don't have time

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.