Exemplo n.º 1
0
        public void Configurar()
        {
            gui.InitDialog(false, false);
            profiling = true;
            int      W     = GuiController.Instance.Panel3d.Width;
            int      H     = GuiController.Instance.Panel3d.Height;
            int      x0    = 50;
            int      y0    = 50;
            int      dy    = H - 100;
            int      dx    = W - 100;
            gui_item frame = gui.InsertIFrame("Profiling", x0, y0, dx, dy, Color.FromArgb(140, 240, 140));

            frame.c_font = Color.FromArgb(0, 0, 0);
            gui.InsertButton(IDOK, "OK", x0 + dx - 300, y0 + dy - 60, 120, 60);
            gui.InsertButton(IDCANCEL, "Salir", x0 + dx - 140, y0 + dy - 60, 120, 60);
            gui.InsertItem("Configure el color", x0 + 50, y0 + 130);


            int cdx   = 50;
            int pos_x = x0 + 100;
            int pos_y = y0 + 220;
            int s     = 0;

            for (int i = 0; i < cant_colores; ++i)
            {
                gui_item item = gui.InsertItemColor(pos_x, pos_y, lst_colores[i], 1000 + i);
                if ((i + 1) % 4 == 0)
                {
                    if (s % 2 == 1)
                    {
                        pos_x = x0 + 100;
                    }
                    else
                    {
                        pos_x = x0 + 100 - 38;
                    }
                    pos_y += cdx / 2;
                    s++;
                }
                else
                {
                    pos_x += cdx + cdx / 2;
                }

                // uso el texto para meter el dato del nro de color
                item.text = "" + i;
            }
        }
Exemplo n.º 2
0
        private void DrawIFrame()
        {
            int W = D3DDevice.Instance.Width;
            int H = D3DDevice.Instance.Height;

            int dy  = H - 50;
            int dy2 = dy;
            int dx  = W / 2;

            int posEnX = (W / 2) - (dx / 2);
            int posEnY = (H / 2) - (dy / 2);
            int x0     = posEnX + 150;
            int y0     = posEnY + 100;
            int x1     = x0;
            int y1     = y0;

            GUIItem frame = gui.InsertIFrame("", posEnX, posEnY, dx, dy, Color.FromArgb(96, 78, 130));

            frame.c_font      = Color.FromArgb(0, 0, 0);
            frame.scrolleable = true;
        }
Exemplo n.º 3
0
        public void ShowInventory()
        {
            bool itemAdded = false;

            active = !active;

            if (active)
            {
                bool    hammerAdded = false;
                int     cantWood = 0, cantRope = 0;
                GUIItem woodGUIText = new GUIItem();
                GUIItem ropeGUIText = new GUIItem();

                int W = D3DDevice.Instance.Width;
                int H = D3DDevice.Instance.Height;

                int dy  = H - 50;
                int dy2 = dy;
                int dx  = W / 2;

                int posEnX = (W / 2) - (dx / 2);
                int posEnY = (H / 2) - (dy / 2);
                int x0     = posEnX + 150;
                int y0     = posEnY + 50;
                int x1     = x0;
                int y1     = y0;

                GUIItem frame = gui.InsertIFrame("", posEnX, posEnY, dx, dy, Color.FromArgb(92, 43, 43));
                frame.c_font      = Color.FromArgb(0, 0, 0);
                frame.scrolleable = true;

                collectedItems.ForEach(item =>
                {
                    GUIItem itemGui = new GUIItem();

                    if (item.Mesh.Name.Contains("wood"))
                    {
                        if (cantWood == 0)
                        {
                            itemAdded   = true;
                            itemGui     = gui.InsertImage("wood2.png", x1, y1 + 30, MediaDir);
                            woodGUIText = gui.InsertItem("Madera " + "(x" + ++cantWood + ")", x1 += 50, y1 + 20);
                        }
                        else
                        {
                            woodGUIText.text = "Madera " + "(x" + ++cantWood + ")";
                        }
                    }
                    else if (item.Mesh.Name.Contains("hammer") && !hammerAdded)
                    {
                        hammerAdded = true;
                        itemAdded   = true;
                        itemGui     = gui.InsertImage("hammer2.png", x1, y1 + 30, MediaDir);
                        gui.InsertItem("Martillo", x1 += 50, y1 + 20);
                    }
                    else if (item.Mesh.Name.Contains("rope"))
                    {
                        if (cantRope == 0)
                        {
                            itemAdded   = true;
                            itemGui     = gui.InsertImage("rope.png", x1, y1 + 30, MediaDir);
                            ropeGUIText = gui.InsertItem("Soga " + "(x" + ++cantRope + ")", x1 += 50, y1 + 20);
                        }
                        else
                        {
                            ropeGUIText.text = "Soga " + "(x" + ++cantRope + ")";
                        }
                    }
                    else if (item.Mesh.Name.Contains("fatherNote"))
                    {
                        itemAdded = true;
                        itemGui   = gui.InsertImage("note.png", x1, y1 + 30, MediaDir);
                        gui.InsertItem("Nota de papá", x1 += 50, y1 + 20);
                        gui.InsertButton(1, "Usar", x1    += 300, y1, 120, 60);
                    }

                    if (itemAdded)
                    {
                        x1        = x0;
                        y1        = y1 + 100;
                        itemAdded = false;
                    }
                });

                if (ShowShipHelm)
                {
                    GUIItem itemGui = new GUIItem();

                    itemAdded = true;
                    itemGui   = gui.InsertImage("timon.jpg", x1, y1 + 30, MediaDir);
                    gui.InsertItem("Timon", x1 += 50, y1 + 20);
                    gui.InsertItem("Se puede usar en la proa del barco", x1, y1 + 70);
                    gui.InsertButton(2, "Usar", x1 += 300, y1, 120, 60);
                }
            }
        }