Beispiel #1
0
Dialog::Box::Box(u16 height, bool buttons)
{
    Display & display = Display::Get();

    if(buttons) height += BUTTON_HEIGHT;

    bool evil = Settings::Get().EvilInterface();
    const u8 count_middle = (height <= BOXAREA_TOP + BOXAREA_BOTTOM ? 0 : 1 + (height - BOXAREA_TOP - BOXAREA_BOTTOM) / BOXAREA_MIDDLE);
    const u16 height_middle = count_middle * BOXAREA_MIDDLE;
    const u16 height_top_bottom = (evil ? BOXE_TOP + BOXE_BOTTOM : BOX_TOP + BOX_BOTTOM);

    area.w = BOXAREA_WIDTH;
    area.h = BOXAREA_TOP + BOXAREA_BOTTOM + height_middle;

    s16 posx = (display.w() - BOX_WIDTH) / 2;
    s16 posy = (display.h() - height_top_bottom - height_middle) / 2;

    if(Settings::Get().QVGA() && height > display.h())
	posy = display.h() - area.h - ((evil ? BOXE_TOP : BOX_TOP) - BOXAREA_TOP);

    Save(posx, posy, BOX_WIDTH, height_top_bottom + height_middle);

    area.x = Rect::x + 36;
    area.y = Rect::y + (evil ? BOXE_TOP - BOXAREA_TOP : BOX_TOP - BOXAREA_TOP);

    BoxRedraw(Rect::x, Rect::y, count_middle);
}
Beispiel #2
0
Dialog::FrameBox::FrameBox(int height, bool buttons)
{
    Display & display = Display::Get();

    if(buttons) height += BUTTON_HEIGHT;

    bool evil = Settings::Get().ExtGameEvilInterface();
    const u32 count_middle = (height <= BOXAREA_TOP + BOXAREA_BOTTOM ? 0 : 1 + (height - BOXAREA_TOP - BOXAREA_BOTTOM) / BOXAREA_MIDDLE);
    const u32 height_middle = count_middle * BOXAREA_MIDDLE;
    const u32 height_top_bottom = (evil ? BOXE_TOP + BOXE_BOTTOM : BOX_TOP + BOX_BOTTOM);

    area.w = BOXAREA_WIDTH;
    area.h = BOXAREA_TOP + BOXAREA_BOTTOM + height_middle;

    s32 posx = (display.w() - BOX_WIDTH) / 2;
    s32 posy = (display.h() - height_top_bottom - height_middle) / 2;

    if(Settings::Get().QVGA() && height > display.h())
	posy = display.h() - area.h - ((evil ? BOXE_TOP : BOX_TOP) - BOXAREA_TOP);

    background.Save(Rect(posx, posy, BOX_WIDTH, height_top_bottom + height_middle));

    area.x = posx + 36;
    area.y = posy + (evil ? BOXE_TOP - BOXAREA_TOP : BOX_TOP - BOXAREA_TOP);

    BoxRedraw(posx, posy, count_middle);
}