Exemplo n.º 1
0
 void DrawBlock()
 {
     help = "B:X, where X - level of block.";
     for (int x = 0; x < profile.width; x++)
     {
         for (int y = 0; y < profile.height; y++)
         {
             if (DrawSlotButton(x, y, rect, profile))
             {
                 profile.SetBlock(x, y, profile.GetBlock(x, y) + 1);
                 if (profile.GetBlock(x, y) > 3)
                 {
                     profile.SetBlock(x, y, 0);
                 }
             }
         }
     }
     DrawWallPreview(rect, profile);
 }
    void DrawBlock()
    {
        for (int x = 0; x < profile.width; x++)
        {
            for (int y = 0; y < profile.height; y++)
            {
                if (DrawSlotButton(x, y, rect, profile))
                {
                    switch (toolID)
                    {
                    case "Simple Block":
                        profile.SetBlock(x, y, profile.GetBlock(x, y) + 1);
                        if (profile.GetBlock(x, y) > 3)
                        {
                            profile.SetBlock(x, y, 0);
                        }
                        break;

                    case "Weed":
                        if (profile.GetBlock(x, y) != 4)
                        {
                            profile.SetBlock(x, y, 4);
                        }
                        else
                        {
                            profile.SetBlock(x, y, 0);
                        }
                        break;

                    case "Branch":
                        if (profile.GetBlock(x, y) != 5)
                        {
                            profile.SetBlock(x, y, 5);
                        }
                        else
                        {
                            profile.SetBlock(x, y, 0);
                        }
                        break;
                    }
                }
            }
        }
        DrawWallPreview(rect, profile);
    }