示例#1
0
inline void setloc(HWND dialog, bool point)
{
	ENABLE_WND(IDC_E_LOCX, point);
	ENABLE_WND(IDC_E_LOCY, point);
	ENABLE_WND(IDC_E_LOCUID, !point);
	ENABLE_WND(IDC_E_OPENSEL2, !point);
}
示例#2
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;
}
示例#3
0
void EffectControls(HWND dialog, int type)
{
	int i;

	HWND control = GetDlgItem(dialog, IDC_E_TEXT);

	if (type >= Effect::NUM_EFFECTS_AOC)
	{
		for (i = IDC_E_START; i <= IDC_E_END; i++)
			ENABLE_WND(i, true);
		ENABLE_WND(IDC_E_TEXTID, true);
		ENABLE_WND(IDC_E_SOUNDID, true);
		ENABLE_WND(IDC_E_OPENSEL, true);
		ENABLE_WND(IDC_E_OPENSEL2, true);
		SendMessage(control, EM_SETLIMITTEXT, 256, 0);
		return;
	}

	for (i = IDC_E_START; i <= IDC_E_END; i++)
		ENABLE_WND(i, setts.editall);
	ENABLE_WND(IDC_E_TEXTID, false);
	ENABLE_WND(IDC_E_SOUNDID, false);
	ENABLE_WND(IDC_E_OPENSEL, false);
	ENABLE_WND(IDC_E_OPENSEL2, false);

	const char *table = etable1_14RC[type];

	for (i = 0; i < EditEffect::N_CONTROLS; i++)
	{
		if (table[i])
		{
			switch (i)
			{
				case 4:
					ENABLE_WND(IDC_E_OPENSEL, true);
					break;
				case 5:
					ENABLE_WND(IDC_E_OPENSEL2, true);
					break;
				case 10:
					ENABLE_WND(IDC_E_TEXTID, true);
					break;
				case 11:
					ENABLE_WND(IDC_E_SOUNDID, true);
					break;
			}
			ENABLE_WND(IDC_E_START + i, true);
		}
	}

	switch (type)
	{
		case EFFECT_SendChat:
			i = 64;
			break;
		case EFFECT_DisplayInstructions:
			i = 256;
			break;
		default:
			i = 0;
			break;
	}
	SendMessage(control, EM_SETLIMITTEXT, i, 0);
}