Esempio n. 1
0
void LoadEffect(HWND dialog, EditEffect *data)
{
	Effect *e = &data->e;

	// Refresh trigger combo box.
	SendMessageW(GetDlgItem(dialog, IDC_E_TRIG), CB_RESETCONTENT, 0, 0);
	data->TrigCallback(GetDlgItem(dialog, IDC_E_TRIG), e->trig_index);

	SendDlgItemMessage(dialog, IDC_E_TYPE, CB_SETCURSEL, e->type, 0);
	SetDlgItemInt(dialog, IDC_E_TYPEVAL, e->type, TRUE);
	SetDlgItemText(dialog, IDC_E_SOUND, e->sound.c_str());
	SetDlgItemInt(dialog, IDC_E_SOUNDID, e->soundid, TRUE);

	if (e->panel >= 0 && e->panel <= 2) {
	    SendDlgItemMessage(dialog, IDC_E_PANEL, CB_SETCURSEL, e->panel, 0);
	} else {
	    SetDlgItemInt(dialog, IDC_E_PANEL, e->panel, TRUE);
	}
	SetDlgItemText(dialog, IDC_E_TEXT, e->text.c_str());
	SetDlgItemInt(dialog, IDC_E_DTIME, e->disp_time, TRUE);
	SetDlgItemInt(dialog, IDC_E_TEXTID, e->textid, TRUE);
	SendDlgItemMessage(dialog, IDC_E_SPLAY, CB_SETCURSEL, e->s_player, 0);
	SendDlgItemMessage(dialog, IDC_E_TPLAY, CB_SETCURSEL, e->t_player, 0);
	SendDlgItemMessage(dialog, IDC_E_DSTATE, CB_SETCURSEL, e->diplomacy, 0);
	SetDlgItemInt(dialog, IDC_E_LOCX, e->location.x, TRUE);
	SetDlgItemInt(dialog, IDC_E_LOCY, e->location.y, TRUE);

    MakeNSelectedString(e->num_sel, GetDlgItem(dialog, IDC_E_NSELECTED));
	if (e->num_sel > 0)
		MakeUIDString(e->uids, e->num_sel, GetDlgItem(dialog, IDC_E_UIDS));
	else
		SetDlgItemText(dialog, IDC_E_UIDS, "");

	SetDlgItemInt(dialog, IDC_E_LOCUID, e->uid_loc, TRUE);
	SetDlgItemInt(dialog, IDC_E_AREAX1, e->area.left, TRUE);
	SetDlgItemInt(dialog, IDC_E_AREAY1, e->area.bottom, TRUE);
	SetDlgItemInt(dialog, IDC_E_AREAX2, e->area.right, TRUE);
	SetDlgItemInt(dialog, IDC_E_AREAY2, e->area.top, TRUE);
	SetDlgItemInt(dialog, IDC_E_AIGOAL, e->ai_goal, TRUE);
	LCombo_Select(dialog, IDC_E_UCNST, e->pUnit);
	Combo_SelectByData(GetDlgItem(dialog, IDC_E_GROUP), e->group);
	Combo_SelectByData(GetDlgItem(dialog, IDC_E_UTYPE), e->utype);
	LCombo_Select(dialog, IDC_E_RESEARCH, e->pTech);
	SetDlgItemInt(dialog, IDC_E_AMOUNT, e->amount, TRUE);
	LCombo_SelById(dialog, IDC_E_RESTYPE, e->res_type);
	SetDlgItemInt(dialog, IDC_E_TRIGID, e->trig_index, TRUE);
	if (e->pUnit) {
	    SetDlgItemInt(dialog, IDC_E_UCNSTID, e->pUnit->id(), TRUE);
	} else {
	    SetDlgItemInt(dialog, IDC_E_UCNSTID, -1, TRUE);
	}

	LoadVirtualTypeEffects(dialog, data);
}
Esempio n. 2
0
void LoadPlayers(HWND dialog)
{
    for (int i = 0; i < 9; i++) {
	    SendDlgItemMessage(dialog, IDC_P_P1_NUM + i, CB_SETCURSEL, scen.players[i].player_number, 0);
	    SetDlgItemText(dialog, IDC_P_NAME1 + i, scen.players[i].name);
	    LCombo_SelById(dialog, IDC_P_CIV1 + i, scen.players[i].civ);
	    SetDlgItemInt(dialog, IDC_P_GOLD1 + i, scen.players[i].resources[0], FALSE);
	    SetDlgItemInt(dialog, IDC_P_WOOD1 + i, scen.players[i].resources[1], FALSE);
	    SetDlgItemInt(dialog, IDC_P_FOOD1 + i, scen.players[i].resources[2], FALSE);
	    SetDlgItemInt(dialog, IDC_P_STONE1 + i, scen.players[i].resources[3], FALSE);
	    SendDlgItemMessage(dialog, IDC_P_HUMAN1 + i, BM_SETCHECK, scen.players[i].human, 0);
	    SetDlgItemInt(dialog, IDC_P_POP1 + i, (int)scen.players[i].pop, FALSE);
	    SendDlgItemMessage(dialog, IDC_P_COLOR1 + i, CB_SETCURSEL, scen.players[i].color, 0);	//assuming in order
	    SendDlgItemMessage(dialog, IDC_P_AGE1 + i, CB_SETCURSEL, scen.players[i].age + 1, 0);
    }
}