SBSPSS/Utils/MapEdit/LayerItem.cpp

132 lines
3.2 KiB
C++
Raw Normal View History

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-04-30 23:49:54 +02:00
/*****************************************************************************/
void CLayerItem::LoadDefThing(const char *Name,sLayerThing &ThisDef)
{
}
/*****************************************************************************/
void CLayerItem::LoadOldThing(CFile *File,sLayerThing &ThisThing)
{
sLayerThingDataOLD OldThing;
File->Read(&OldThing,sizeof(sLayerThingDataOLD));
}
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-04-07 23:05:33 +02:00
Core->GUIAdd(GUIThing,IDD_LAYER_THING);
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-04-07 23:05:33 +02:00
Core->GUIRemove(GUIThing,IDD_LAYER_THING);
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;
2001-04-07 23:05:33 +02:00
CComboBox &List=GUIThing.m_DefList;
2001-03-29 19:59:01 +02:00
// 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-04-07 23:05:33 +02:00
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-04-07 23:05:33 +02:00
CComboBox &List=GUIThing.m_DefList;
2001-03-29 19:59:01 +02:00
CurrentDefThing=-1;
List.SetCurSel(CurrentDefThing);
2001-04-07 23:05:33 +02:00
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;
2001-04-07 23:05:33 +02:00
CComboBox &List=GUIThing.m_List;
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
{
}