예제 #1
0
static void Inputs_CFG_Layout(t_app_inputs_config *app, bool setup)
{
    t_frame frame;

    // Clear
    clear_to_color(app->box->gfx_buffer, COLOR_SKIN_WINDOW_BACKGROUND);

    if (setup)
    {
        // Add closebox widget
        widget_closebox_add(app->box, Inputs_CFG_Switch);

        // Peripheral change button
        frame.pos.x = 10;
        frame.pos.y = 18;
        frame.size.x = Graphics.Inputs.InputsBase->w;
        frame.size.y = 80-2;
        widget_button_add(app->box, &frame, 1, Inputs_CFG_Peripheral_Change_Handler, WIDGET_BUTTON_STYLE_INVISIBLE, NULL);

        // Input source change button
        frame.pos.x = 170;
        frame.pos.y = 10-Font_Height(F_MIDDLE)/2;
        frame.size.x = INPUTS_CFG_FRAME_X - 5;
        frame.size.y = Font_Height(F_MIDDLE);
        widget_button_add(app->box, &frame, 1|2, Inputs_CFG_Current_Source_Change, WIDGET_BUTTON_STYLE_INVISIBLE, NULL);

        // Input map change button
        frame.pos.x = 170 /* + (INPUTS_CFG_FRAME_X / 2)*/;
        frame.pos.y = 48;
        frame.size.x = (INPUTS_CFG_FRAME_X /* / 2 */) - 10;
        frame.size.y = INPUT_MAP_MAX * (Font_Height(F_SMALL) + GUI_LOOK_LINES_SPACING_Y);
        widget_button_add(app->box, &frame, 1, Inputs_CFG_Map_Change_Handler, WIDGET_BUTTON_STYLE_INVISIBLE, NULL);

        // 'Enabled' checkbox
        frame.pos.x = 170;
        frame.pos.y = 19;
        frame.size.x = INPUTS_CFG_CHECK_X;
        frame.size.y = INPUTS_CFG_CHECK_Y;
        app->CheckBox_Enabled = widget_checkbox_add(app->box, &frame, &Inputs.Sources [app->Current_Source]->enabled, NULL);

        // Emulate Digital check need to be added before drawing source
        // because currently it is drawn on the box before having the chance
        // to be disabled... so anyway drawing source will clear it.
        frame.pos.x = 170;
        frame.pos.y = 19 + (7 * 2) + (2 + 6) * (Font_Height(F_SMALL) + GUI_LOOK_LINES_SPACING_Y);
        frame.size.x = INPUTS_CFG_CHECK_X;
        frame.size.y = INPUTS_CFG_CHECK_Y;
        app->CheckBox_Emulate_Digital = widget_checkbox_add(app->box, &frame, &app->CheckBox_Emulate_Digital_Value, Inputs_CFG_Emulate_Digital_Handler);
        widget_disable(app->CheckBox_Emulate_Digital);
    }

    // Draw input base
    draw_sprite(app->box->gfx_buffer, Graphics.Inputs.InputsBase, 10, 34);

    // Draw current peripheral
    Inputs_CFG_Peripherals_Draw();

    // Draw current input source
    Inputs_CFG_Current_Source_Draw ();
}
예제 #2
0
파일: glasses.cpp 프로젝트: maxim-zhao/meka
void    Glasses_Switch_Enable (void)
{
    Glasses_Close();
    Glasses.Enabled ^= 1;
    if (Glasses.Enabled)
    {
        gui_menu_check (menus_ID.glasses, 0);
        Msg(MSGT_USER, "%s", Msg_Get(MSG_Glasses_Enabled));
    }
    else
    {
        gui_menu_uncheck_range(menus_ID.glasses, 0, 0);
        Msg(MSGT_USER, "%s", Msg_Get(MSG_Glasses_Disabled));
    }
    gui_menu_active_range (Glasses.Enabled, menus_ID.glasses, 1, 4);
    Inputs_CFG_Peripherals_Draw();
}
예제 #3
0
void    Inputs_CFG_Peripheral_Change (int Player, int Periph)
{
    Inputs.Peripheral [Player] = Periph;
    Inputs_CFG_Peripherals_Draw ();
    Inputs_Peripheral_Change_Update ();
}