Ejemplo n.º 1
0
BOOL Players_Init(HWND dialog)
{
    ENABLE_WND(IDC_P_MAX_TEAMS, scen.game == AOHD4 || scen.game == AOF4 || scen.game == AOHD6 || scen.game == AOF6);

	Combo_Fill(dialog, IDC_P_MAX_TEAMS, max_teams_names, NUM_MAX_TEAMS);
	Combo_Fill(dialog, IDC_P_NUM_PLAYERS, num_players_names, NUM_MAX_PLAYER_NAMES);

    for (int i = 0; i < 9; i++) {
        Combo_Fill(dialog, IDC_P_P1_NUM + i, players_number_names, 9);
	    SendDlgItemMessage(dialog, IDC_P_P1_NUM + i, CB_SETCURSEL, scen.players[i].player_number, 0);
	    LCombo_Fill(dialog, IDC_P_CIV1 + i, esdata.civs.head());
	    SendDlgItemMessage(dialog, IDC_P_CIV1 + i, CB_SETCURSEL, scen.players[i].civ, 0);
	    LCombo_Fill(dialog, IDC_P_COLOR1 + i, esdata.colors.head());
	    SendDlgItemMessage(dialog, IDC_P_COLOR1 + i, CB_SETCURSEL, scen.players[i].color, 0);
	    Combo_PairFill(GetDlgItem(dialog, IDC_P_AGE1 + i), NUM_AGES, ages);
	    SendDlgItemMessage(dialog, IDC_P_AGE1 + i, CB_SETCURSEL, scen.players[i].age, 0);
	    Combo_Fill(dialog, IDC_P_TEAM1 + i, team_names, NUM_TEAMS);
    }

    LoadDiplomacy(dialog);

    if (scen.game == AOHD4 || scen.game == AOF4 || scen.game == AOHD6 || scen.game == AOF6) {
	    for (int i = 0; i < 9; i++) {
	        ENABLE_WND(IDC_P_P1_NUM + i, true);
	    }
	} else {
	    for (int i = 0; i < 9; i++) {
	        ENABLE_WND(IDC_P_P1_NUM + i, false);
	    }
	}

	/* Set resource names per game */
	if (scen.game == SWGB) {
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_FOOD), L"Food:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_WOOD), L"Carbon:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_GOLD), L"Nova:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_STONE), L"Ore:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_OREX), L"Ore X:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_OREY), L"Goods:");
	} else {
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_FOOD), L"Food:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_WOOD), L"Wood:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_GOLD), L"Gold:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_STONE), L"Stone:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_OREX), L"Ore X:");
	    Window_SetTextW(GetDlgItem(dialog, IDC_P_LBL_OREY), L"Goods:");
	}

	return TRUE;
}
Ejemplo n.º 2
0
void E_Init(HWND dialog)
{
	Combo_Fill(dialog, IDC_E_TYPE, Effect::types,Effect::num_effects);
	Combo_Fill(dialog, IDC_E_VTYPE, Effect::virtual_types, Effect::num_virtual_effects);

	Combo_Fill(dialog, IDC_E_SPLAY, players_ec, EC_NUM_PLAYERS);
	Combo_Fill(dialog, IDC_E_TPLAY, players_ec, EC_NUM_PLAYERS);
	Combo_Fill(dialog, IDC_E_DSTATE, dnames, 4);
	Combo_Fill(dialog, IDC_E_PANEL, pnames, 3); // should this be 4?
	LCombo_Fill(dialog, IDC_E_RESEARCH, esdata.techs.head());
	LCombo_Fill(dialog, IDC_E_RESTYPE, esdata.resources.head());
	Combo_PairFill(GetDlgItem(dialog, IDC_E_GROUP), NUM_GROUPS, groups);
	Combo_PairFill(GetDlgItem(dialog, IDC_E_UTYPE), NUM_UTYPES, utypes);
	LCombo_Fill(dialog, IDC_E_UCNST, esdata.units.head(), noselecte);
}