示例#1
0
文件: Guild.cpp 项目: FoOtY/ClassyWoW
void Guild::DelMember(ObjectGuid guid, bool isDisbanding)
{
    uint32 lowguid = guid.GetCounter();

    // guild master can be deleted when loading guild and guid doesn't exist in characters table
    // or when he is removed from guild by gm command
    if (m_LeaderGuid == guid && !isDisbanding)
    {
        MemberSlot* oldLeader = NULL;
        MemberSlot* best = NULL;
        ObjectGuid newLeaderGUID;
        for (Guild::MemberList::iterator i = members.begin(); i != members.end(); ++i)
        {
            if (i->first == lowguid)
            {
                oldLeader = &(i->second);
                continue;
            }

            if (!best || best->RankId > i->second.RankId)
            {
                best = &(i->second);
                newLeaderGUID = ObjectGuid(HIGHGUID_PLAYER, i->first);
            }
        }
        if (!best)
        {
            Disband();
            return;
        }

        SetLeader(newLeaderGUID);

        // If player not online data in data field will be loaded from guild tabs no need to update it !!
        if (Player *newLeader = sObjectMgr.GetPlayer(newLeaderGUID))
            newLeader->SetRank(GR_GUILDMASTER);

        // when leader non-exist (at guild load with deleted leader only) not send broadcasts
        if (oldLeader)
        {
            BroadcastEvent(GE_LEADER_CHANGED, oldLeader->Name.c_str(), best->Name.c_str());
            BroadcastEvent(GE_LEFT, guid, oldLeader->Name.c_str());
        }
    }

    members.erase(lowguid);

    Player *player = sObjectMgr.GetPlayer(guid);
    // If player not online data in data field will be loaded from guild tabs no need to update it !!
    if (player)
    {
        player->SetInGuild(0);
        player->SetRank(0);
    }

    CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guid = '%u'", lowguid);

    if (!isDisbanding)
        UpdateAccountsNumber();
}
示例#2
0
//----------------------------------------------------------------------------------------------
void CActor::SuperDeserializer(tinyxml2::XMLElement *xml_current_tree)
{
	Super::SuperDeserializer(xml_current_tree);

    BroadcastEvent(Event_PostLoad);
    BroadcastEvent(Event_Updated);
}
示例#3
0
void AKUIInterface::SetFocus( UKUIInterfaceContainer* ctNewFocus )
{
	if ( ctFocused.Get() == ctNewFocus )
		return;

	UKUIInterfaceContainer* const ctOldFocus = ctFocused.Get();

	if ( ctOldFocus != NULL )
	{
		FKUIInterfaceEvent stEventInfo( EKUIInterfaceContainerEventList::E_Blur );
		ctOldFocus->SendEvent( stEventInfo );
	}

	this->ctFocused = ctNewFocus;

	if ( ctNewFocus != NULL )
	{
		FKUIInterfaceEvent stEventInfo( EKUIInterfaceContainerEventList::E_Focus );
		ctNewFocus->SendEvent( stEventInfo );
	}

	FKUIInterfaceContainerElementEvent stEventInfo( EKUIInterfaceContainerEventList::E_FocusChange, ctNewFocus );
	BroadcastEvent( stEventInfo );

	if ( !IsTemplate() )
		OnFocusChangeBP( ctOldFocus, ctNewFocus );
}
示例#4
0
//----------------------------------------------------------------------------------------------
bool CActor::AddChildNode(const CActor *actor, int Index /*= INDEX_NONE*/)
{
	bool bResult = false;

	if (actor != nullptr && std::find(m_ChildNodes.begin(), m_ChildNodes.end(), actor) == m_ChildNodes.end())
	{
		if (Index == INDEX_NONE)
		{
			m_ChildNodes.push_back(const_cast<CActor*>(actor));
		}
		else
		{
			TVecActorChildIterator IterPlaceTo = m_ChildNodes.begin();
			std::advance(IterPlaceTo, Index);

			if (IterPlaceTo != m_ChildNodes.end()){
				m_ChildNodes.insert(IterPlaceTo, const_cast<CActor*>(actor));
			}
			else{
				m_ChildNodes.push_back(const_cast<CActor*>(actor));
			}
		}

        BroadcastEvent(Event_AddObjectChild, actor);

		bResult = true;
	}
	return bResult;
}
示例#5
0
void ArenaTeam::Disband(WorldSession* session)
{
    // Remove all members from arena team
    while (!Members.empty())
        DelMember(Members.front().Guid, false);

    // Broadcast update
    if (session)
    {
        BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");

        if (Player* player = session->GetPlayer())
            sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
    }

    // Update database
    SQLTransaction trans = CharacterDatabase.BeginTransaction();

    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHARACTER_DELETE_ARENA_TEAM);
    stmt->setUInt32(0, TeamId);
    trans->Append(stmt);

    stmt = CharacterDatabase.GetPreparedStatement(CHARACTER_DELETE_ARENA_TEAM_MEMBERS);
    stmt->setUInt32(0, TeamId);
    trans->Append(stmt);

    CharacterDatabase.CommitTransaction(trans);

    // Remove arena team from ObjectMgr
    sArenaTeamMgr->RemoveArenaTeam(TeamId);
}
void ArenaTeam::Disband(WorldSession* session)
{
    // Remove all members from arena team
    while (!Members.empty())
        DelMember(Members.front().Guid, false);

    // Broadcast update
    if (session)
    {
        BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
    }

    // Update database
    SQLTransaction trans = CharacterDatabase.BeginTransaction();

    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);
    stmt->setUInt32(0, TeamId);
    trans->Append(stmt);

    stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBERS);
    stmt->setUInt32(0, TeamId);
    trans->Append(stmt);

    CharacterDatabase.CommitTransaction(trans);

    // Remove arena team from ObjectMgr
    sArenaTeamMgr->RemoveArenaTeam(TeamId);
}
示例#7
0
//----------------------------------------------------------------------------------------------
void CActor::PreRelease() 
{ 
    BroadcastEvent(Event_PreRelease);

	InterruptKeys.clear();

	Super::PreRelease();
}
示例#8
0
void AKUIInterface::Tick( float fDeltaTime )
{
	FKUIInterfaceContainerTickEvent stEventInfo( EKUIInterfaceContainerEventList::E_Tick, fDeltaTime );
	BroadcastEvent( stEventInfo );
	
	if ( !IsTemplate() )
		OnTickBP( fDeltaTime );
}
示例#9
0
//----------------------------------------------------------------------------------------------
void CActor::Initialize()
{
	assert(!IsInitialized());

	std::for_each(m_ChildNodes.begin(), m_ChildNodes.end(), std::mem_fun(&CActor::Initialize));
	
	Super::Initialize();

    BroadcastEvent(Event_PostInitialize);
}
示例#10
0
//----------------------------------------------------------------------------------------------
bool CActor::RemoveChildNode(CActor *actor)
{
	TVecActorChildIterator IterFind = std::find(m_ChildNodes.begin(), m_ChildNodes.end(), actor);
	if (IterFind != m_ChildNodes.end())
	{
        m_ChildNodes.erase(IterFind);
        BroadcastEvent(Event_OnRemoveObject, actor);
	}
	return true;
}
示例#11
0
/** Warning: this function releases all depend childs & free self memory */
bool CActor::ProcessRelease(bool ForceOperation /*= false*/)
{	
	bool bReleaseObject = false;
	
	if (ForceOperation || IsPendingToDelete()) // need to be deleted
	{
		TVecActorChildIterator IterActor = m_ChildNodes.begin();
		while (IterActor != m_ChildNodes.end())
		{
			(*IterActor)->ProcessRelease(true);   // force release childs
			(*IterActor) = nullptr;				  // zero pointer
			++IterActor;
		}

		m_ChildNodes.erase(std::remove(m_ChildNodes.begin(), m_ChildNodes.end(), static_cast<CActor*>(nullptr)), m_ChildNodes.end());

		return Super::ProcessRelease(ForceOperation); // free memory
	}
	else
	{
		TVecActorChildIterator IterActor = m_ChildNodes.begin();
		while (IterActor != m_ChildNodes.end())
		{
			if ((*IterActor)->ProcessRelease(ForceOperation)) // found pending to delete child object
			{
				(*IterActor) = nullptr;
				bReleaseObject = true;
			}
			++IterActor;
		}
		
		if (bReleaseObject == true)
		{
			m_ChildNodes.erase(std::remove(m_ChildNodes.begin(), m_ChildNodes.end(), static_cast<CActor*>(nullptr)), m_ChildNodes.end());

            BroadcastEvent(Event_PostRelease);
            BroadcastEvent(Event_Updated);
		}
	}

	return false;
}
示例#12
0
//----------------------------------------------------------------------------------------------
bool CActor::Rename(const char* name)
{
	bool bResult = false;
	if (strcmp(GetName(), name) != 0)
	{
		SetName(name);
        BroadcastEvent(Event_ObjectRename);
		bResult = true;
	}
	return bResult;
}
示例#13
0
文件: Guild.cpp 项目: FoOtY/ClassyWoW
void Guild::Disband()
{
    BroadcastEvent(GE_DISBANDED);

    while (!members.empty())
    {
        MemberList::const_iterator itr = members.begin();
        DelMember(ObjectGuid(HIGHGUID_PLAYER, itr->first), true);
    }

    CharacterDatabase.BeginTransaction();
    CharacterDatabase.PExecute("DELETE FROM guild WHERE guildid = '%u'", m_Id);
    CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", m_Id);
    CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid = '%u'", m_Id);
    CharacterDatabase.CommitTransaction();
    sObjectMgr.RemoveGuild(m_Id);
}
示例#14
0
void Guild::Disband()
{
    BroadcastEvent(GE_DISBANDED, 0, 0, "", "", "");

    while (!members.empty())
    {
        MemberList::const_iterator itr = members.begin();
        DelMember(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER), true);
    }

    CharacterDatabase.BeginTransaction();
    CharacterDatabase.PExecute("DELETE FROM guild WHERE guildid = '%u'", m_Id);
    CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", m_Id);
    // TODO item_instance should be deleted ?
    CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid = '%u'", m_Id);
    CharacterDatabase.CommitTransaction();
    sObjectMgr.RemoveGuild(m_Id);
}
//==============================
// VRMenuEventHandler::HandleEvents
void VRMenuEventHandler::HandleEvents( OvrGuiSys & guiSys, VrFrame const & vrFrame, 
		menuHandle_t const rootHandle, Array< VRMenuEvent > const & events ) const
{
	VRMenuObject * root = guiSys.GetVRMenuMgr().ToObject( rootHandle );
	if ( root == NULL )
	{
		return;
	}

	// find the list of all objects that are in the focused path
	Array< menuHandle_t > focusPath;
	FindTargetPath( guiSys, rootHandle, FocusedHandle, focusPath );
    
	Array< menuHandle_t > targetPath;

	for ( int i = 0; i < events.GetSizeI(); ++i )
	{
		VRMenuEvent const & event = events[i];
		switch ( event.DispatchType )
		{
			case EVENT_DISPATCH_BROADCAST:
			{
				// broadcast to everything
				BroadcastEvent( guiSys, vrFrame, event, root );
			}
			break;
			case EVENT_DISPATCH_FOCUS:
				// send to the focus path only -- this list should be parent -> child order
				DispatchToPath( guiSys, vrFrame, event, focusPath, false );
				break;
			case EVENT_DISPATCH_TARGET:
				if ( targetPath.GetSizeI() == 0 || event.TargetHandle != targetPath.Back() )
				{
					targetPath.Clear();
					FindTargetPath( guiSys, rootHandle, event.TargetHandle, targetPath );
				}
				DispatchToPath( guiSys, vrFrame, event, targetPath, false );
				break;
			default:
				OVR_ASSERT( !"unknown dispatch type" );
				break;
		}
	}
}
示例#16
0
bool AKUIInterface::OnKeyChar( TCHAR chChar )
{
	if ( !IsConsumingInputEvents() )
		return false;

	FKUIInterfaceContainerCharEvent stEventInfo( EKUIInterfaceContainerEventList::E_KeyChar, false, chChar );

	ctFocused->SendEvent( stEventInfo );

	if ( stEventInfo.bHandled )
		return true;

	BroadcastEvent( stEventInfo, true );

	if ( !IsTemplate() )
		OnKeyCharBP( FString::Chr( chChar ) );

	return stEventInfo.bHandled;
}
示例#17
0
bool AKUIInterface::OnMouseButtonUp( EMouseButtons::Type eButton, const FVector2D& v2Location )
{
	FKUIInterfaceContainerMouseButtonEvent stEventInfo( EKUIInterfaceContainerEventList::E_MouseButtonUp, false, eButton, v2Location );

	if ( IsConsumingInputEvents() )
	{
		ctFocused->SendEvent( stEventInfo );

		if ( stEventInfo.bHandled )
			return true;
	}

	BroadcastEvent( stEventInfo, true );

	if ( !IsTemplate() )
		OnMouseButtonUpBP( eButton, v2Location );

	return stEventInfo.bHandled;
}
示例#18
0
//----------------------------------------------------------------------------------------------
void CActor::FinishGeneration()
{
	Super::FinishGeneration();

	CActor *pAParent = GetParent();
	if (pAParent)
	{
		pAParent->BroadcastEvent(Event_ObjectGenerated, this);
	}

	TVecActorChildConstIterator Iterator = m_ChildNodes.begin();
	while (Iterator != m_ChildNodes.end())
	{
		if ((*Iterator)->IsTransient()){
			BroadcastEvent(Event_ObjectGenerated, (*Iterator));
		}
		++Iterator;
	}
}
示例#19
0
bool AKUIInterface::OnKeyRepeat( FKey eKey )
{
	FKUIInterfaceContainerKeyEvent stEventInfo( EKUIInterfaceContainerEventList::E_KeyRepeat, false, eKey );

	if ( IsConsumingInputEvents() )
	{
		ctFocused->SendEvent( stEventInfo );

		if ( stEventInfo.bHandled )
			return true;
	}

	BroadcastEvent( stEventInfo, true );

	if ( !IsTemplate() )
		OnKeyRepeatBP( eKey );

	return stEventInfo.bHandled;
}
示例#20
0
void ArenaTeam::Disband(WorldSession *session)
{
    // event
    if (session)
        BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, session->GetPlayerName(), GetName().c_str());

    while (!m_members.empty())
        // Removing from members is done in DelMember.
        DelMember(m_members.front().guid);

    if (session)
        if (Player* player = session->GetPlayer())
            sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());

    CharacterDatabase.BeginTransaction();
    CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", m_TeamId);
    CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", m_TeamId); // this should be alredy done by calling DelMember(memberGuids[j]); for each member
    CharacterDatabase.PExecute("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", m_TeamId);
    CharacterDatabase.CommitTransaction();
    sObjectMgr->RemoveArenaTeam(m_TeamId);
}
示例#21
0
void ArenaTeam::Disband(WorldSession *session)
{
    // event
    if (session)
    {
        // probably only 1 string required...
        BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, session->GetPlayerName(), GetName().c_str());
    }

    while (!m_members.empty())
    {
        // Removing from members is done in DelMember.
        DelMember(m_members.front().guid);
    }

    CharacterDatabase.BeginTransaction();
    CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", m_TeamId);
    CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", m_TeamId); //< this should be already done by calling DelMember(memberGuids[j]); for each member
    CharacterDatabase.PExecute("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", m_TeamId);
    CharacterDatabase.CommitTransaction();
    sObjectMgr.RemoveArenaTeam(m_TeamId);
}
//==============================
// VRMenuEventHandler::BroadcastEvent
bool VRMenuEventHandler::BroadcastEvent( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
        VRMenuEvent const & event, VRMenuObject * receiver ) const
{
    DROID_ASSERT( receiver != NULL, "VrMenu" );

    // allow parent components to handle first
    if ( DispatchToComponents( app, vrFrame, menuMgr, event, receiver ) )
    {
        return true;
    }

    // if the parent did not consume, dispatch to children
    int numChildren = receiver->NumChildren();
    for ( int i = 0; i < numChildren; ++i )
    {
        menuHandle_t childHandle = receiver->GetChildHandleForIndex( i );
        VRMenuObject * child = menuMgr.ToObject( childHandle );
        if ( child != NULL && BroadcastEvent( app, vrFrame, menuMgr, event, child ) )
        {
            return true;    // consumed by child
        }
    }
    return false;
}
//==============================
// VRMenuEventHandler::BroadcastEvent
bool VRMenuEventHandler::BroadcastEvent( OvrGuiSys & guiSys, VrFrame const & vrFrame, 
        VRMenuEvent const & event, VRMenuObject * receiver ) const
{
	ASSERT_WITH_TAG( receiver != NULL, "VrMenu" );

	// allow parent components to handle first
	if ( DispatchToComponents( guiSys, vrFrame, event, receiver ) )
	{
		return true;
	}

	// if the parent did not consume, dispatch to children
	int numChildren = receiver->NumChildren();
	for ( int i = 0; i < numChildren; ++i ) 
	{
		menuHandle_t childHandle = receiver->GetChildHandleForIndex( i );
		VRMenuObject * child = guiSys.GetVRMenuMgr().ToObject( childHandle );
		if ( child != NULL && BroadcastEvent( guiSys, vrFrame, event, child ) )
		{
			return true;    // consumed by child
		}
	}
	return false;
}
//-----  OnBnClickedBtResetForm()  --------------------------------------------
void CFormBlenderPrepareView::OnBnClickedBtResetForm()
{
	BroadcastEvent(IBCE_CHANGED_SETTINGS);
}
//-----  OnBnClickedBtResetForm()  --------------------------------------------
void CFormChunkMergeView::OnBnClickedBtResetForm()
{
	BroadcastEvent(IBCE_CHANGED_SETTINGS);
}
//-----  OnInitialUpdate()  ---------------------------------------------------
void CFormChunkMergeView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();

	//  initialize GUI (icons, texts, read-only)
	CImageList*	pImageList   (CFDResourceManager::getInstance()->getImageListBrowse());
	CImageList*	pImageListDis(CFDResourceManager::getInstance()->getImageListOtherDis());
	
	((CMFCButton*) GetDlgItem(IDC_BT_FILE_IN))  ->SetImage(pImageList->ExtractIcon(1));
	((CMFCButton*) GetDlgItem(IDC_BT_FILE_COLL))->SetImage(pImageList->ExtractIcon(1));
/*
	((CEdit*) ((CComboBox*) GetDlgItem(IDC_CB_TEMPLATE))  ->GetDlgItem(1001))->SetReadOnly();
	((CEdit*) ((CComboBox*) GetDlgItem(IDC_CB_MAT_SINGLE))->GetDlgItem(1001))->SetReadOnly();
*/
	::SetWindowTheme(GetDlgItem(IDC_GBOX_FILES)    ->GetSafeHwnd(), _T(""), _T(""));
	::SetWindowTheme(GetDlgItem(IDC_GBOX_HINTS)    ->GetSafeHwnd(), _T(""), _T(""));
	::SetWindowTheme(GetDlgItem(IDC_GBOX_COLLISION)->GetSafeHwnd(), _T(""), _T(""));
	::SetWindowTheme(GetDlgItem(IDC_GBOX_MATERIAL) ->GetSafeHwnd(), _T(""), _T(""));
	::SetWindowTheme(GetDlgItem(IDC_GBOX_HANDLING) ->GetSafeHwnd(), _T(""), _T(""));

	pImageList = CFDResourceManager::getInstance()->getImageListNumbers();
	for (short i(1); i < 6; ++i)
	{
		((CStatic*) GetDlgItem(IDC_PC_NUM_0+i)) ->SetIcon(pImageList->ExtractIcon(i));
		((CStatic*) GetDlgItem(IDC_PC_HINT_0+i))->SetIcon(pImageList->ExtractIcon(i));
	}

	pImageList = CFDResourceManager::getInstance()->getImageListOther();
	((CMFCButton*) GetDlgItem(IDC_BT_CONVERT))    ->SetImage(pImageList->ExtractIcon(0));
	((CMFCButton*) GetDlgItem(IDC_BT_MAT_DEFINE)) ->SetImage(pImageList->ExtractIcon(7),  true, NULL, pImageListDis->ExtractIcon(7));
	((CMFCButton*) GetDlgItem(IDC_BT_RESET_FORM)) ->SetImage(pImageList->ExtractIcon(2));
	((CMFCButton*) GetDlgItem(IDC_BT_VIEW_IN))    ->SetImage(pImageList->ExtractIcon(4),  true, NULL, pImageListDis->ExtractIcon(4));
	((CMFCButton*) GetDlgItem(IDC_BT_VIEW_COLL))  ->SetImage(pImageList->ExtractIcon(4),  true, NULL, pImageListDis->ExtractIcon(4));
	((CMFCButton*) GetDlgItem(IDC_BT_TEMPLATE))   ->SetImage(pImageList->ExtractIcon(3));
	((CMFCButton*) GetDlgItem(IDC_BT_NSCOPE_IN))  ->SetImage(pImageList->ExtractIcon(10), true, NULL, pImageListDis->ExtractIcon(10));
	((CMFCButton*) GetDlgItem(IDC_BT_NSCOPE_COLL))->SetImage(pImageList->ExtractIcon(10), true, NULL, pImageListDis->ExtractIcon(10));

	GetDlgItem(IDC_BT_VIEW_IN)     ->EnableWindow(FALSE);
	GetDlgItem(IDC_BT_NSCOPE_IN)   ->EnableWindow(FALSE);
	GetDlgItem(IDC_BT_VIEW_COLL)   ->EnableWindow(FALSE);
	GetDlgItem(IDC_BT_NSCOPE_COLL) ->EnableWindow(FALSE);
	GetDlgItem(IDC_RD_COLL_LOCAL)  ->EnableWindow(FALSE);
	GetDlgItem(IDC_RD_COLL_GLOBAL) ->EnableWindow(FALSE);
	GetDlgItem(IDC_CK_REORDER_TRIS)->EnableWindow(FALSE);

	//  initialize log view
	CRichEditCtrl*	pLogView((CRichEditCtrl*) GetDlgItem(IDC_RE_LOG));
	CHARFORMAT		cf = { 0 };

	cf.cbSize    = sizeof(cf);
	cf.dwMask    = CFM_FACE | CFM_SIZE | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_PROTECTED;
	cf.dwEffects = 0;
	cf.yHeight   = 127;
	lstrcpy(cf.szFaceName, _T("Small Fonts"));

	pLogView->SetDefaultCharFormat(cf);
	pLogView->SetReadOnly         (TRUE);
	if (Configuration::getInstance()->_lvwLogActive[0])
	{
		pLogView->SetBackgroundColor(FALSE, Configuration::getInstance()->_lvwColors[0]);
	}

	//  prepare tool tips
	if (_toolTipCtrl.Create(this, TTS_USEVISUALSTYLE | TTS_BALLOON))
	{
		for (short i(0); glToolTiplist[i]._uid != -1; ++i)
		{
			_toolTipCtrl.AddTool(GetDlgItem(glToolTiplist[i]._uid), CString(glToolTiplist[i]._text.c_str()));
		}

		_toolTipCtrl.SetMaxTipWidth(260);
		_toolTipCtrl.Activate(Configuration::getInstance()->_showToolTipps);
	}

	//  set settings from configuration
	BroadcastEvent(IBCE_CHANGED_SETTINGS);

	//  disable 'defining materials' until working
	GetDlgItem(IDC_RD_MAT_DEFINE)->EnableWindow(FALSE);
}
//-----  OnInitialUpdate()  ---------------------------------------------------
void CFormBlenderPrepareView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();

	//  initialize GUI (icons, texts, read-only)
	CImageList*	pImageList   (CFDResourceManager::getInstance()->getImageListBrowse());
	CImageList*	pImageListDis(CFDResourceManager::getInstance()->getImageListOtherDis());
	
	((CMFCButton*) GetDlgItem(IDC_BT_FILE_IN)) ->SetImage(pImageList->ExtractIcon(1));
	((CMFCButton*) GetDlgItem(IDC_BT_FILE_OUT))->SetImage(pImageList->ExtractIcon(1));

	::SetWindowTheme(GetDlgItem(IDC_GBOX_FILES)->GetSafeHwnd(), _T(""), _T(""));
	::SetWindowTheme(GetDlgItem(IDC_GBOX_HINTS)->GetSafeHwnd(), _T(""), _T(""));
	::SetWindowTheme(GetDlgItem(IDC_GBOX_TOOLS)->GetSafeHwnd(), _T(""), _T(""));

	pImageList = CFDResourceManager::getInstance()->getImageListNumbers();
	for (short i(1); i < 5; ++i)
	{
		if (i != 3)
		{
			((CStatic*) GetDlgItem(IDC_PC_NUM_0+i))->SetIcon(pImageList->ExtractIcon(i));
		}
		((CStatic*) GetDlgItem(IDC_PC_HINT_0+i))->SetIcon(pImageList->ExtractIcon(i));
	}

	pImageList = CFDResourceManager::getInstance()->getImageListOther();
	((CMFCButton*) GetDlgItem(IDC_BT_CONVERT))    ->SetImage(pImageList->ExtractIcon(0));
	((CMFCButton*) GetDlgItem(IDC_BT_RESET_FORM)) ->SetImage(pImageList->ExtractIcon(2));
	((CMFCButton*) GetDlgItem(IDC_BT_VIEW_IN))    ->SetImage(pImageList->ExtractIcon(4),  true, NULL, pImageListDis->ExtractIcon(4));
	((CMFCButton*) GetDlgItem(IDC_BT_VIEW_OUT))   ->SetImage(pImageList->ExtractIcon(4),  true, NULL, pImageListDis->ExtractIcon(4));
	((CMFCButton*) GetDlgItem(IDC_BT_NSCOPE_IN))  ->SetImage(pImageList->ExtractIcon(10), true, NULL, pImageListDis->ExtractIcon(10));
	((CMFCButton*) GetDlgItem(IDC_BT_NSCOPE_OUT)) ->SetImage(pImageList->ExtractIcon(10), true, NULL, pImageListDis->ExtractIcon(10));

	GetDlgItem(IDC_BT_VIEW_IN)   ->EnableWindow(FALSE);
	GetDlgItem(IDC_BT_NSCOPE_IN) ->EnableWindow(FALSE);
	GetDlgItem(IDC_BT_VIEW_OUT)  ->EnableWindow(FALSE);
	GetDlgItem(IDC_BT_NSCOPE_OUT)->EnableWindow(FALSE);

	//  initialize log view
	CRichEditCtrl*	pLogView((CRichEditCtrl*) GetDlgItem(IDC_RE_LOG));
	CHARFORMAT		cf = { 0 };

	cf.cbSize    = sizeof(cf);
	cf.dwMask    = CFM_FACE | CFM_SIZE | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_PROTECTED;
	cf.dwEffects = 0;
	cf.yHeight   = 127;
	lstrcpy(cf.szFaceName, _T("Small Fonts"));

	pLogView->SetDefaultCharFormat(cf);
	pLogView->SetReadOnly         (TRUE);
	if (Configuration::getInstance()->_lvwLogActive[0])
	{
		pLogView->SetBackgroundColor(FALSE, Configuration::getInstance()->_lvwColors[0]);
	}

	//  create initial sub form
	CRect	tRect;
	GetDlgItem(IDC_SUBFORM_BOX)->GetWindowRect(&tRect);

	_subFormList.SetPosition  (tRect);
	_subFormList.CreateSubForm(IDD_SUB_ARMOR_BLENDER, this, new CSubFormArmorBlender());
	_subFormList.CreateSubForm(IDD_SUB_BLENDER_ARMOR, this, new CSubFormBlenderArmor());
	_subFormList.ShowSubForm  (0);

	//  prepare tool tips
	if (_toolTipCtrl.Create(this, TTS_USEVISUALSTYLE | TTS_BALLOON))
	{
		for (short i(0); glToolTiplist[i]._uid != -1; ++i)
		{
			_toolTipCtrl.AddTool(GetDlgItem(glToolTiplist[i]._uid), CString(glToolTiplist[i]._text.c_str()));
		}

		_toolTipCtrl.SetMaxTipWidth(260);
		_toolTipCtrl.Activate(Configuration::getInstance()->_showToolTipps);
	}

	//  set settings from configuration
	BroadcastEvent(IBCE_CHANGED_SETTINGS);
}