// Refresher.cpp: implementation of the Refresher class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MW4GameEd2.h"
#include "Refresher.h"
#include "OverviewWindow.h"
#include "OverviewProperties.h"
#include "ObjManFrame.h"
#include "GameView.h"



//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Refresher *Refresher::Instance;

Refresher::~Refresher()
{

}

void Refresher::WorldRefresh(CWnd *ignore,bool expandlist)
{
if(ignore!=objmanWnd) objmanWnd->Refresh(expandlist);
if(ignore!=overWnd->m_COverviewProperties) 
	overWnd->m_COverviewProperties->Refresh();
DrawRefresh(ignore);
}

void Refresher::DrawRefresh(CWnd *ignore)
{
if(ignore!=overWnd) OverviewRefresh();
if(ignore!=gameWnd) View3DRefresh();
if(ignore!=objmanWnd) ObjManSelRefresh();
}

void Refresher::View3DRefresh()
{
	gameWnd->InvalidateRect(NULL,FALSE);
	gameWnd->UpdateWindow();
}

void Refresher::OverviewRefresh()
{
	overWnd->InvalidateRect(NULL,FALSE);
	overWnd->UpdateWindow();
}

void Refresher::ObjManSelRefresh()
{
objmanWnd->UpdateSelState();
}

void Refresher::ObjManListRefresh()
{
objmanWnd->RefreshList();
}
