bool DispelMgefHandler::DialogMessageCallback(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
{
    // parse message
    switch (uMsg)
    {
    case WM_USERCOMMAND:
    case WM_COMMAND:
    {
        if (LOWORD(wParam) != IDC_DSPL_MAGICITEMTYPE || HIWORD(wParam) != CBN_SELCHANGE) break; // only process changes in item type combo
        _VMESSAGE("Magic Item Type changed");
        HWND ctl = GetDlgItem(dialog,IDC_DSPL_MAGICITEM);
        UInt8 type = (UInt8)TESComboBox::GetCurSelData(GetDlgItem(dialog,IDC_DSPL_MAGICITEMTYPE));  // get form type
        if (type) 
        {
            EnableWindow(ctl,true);
            TESComboBox::PopulateWithForms(ctl,type,true,false);
            TESComboBox::SetCurSelByData(ctl,TESForm::LookupByFormID(magicitemFormID));
        }
        else 
        {
            TESComboBox::Clear(ctl); 
            EnableWindow(ctl,false);
        }
        result = 0; return true;  // retval = false signals command handled
    }
    }
    return false;
}
void SpellItem::InitHooks()
{
    _MESSAGE("Initializing ...");

    // replace any existing SpellItems with (unlinked) OBME::SpellItems
    if (TESDataHandler::dataHandler)
    {
        for(BSSimpleList<::SpellItem*>::Node* node = &TESDataHandler::dataHandler->spellItems.firstNode; node && node->data; node = node->next)
        {
            // TODO - completely reconstruct SpellItem as an OBME::SpellItem
            BSStringT desc;
            node->data->GetDebugDescription(desc);
            _VMESSAGE("Rebuilding %s",desc.c_str());
            ReplaceVanillaEffectItems(node->data);
        }

        // TODO - move this code into similar sections for EnchantmentItem,AlchemyItem,IngredientItem,TESSigilStone
        /*for(BSSimpleList<EnchantmentItem*>::Node* node = &dataHandler->enchantmentItems.firstNode; node; node = node->next)
        {
            if (!node->data) continue;
            UpdateEffectItems(node->data);
        }
        if (dataHandler->objects)
        {
            for(TESObject* object = dataHandler->objects->first; object; object = object->next)
            {
                UpdateEffectItems(object);
            }
        }*/
    }
}
bool BoundItemMgefHandler::DialogMessageCallback(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
{ 
    HWND ctl;

    // parse message
    switch (uMsg)
    {
    case WM_USERCOMMAND:
    case WM_COMMAND:
    {
        UInt32 commandCode = HIWORD(wParam);
        switch (LOWORD(wParam))  // switch on control id
        {
        case IDC_SMBO_USEWEAPON:  // Armor/Weapon toggle
        case IDC_SMBO_USEARMOR:
        {
            if (commandCode == BN_CLICKED)
            {
                _VMESSAGE("Weapon/Armor toggle clicked"); 
                bool clicked = false;
                // weapon 
                ctl = GetDlgItem(dialog,IDC_SMBO_WEAPON);
                clicked = IsDlgButtonChecked(dialog,IDC_SMBO_USEWEAPON);
                EnableWindow(ctl,clicked); 
                _DMESSAGE("Setting Weap sel to %08X", clicked ? parentEffect.mgefParam : 0);
                TESComboBox::SetCurSelByData(ctl, clicked ? TESForm::LookupByFormID(parentEffect.mgefParam) : 0);
                // armor
                ctl = GetDlgItem(dialog,IDC_SMBO_ARMOR);
                clicked = IsDlgButtonChecked(dialog,IDC_SMBO_USEARMOR);
                EnableWindow(ctl,clicked); 
                _DMESSAGE("Setting Armo sel to %08X", clicked ? parentEffect.mgefParam : 0);
                TESComboBox::SetCurSelByData(ctl, clicked ? TESForm::LookupByFormID(parentEffect.mgefParam) : 0);
                //
                result = 0; return true;   // retval = false signals command handled    
            }
            break;
        }
        }
    }
    }
    return false;
}
示例#4
0
void ActionHandler::actionFastTravel(UInt32 refID)
{
	PlayerCharacter *player = PlayerCharacter::GetSingleton();
	TESObjectREFR *marker = (TESObjectREFR *)LookupFormByID(refID);
	if (marker == NULL) return;
	ExtraMapMarker *markerData = (ExtraMapMarker *)
		marker->extraDataList.GetByType(kExtraData_MapMarker);
	if (markerData == NULL || !markerData->CanTravel()) return;
	_MESSAGE("Flags %08x, %08x, %08x", player->unk650[6], player->unk650[7], player->unk650[8]);
	if (player->unk650[7] & 0x100 && !player->parentCell->IsInterior()) {
		_VMESSAGE("Fast travel");
		ExtraReferencePointer *ftp = (ExtraReferencePointer *)
			marker->extraDataList.GetByType(kExtraData_LinkedRef);
		if (ftp == NULL || ftp->refr == NULL) {
			_ERROR("Fast travel heading not found");
		}
		sprintf_s(commandBuf, "player.moveto %x 0 0 0", ftp->refr->refID);
		Script::RunScriptLine(commandBuf);
	}
	
}