Ejemplo n.º 1
0
    void RefreshUi()
    {
        Ui.Clear();

        int sw = Screen.width / 2;
        int sh = Screen.height / 2;

        int w = 50;

        Ui.AddPanel(-1000, w, 0, sw - w, sh, 0x20, 0x00, 0x00);
        Ui.AddPanel(-999, 0, 0, w, sh, 0x00, 0x00, 0x00);

        const int toolW = 23;
        const int toolP = 2;

        int tx = toolP, ty = toolP;

        Ui.AddTool(Sprite_Load, tx, ty, "Widget_Icon_Load");
        tx += toolP + toolW;
        Ui.AddTool(Sprite_Save, tx, ty, "Widget_Icon_Save");
        tx  = toolP;
        ty += toolP + toolW;

        Ui.AddTool(Sprite_Clear, tx, ty, "Widget_Icon_Clear");
        tx += toolP + toolW;
        Ui.AddTool(Drawing_Pen, tx, ty, "Widget_Icon_Pen");
        tx  = toolP;
        ty += toolP + toolW;

        if (SpriteWidth == 0)
        {
            Ui.AddTool(Sprite_Size, tx, ty, "Widget_Icon_Size8");
        }
        else if (SpriteWidth == 1)
        {
            Ui.AddTool(Sprite_Size, tx, ty, "Widget_Icon_Size16");
        }
        else if (SpriteWidth == 2)
        {
            Ui.AddTool(Sprite_Size, tx, ty, "Widget_Icon_Size24");
        }
        else
        {
            Ui.AddTool(Sprite_Size, tx, ty, "Giraffe/White");
        }

        tx += toolP + toolW;
        Ui.AddTool(848348, tx, ty, "Giraffe/White");
        tx  = toolP;
        ty += toolP + toolW;


        Ui.AddTool(Frame_New, tx, ty, "Widget_Icon_New");
        tx += toolP + toolW;
        Ui.AddTool(Frame_Delete, tx, ty, "Widget_Icon_Delete");
        tx  = toolP;
        ty += toolP + toolW;

        Ui.AddTool(Frame_Prev, tx, ty, "Widget_Icon_Prev");
        tx += toolP + toolW;
        Ui.AddTool(Frame_Next, tx, ty, "Widget_Icon_Next");
        tx  = toolP;
        ty += toolP + toolW;

        Ui.AddTool(Frame_Play6, tx, ty, "Widget_Icon_Play6");
        tx += toolP + toolW;
        Ui.AddTool(Frame_Play12, tx, ty, "Widget_Icon_Play12");
        tx  = toolP;
        ty += toolP + toolW;

        Ui.AddTool(Frame_Play25, tx, ty, "Widget_Icon_Play25");
        tx += toolP + toolW;
        Ui.AddTool(Frame_Play50, tx, ty, "Widget_Icon_Play50");
        tx  = toolP;
        ty += toolP + toolW;

        Ui.AddSpriteButton(Palette_Increase1, tx, ty, "Widgets_Up");
        tx += 10;

        Ui.AddSpriteButton(Palette_Increase2, tx, ty, "Widgets_Up");
        tx += 10;

        Ui.AddSpriteButton(Palette_IncreaseS, tx, ty, "Widgets_Up");
        tx += 10;

        tx  = toolP;
        ty += 8;

        Ui.AddLabel(Palette_RGB, tx, ty,
                    string.Format("{0:X1}{1:X1}{2:X1}",
                                  spritePalette[1] - 1,
                                  spritePalette[2] - 1,
                                  spritePalette[3] - 1
                                  )
                    );

        ty += 10;

        tx = toolP;
        Ui.AddSpriteButton(Palette_Decrease1, tx, ty, "Widgets_Down");
        tx += 10;

        Ui.AddSpriteButton(Palette_Decrease2, tx, ty, "Widgets_Down");
        tx += 10;

        Ui.AddSpriteButton(Palette_DecreaseS, tx, ty, "Widgets_Down");
        tx += 10;

        tx  = toolP;
        ty += 8;
        for (int i = 1; i < spritePalette.Count; i++)
        {
            Ui.AddPanel(i,
                        tx,
                        ty,
                        w - (toolP * 2),
                        16,
                        (byte)(palette[spritePalette[i]].r * 16),
                        (byte)(palette[spritePalette[i]].g * 16),
                        (byte)(palette[spritePalette[i]].b * 16));
            ty += 16;
        }

        GetComponent <EditorMain>().RefreshSharedUi();
    }
Ejemplo n.º 2
0
    public void RefreshUi()
    {
        Ui.Clear();
        Ui.AddPanel(-6000, 0, 0, Screen.width / 2, Screen.height / 2, 0x33, 0x33, 0x33);

        if (RequesterMode == RequesterMode.File)
        {
            if (RequesterFilePath == string.Empty)
            {
                RefreshDrives();
            }
            else
            {
                RefreshPaths();
            }

            int idx = 0;

            if (RequesterPage > RequesterFolderListing.Count)
            {
                RequesterPage = RequesterFolderListing.Count - RequesterFilePageSize;
            }

            if (RequesterPage < 0)
            {
                RequesterPage = 0;
            }

            int pageMax = Mathf.Min(RequesterPage + RequesterFilePageSize, RequesterFolderListing.Count);

            for (int i = RequesterPage; i < pageMax; i++)
            {
                PathInfo p = RequesterFolderListing[i];
                Ui.AddButton(100 + i, 0, 16 + idx * 16, 400, p.display);
                idx++;
            }

            if (RequesterFilePath != string.Empty)
            {
                Ui.AddButton(6001, 0, 0, 300, string.Format("<UP> {0}", RequesterFilePath));
            }

            if (RequesterPage != 0)
            {
                Ui.AddButton(6002, 300, 0, 20, "<");
            }
            else
            {
                Ui.AddButton(8002, 300, 0, 20, string.Empty);
            }

            if (RequesterPage + RequesterFilePageSize < RequesterFolderListing.Count)
            {
                Ui.AddButton(6003, 320, 0, 20, ">");
            }
            else
            {
                Ui.AddButton(8003, 320, 0, 20, string.Empty);
            }

            Ui.AddButton(6005, 340, 0, 60, "Cancel");

            if (RequesterFileIsSaving == true)
            {
                Ui.AddButton(6004, 0, Screen.height / 2 - 16, 400, "Save here....");
            }
        }
        else if (RequesterMode == RequesterMode.String)
        {
            Ui.AddLabel(7001, 10, 10, RequesterStringText);
            Ui.AddButton(7002, 10, 26, 100, "Okay");
            Ui.AddButton(7003, 110, 26, 100, "Cancel");
        }
    }