2001-03-29 19:59:01 +02:00
|
|
|
/**********************/
|
2001-03-13 22:00:34 +01:00
|
|
|
/*** Layer Item ***/
|
2001-03-29 19:59:01 +02:00
|
|
|
/**********************/
|
2001-03-13 15:37:04 +01:00
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include <Vector3.h>
|
|
|
|
#include <gl\gl.h>
|
|
|
|
#include <gl\glu.h>
|
|
|
|
#include "GLEnabledView.h"
|
|
|
|
|
|
|
|
#include "MapEdit.h"
|
|
|
|
#include "MapEditDoc.h"
|
|
|
|
#include "MapEditView.h"
|
|
|
|
#include "MainFrm.h"
|
|
|
|
|
|
|
|
#include "Core.h"
|
2001-03-26 23:29:09 +02:00
|
|
|
#include "LayerThing.h"
|
2001-03-13 22:00:34 +01:00
|
|
|
#include "LayerItem.h"
|
2001-03-13 15:37:04 +01:00
|
|
|
#include "Utils.h"
|
|
|
|
#include "Export.h"
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
CLayerItem::CLayerItem(sLayerDef &Def)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
InitLayer(Def);
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
void CLayerItem::InitLayer(sLayerDef &Def)
|
|
|
|
{
|
2001-03-31 17:40:20 +02:00
|
|
|
ThingBank=new CElemBank(-1,-1,false,CElem::CentreModeLR || CElem::CentreModeTB);
|
2001-03-29 19:59:01 +02:00
|
|
|
CLayerThing::InitLayer(Def);
|
|
|
|
LoadThingScript(theApp.GetConfigStr("LayerScript","ItemScript"));
|
2001-03-31 17:40:20 +02:00
|
|
|
DrawPoints=false;
|
|
|
|
|
2001-03-29 19:59:01 +02:00
|
|
|
}
|
2001-03-13 15:37:04 +01:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
void CLayerItem::InitSubView(CCore *Core)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
/*** Gui *********************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void CLayerItem::GUIInit(CCore *Core)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
// GUI.DisableCallback(true);
|
2001-03-31 03:30:53 +02:00
|
|
|
Core->GUIAdd(GUI,IDD_LAYER_ITEM);
|
2001-03-29 19:59:01 +02:00
|
|
|
// GUI.DisableCallback(false);
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
void CLayerItem::GUIKill(CCore *Core)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-31 03:30:53 +02:00
|
|
|
Core->GUIRemove(GUI,IDD_LAYER_ITEM);
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
void CLayerItem::GUIUpdate(CCore *Core)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
int i,ListSize;
|
|
|
|
CComboBox &List=GUI.m_List;
|
|
|
|
|
|
|
|
// Setup Def Item List
|
|
|
|
ListSize=DefList.size();
|
|
|
|
List.ResetContent();
|
|
|
|
for (i=0; i<ListSize; i++)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
List.AddString(DefList[i].Name);
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
2001-03-29 19:59:01 +02:00
|
|
|
List.SetCurSel(CurrentDefThing);
|
|
|
|
|
2001-03-31 03:30:53 +02:00
|
|
|
// GUIThingUpdate();
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-29 19:59:01 +02:00
|
|
|
void CLayerItem::GUIThingDefClear()
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
CComboBox &List=GUI.m_List;
|
|
|
|
CurrentDefThing=-1;
|
|
|
|
List.SetCurSel(CurrentDefThing);
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-31 17:40:20 +02:00
|
|
|
void CLayerItem::GUIThingUpdate(bool OnlySel)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
int i,ListSize;
|
|
|
|
CComboBox &List=GUI.m_LevelList;
|
2001-03-31 17:40:20 +02:00
|
|
|
|
|
|
|
if (OnlySel)
|
|
|
|
{
|
|
|
|
List.SetCurSel(CurrentThing);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-03-29 19:59:01 +02:00
|
|
|
// Setup ThingList
|
|
|
|
ListSize=ThingList.size();
|
|
|
|
TRACE1("%i\n",ListSize);
|
|
|
|
List.ResetContent();
|
|
|
|
for (i=0; i<ListSize; i++)
|
|
|
|
{
|
|
|
|
|
|
|
|
List.AddString(ThingList[i].Name);
|
|
|
|
}
|
|
|
|
List.SetCurSel(CurrentThing);
|
|
|
|
GUIThingPointUpdate();
|
2001-03-13 15:37:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-03-13 22:00:34 +01:00
|
|
|
void CLayerItem::GUIChanged(CCore *Core)
|
2001-03-13 15:37:04 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|