Пример #1
0
 static void commands_ConnectedClientLoadedProjectAnswerReceived(commands.connectedClientWithProjectLoaded data)
 {
     if (data.gameName == settings.GameProject.GameName && data.projectName == settings.GameProject.ProjectName)
     {
         Console.WriteLine("Project " + settings.GameProject.ProjectName + " is loaded on device: " + data.deviceName + " with ID hash: " + data.IDHash + ".");
     }
 }
Пример #2
0
        static void commands_ConnectedClientLoadedProjectAnswerReceived(commands.connectedClientWithProjectLoaded data)
        {
            if (data.gameName == gameName && data.projectName == projectName)
            {
                Console.WriteLine("Project " + projectName + " is loaded on device: " + data.deviceName + " with ID hash: " + data.IDHash + ".");
                Console.WriteLine("setting inventory parameters now!");

                List <commands.inventoryTextureData> blocks = new List <commands.inventoryTextureData>();
                string   path        = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar + "inventorySprites"; // Be careful to get the correct directory: it may not work if you are using a plug in
                string[] spriteFiles = Directory.GetFiles(path, "*.png", SearchOption.TopDirectoryOnly);
                foreach (string file in spriteFiles)
                {
                    commands.inventoryTextureData block = new commands.inventoryTextureData();
                    block.data = File.ReadAllBytes(file);
                    block.name = Path.GetFileNameWithoutExtension(file);
                    blocks.Add(block);
                }

                commands.sendAppendSpritesForInventory(InventoryName, blocks);
                commands.sendInventorySizeParameters(InventoryName, 64, 64, 24, true);

                commands.sendResetInventoryItems(InventoryName);

                commands.itemOrderData IOD = new commands.itemOrderData();
                IOD.EMTag                     = "InventoryItem1Use";
                IOD.quantity                  = 1;
                IOD.spriteColor               = commands.Color.white;
                IOD.spriteName                = "1";
                IOD.displayQuantity           = commands.itemQuantityDisplay.NORMAL;
                IOD.displayQuantitySize       = commands.itemQuantityDisplaySize.MEDIUM;
                IOD.displayQuantityColor      = commands.Color.green;
                IOD.displayQuantityColorZero  = commands.Color.red;
                IOD.displayQuantityHorizontal = commands.itemQuantityDisplayPositionHorizontal.RIGHT;
                IOD.displayQuantityVertical   = commands.itemQuantityDisplayPositionVertical.BOTTOM;
                IOD.displayPaddingLeftRight   = 2;
                IOD.tabFilters                = new List <string> {
                    "InventoryTab2"
                };
                commands.sendAppendInventoryItem(InventoryName, IOD);

                IOD                           = new commands.itemOrderData();
                IOD.EMTag                     = "InventoryItem2Use";
                IOD.quantity                  = 2;
                IOD.spriteColor               = commands.Color.white;
                IOD.spriteName                = "2";
                IOD.displayQuantity           = commands.itemQuantityDisplay.NORMAL;
                IOD.displayQuantitySize       = commands.itemQuantityDisplaySize.MEDIUM;
                IOD.displayQuantityColor      = commands.Color.green;
                IOD.displayQuantityColorZero  = commands.Color.red;
                IOD.displayQuantityHorizontal = commands.itemQuantityDisplayPositionHorizontal.RIGHT;
                IOD.displayQuantityVertical   = commands.itemQuantityDisplayPositionVertical.BOTTOM;
                IOD.displayPaddingLeftRight   = 2;
                IOD.tabFilters                = new List <string> {
                    "InventoryTab2"
                };
                commands.sendAppendInventoryItem(InventoryName, IOD);

                IOD                           = new commands.itemOrderData();
                IOD.EMTag                     = "InventoryItem3Use";
                IOD.quantity                  = 3;
                IOD.quantityMaxValue          = 10;
                IOD.spriteColor               = commands.Color.white;
                IOD.spriteName                = "3";
                IOD.displayQuantity           = commands.itemQuantityDisplay.FRACTION;
                IOD.displayQuantitySize       = commands.itemQuantityDisplaySize.MEDIUM;
                IOD.displayQuantityColor      = commands.Color.green;
                IOD.displayQuantityColorZero  = commands.Color.red;
                IOD.displayQuantityHorizontal = commands.itemQuantityDisplayPositionHorizontal.RIGHT;
                IOD.displayQuantityVertical   = commands.itemQuantityDisplayPositionVertical.BOTTOM;
                IOD.displayPaddingLeftRight   = 2;
                IOD.tabFilters                = new List <string> {
                    "InventoryTab2"
                };
                commands.sendAppendInventoryItem(InventoryName, IOD);

                IOD                              = new commands.itemOrderData();
                IOD.EMTag                        = "InventoryItem4Use";
                IOD.quantity                     = 4;
                IOD.quantityMaxValue             = 10;
                IOD.spriteColor                  = commands.Color.white;
                IOD.spriteName                   = "4";
                IOD.displayQuantity              = commands.itemQuantityDisplay.SLIDER;
                IOD.displayQuantitySize          = commands.itemQuantityDisplaySize.MEDIUM;
                IOD.displayQuantityColor         = commands.Color.green;
                IOD.displayQuantityColorZero     = commands.Color.red;
                IOD.displayQuantityHorizontal    = commands.itemQuantityDisplayPositionHorizontal.RIGHT;
                IOD.displayQuantityVertical      = commands.itemQuantityDisplayPositionVertical.BOTTOM;
                IOD.displaySliderBackgroundColor = commands.Color.gray;
                IOD.displaySliderColor           = commands.Color.blue;
                IOD.tabFilters                   = new List <string> {
                    "InventoryTab3"
                };
                commands.sendAppendInventoryItem(InventoryName, IOD);

                IOD                              = new commands.itemOrderData();
                IOD.EMTag                        = "InventoryItem5Use";
                IOD.quantity                     = 5;
                IOD.quantityMaxValue             = 10;
                IOD.spriteColor                  = commands.Color.white;
                IOD.spriteName                   = "5";
                IOD.displayQuantity              = commands.itemQuantityDisplay.SLIDER;
                IOD.displayQuantitySize          = commands.itemQuantityDisplaySize.MEDIUM;
                IOD.displayQuantityColor         = commands.Color.green;
                IOD.displayQuantityColorZero     = commands.Color.red;
                IOD.displayQuantityHorizontal    = commands.itemQuantityDisplayPositionHorizontal.RIGHT;
                IOD.displayQuantityVertical      = commands.itemQuantityDisplayPositionVertical.CENTER;
                IOD.displaySliderBackgroundColor = commands.Color.gray;
                IOD.displaySliderColor           = commands.Color.blue;
                IOD.tabFilters                   = new List <string> {
                    "InventoryTab3"
                };
                commands.sendAppendInventoryItem(InventoryName, IOD);

                IOD                              = new commands.itemOrderData();
                IOD.EMTag                        = "InventoryItem6Use";
                IOD.quantity                     = 6;
                IOD.quantityMaxValue             = 10;
                IOD.spriteColor                  = commands.Color.white;
                IOD.spriteName                   = "6";
                IOD.displayQuantity              = commands.itemQuantityDisplay.SLIDER;
                IOD.displayQuantitySize          = commands.itemQuantityDisplaySize.MEDIUM;
                IOD.displayQuantityColor         = commands.Color.green;
                IOD.displayQuantityColorZero     = commands.Color.red;
                IOD.displayQuantityHorizontal    = commands.itemQuantityDisplayPositionHorizontal.RIGHT;
                IOD.displayQuantityVertical      = commands.itemQuantityDisplayPositionVertical.TOP;
                IOD.displaySliderBackgroundColor = commands.Color.gray;
                IOD.displaySliderColor           = commands.Color.blue;
                IOD.tabFilters                   = new List <string> {
                    "InventoryTab3"
                };
                commands.sendAppendInventoryItem(InventoryName, IOD);

                commands.sendResetInventoryTab(InventoryName);
                commands.sendAddInventoryTab(InventoryName, "InventoryTab1", "NULL", "NULL", commands.Color.white, commands.Color.gray, "Tab 1", true);
                commands.sendAddInventoryTab(InventoryName, "InventoryTab2", "NULL", "NULL", commands.Color.white, commands.Color.gray, "Tab 2", false);
                commands.sendAddInventoryTab(InventoryName, "InventoryTab3", "NULL", "NULL", commands.Color.white, commands.Color.gray, "Tab 3", false);
            }
        }