示例#1
0
void CEvent::Enter () {
	Winsys.ShowCursor (!param.ice_cursor);

	if (State::manager.PreviousState() == &GameOver) UpdateCupRacing ();
		else InitCupRacing ();

	framewidth = 500;
	frametop = AutoYPosN (45);
	area = AutoAreaN (30, 80, framewidth);
	messtop = AutoYPosN (50);
	messtop2 = AutoYPosN (60);
	bonustop = AutoYPosN (35);
	texsize = 32 * Winsys.scale;
	if (texsize < 32) texsize = 32;
	dist = texsize + 2 * 4;
	framebottom = frametop + (int)ecup->races.size() * dist + 10;

	ResetGUI ();
	int siz = FT.AutoSizeN (5);
	textbuttons[1] = AddTextButton (Trans.Text(8), area.left + 100, AutoYPosN (80), siz);
	double len = FT.GetTextWidth (Trans.Text(13));
	textbuttons[0] = AddTextButton (Trans.Text(13), area.right -len - 100, AutoYPosN (80), siz);
	textbuttons[2] = AddTextButton (Trans.Text(15), CENTER, AutoYPosN (80), siz);

	Music.Play (param.menu_music, -1);
	if (ready < 1) curr_focus = textbuttons[0]; else curr_focus = textbuttons[2];
	g_game.loopdelay = 20;
}
示例#2
0
void EventInit () {
    Winsys.ShowCursor (!param.ice_cursor);

    if (g_game.prev_mode == GAME_OVER) UpdateCupRacing ();
    else InitCupRacing ();

    framewidth = 500;
    frametop = AutoYPosN (45);
    area = AutoAreaN (30, 80, framewidth);
    messtop = AutoYPosN (50);
    messtop2 = AutoYPosN (60);
    bonustop = AutoYPosN (35);
    texsize = 32 * param.scale;
    if (texsize < 32) texsize = 32;
    dist = texsize + 2 * 4;
    framebottom = frametop + ecup->num_races * dist + 10;

    ResetWidgets ();
    int siz = FT.AutoSizeN (5);
    AddTextButton (Trans.Text(8), area.left + 100, AutoYPosN (80), 1, siz);
    double len = FT.GetTextWidth (Trans.Text(13));
    AddTextButton (Trans.Text(13), area.right -len - 100, AutoYPosN (80), 0, siz);
    AddTextButton (Trans.Text(15), CENTER, AutoYPosN (80), 2, siz);

    Music.Play (param.menu_music, -1);
    if (ready < 1) curr_focus = 0;
    else curr_focus = 2;
    g_game.loopdelay = 20;
}