예제 #1
0
 private void button20_Click(object sender, EventArgs e)
 {
     HeightBox.Clear();
     LengthBox.Clear();
     WidthBox.Clear();
     AreaBox.Clear();
     PermiterBox.Clear();
     VolumeBox.Clear();
 }
예제 #2
0
    void SetupMegaBoxes()
    {
        mainContainer.AddChild(newPlayerBox = new NewPlayerBox());
        newPlayerBox.SetToCell(CellManager.megaNewPlayer);
        megaBoxes.Add(newPlayerBox);

        mainContainer.AddChild(resetBox = new ResetBox());
        resetBox.SetToCell(CellManager.megaReset);
        megaBoxes.Add(resetBox);

        mainContainer.AddChild(sortBox = new SortBox());
        sortBox.SetToCell(CellManager.megaSort);
        megaBoxes.Add(sortBox);

        mainContainer.AddChild(volumeBox = new VolumeBox());
        volumeBox.SetToCell(CellManager.megaVolume);
        megaBoxes.Add(volumeBox);

        newPlayerBox.SignalPress += HandleNewPlayerTap;
        resetBox.SignalPress     += HandleResetTap;
        sortBox.SignalPress      += HandleSortTap;
        volumeBox.SignalPress    += HandleVolumeTap;
    }
        /// <summary>
        ///     Updates the entry displaying the current and maximum volume of the selected solution.
        /// </summary>
        /// <param name="solution">The selected solution.</param>
        private void UpdateVolumeBox(Solution solution)
        {
            VolumeBox.DisposeAllChildren();

            var volumeLabel = new Label();

            volumeLabel.HorizontalExpand = true;
            volumeLabel.Margin           = new Thickness(0, 4);
            volumeLabel.Text             = Loc.GetString("admin-solutions-window-volume-label",
                                                         ("currentVolume", solution.CurrentVolume),
                                                         ("maxVolume", solution.MaxVolume));

            var capacityBox = new BoxContainer();

            capacityBox.Orientation      = BoxContainer.LayoutOrientation.Horizontal;
            capacityBox.HorizontalExpand = true;
            capacityBox.Margin           = new Thickness(0, 4);

            var capacityLabel = new Label();

            capacityLabel.HorizontalExpand = true;
            capacityLabel.Margin           = new Thickness(0, 1);
            capacityLabel.Text             = Loc.GetString("admin-solutions-window-capacity-label");

            var capacitySpin = new FloatSpinBox(1, 2);

            capacitySpin.HorizontalExpand = true;
            capacitySpin.Margin           = new Thickness(0, 1);
            capacitySpin.Value            = (float)solution.MaxVolume;
            capacitySpin.OnValueChanged  += SetCapacity;

            capacityBox.AddChild(capacityLabel);
            capacityBox.AddChild(capacitySpin);

            VolumeBox.AddChild(volumeLabel);
            VolumeBox.AddChild(capacityBox);
        }
예제 #4
0
        public bool Load(Stream s)
        {
            BinaryReader br = new BinaryReader(s);

            string header = ((char)br.ReadByte()).ToString() + ((char)br.ReadByte()) + ((char)br.ReadByte()) + ((char)br.ReadByte());

            if (header != "GRSM")
                return false;

            majorVersion = br.ReadByte();
            minorVersion = br.ReadByte();

            if (!(majorVersion == 1 && (minorVersion >= 1 && minorVersion <= 5)))
                return false;

            animLen = br.ReadInt32();
            shadeType = br.ReadInt32();

            if (majorVersion >= 1 && minorVersion >= 4)
            {
                alpha = br.ReadByte();
            }
            else
            {
                alpha = 255;
            }

            br.ReadBytes(16);

            int textureCount = br.ReadInt32();
            textures = new Texture[textureCount];

            for (int i = 0; i < textureCount; i++)
            {
                Texture tex = new Texture();

                tex.Name = br.ReadCString(40);

                textures[i] = tex;
            }

            mainNode = br.ReadCString(40).Korean();

            int nodeCount = br.ReadInt32();
            nodes = new Node[nodeCount];

            for (int i = 0; i < nodeCount; i++)
            {
                Node n = new Node();

                if (!n.Load(br, majorVersion, minorVersion, i == 0))
                    return false;

                nodes[i] = n;
            }

            if (FindNode(mainNode) == null)
                return false;

            if (nodes.Length == 1)
                nodes[0].IsOnly = true;

            if (majorVersion < 1 || minorVersion < 5)
            {
                Node mNode = FindNode(mainNode);

                int frameCount = br.ReadInt32();
                mNode.PosKeyFrames = new PosKeyFrame[frameCount];

                for (int i = 0; i < frameCount; i++)
                {
                    PosKeyFrame pfk = new PosKeyFrame();

                    pfk.Read(br);

                    mNode.PosKeyFrames[i] = pfk;
                }
            }

            int volumeCount = br.ReadInt32();
            volumeBoxes = new VolumeBox[volumeCount];

            for (int i = 0; i < volumeCount; i++)
            {
                VolumeBox vb = new VolumeBox();

                vb.Read(br, majorVersion, minorVersion);

                volumeBoxes[i] = vb;
            }

            CalcBoundingBox();

            return true;
        }
예제 #5
0
        public bool Load(Stream s)
        {
            BinaryReader br = new BinaryReader(s);

            string header = ((char)br.ReadByte()).ToString() + ((char)br.ReadByte()) + ((char)br.ReadByte()) + ((char)br.ReadByte());

            if (header != "GRSM")
            {
                return(false);
            }

            majorVersion = br.ReadByte();
            minorVersion = br.ReadByte();

            if (!(majorVersion == 1 && (minorVersion >= 1 && minorVersion <= 5)))
            {
                return(false);
            }

            animLen   = br.ReadInt32();
            shadeType = br.ReadInt32();

            if (majorVersion >= 1 && minorVersion >= 4)
            {
                alpha = br.ReadByte();
            }
            else
            {
                alpha = 255;
            }

            br.ReadBytes(16);

            int textureCount = br.ReadInt32();

            textures = new Texture[textureCount];

            for (int i = 0; i < textureCount; i++)
            {
                Texture tex = new Texture();

                tex.Name = br.ReadCString(40);

                textures[i] = tex;
            }

            mainNode = br.ReadCString(40).Korean();

            int nodeCount = br.ReadInt32();

            nodes = new Node[nodeCount];

            for (int i = 0; i < nodeCount; i++)
            {
                Node n = new Node();

                if (!n.Load(br, majorVersion, minorVersion, i == 0))
                {
                    return(false);
                }

                nodes[i] = n;
            }

            if (FindNode(mainNode) == null)
            {
                return(false);
            }

            if (nodes.Length == 1)
            {
                nodes[0].IsOnly = true;
            }

            if (majorVersion < 1 || minorVersion < 5)
            {
                Node mNode = FindNode(mainNode);

                int frameCount = br.ReadInt32();
                mNode.PosKeyFrames = new PosKeyFrame[frameCount];

                for (int i = 0; i < frameCount; i++)
                {
                    PosKeyFrame pfk = new PosKeyFrame();

                    pfk.Read(br);

                    mNode.PosKeyFrames[i] = pfk;
                }
            }

            int volumeCount = br.ReadInt32();

            volumeBoxes = new VolumeBox[volumeCount];

            for (int i = 0; i < volumeCount; i++)
            {
                VolumeBox vb = new VolumeBox();

                vb.Read(br, majorVersion, minorVersion);

                volumeBoxes[i] = vb;
            }

            CalcBoundingBox();

            return(true);
        }
예제 #6
0
    void SetupMegaBoxes()
    {
        mainContainer.AddChild(newPlayerBox = new NewPlayerBox());
        newPlayerBox.SetToCell(CellManager.megaNewPlayer);
        megaBoxes.Add(newPlayerBox);

        mainContainer.AddChild(resetBox = new ResetBox());
        resetBox.SetToCell(CellManager.megaReset);
        megaBoxes.Add(resetBox);

        mainContainer.AddChild(sortBox = new SortBox());
        sortBox.SetToCell(CellManager.megaSort);
        megaBoxes.Add(sortBox);

        mainContainer.AddChild(volumeBox = new VolumeBox());
        volumeBox.SetToCell(CellManager.megaVolume);
        megaBoxes.Add(volumeBox);

        newPlayerBox.SignalPress += HandleNewPlayerTap;
        resetBox.SignalPress += HandleResetTap;
        sortBox.SignalPress += HandleSortTap;
        volumeBox.SignalPress += HandleVolumeTap;
    }