This commit is contained in:
Daveo 2001-03-29 17:59:01 +00:00
parent e6097f7417
commit 826713a65c
23 changed files with 1118 additions and 325 deletions

View file

@ -22,27 +22,16 @@
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
// New Layer
CLayerPlatform::CLayerPlatform(sLayerDef &Def) : CLayerThing(Def)
CLayerPlatform::CLayerPlatform(sLayerDef &Def)
{
LoadThingScript("c:\\temp\\character.txt");
InitLayer(Def);
}
/*****************************************************************************/
//CLayerPlatform::CLayerPlatform(CFile *File,int Version) :CLayerThing (File,Version)
//{
//}
/*****************************************************************************/
void CLayerPlatform::Load(CFile *File,int Version)
void CLayerPlatform::InitLayer(sLayerDef &Def)
{
CLayerThing::Load(File,Version);
}
/*****************************************************************************/
void CLayerPlatform::Save(CFile *File)
{
CLayerThing::Save(File);
CLayerThing::InitLayer(Def);
LoadThingScript(theApp.GetConfigStr("LayerScript","PlatformScript"));
}
/*****************************************************************************/
@ -50,51 +39,159 @@ void CLayerPlatform::InitSubView(CCore *Core)
{
}
/*****************************************************************************/
void CLayerPlatform::LoadThingScript(const char *Filename)
{
CLayerThing::LoadThingScript(Filename);
// CLayerThing::ThingScript.LoadAndImport(Filename);
int Count=ThingScript.GetGroupCount();
for (int i=0; i<Count; i++)
{
char *Name=ThingScript.GetGroupName(i);
char *Gfx=ThingScript.GetData(Name,"gfx");
TRACE2("%s\t\t%s\n",Name,Gfx);
if (Gfx)
ThingBank->AddSet(Gfx);
}
}
/*****************************************************************************/
/*** Gui *********************************************************************/
/*****************************************************************************/
void CLayerPlatform::GUIInit(CCore *Core)
{
// Core->GUIAdd(GUIToolBar,IDD_TOOLBAR);
// GUI.DisableCallback(true);
// Core->GUIAdd(GUI,IDD_LAYER_Platform);
// GUI.DisableCallback(false);
}
/*****************************************************************************/
void CLayerPlatform::GUIKill(CCore *Core)
{
// Core->GUIRemove(GUIToolBar,IDD_TOOLBAR);
// Core->GUIRemove(GUI,IDD_LAYER_Platform);
}
/*****************************************************************************/
void CLayerPlatform::GUIUpdate(CCore *Core)
{
/*
int i,ListSize;
CComboBox &List=GUI.m_List;
// Setup Def Platform List
ListSize=DefList.size();
List.ResetContent();
for (i=0; i<ListSize; i++)
{
List.AddString(DefList[i].Name);
}
List.SetCurSel(CurrentDefThing);
GUIThingUpdate();
*/
}
/*****************************************************************************/
void CLayerPlatform::GUIThingDefClear()
{
/*
CComboBox &List=GUI.m_List;
CurrentDefThing=-1;
List.SetCurSel(CurrentDefThing);
*/
}
/*****************************************************************************/
void CLayerPlatform::GUIThingUpdate()
{
/*
int i,ListSize;
CComboBox &List=GUI.m_LevelList;
// 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();
// Params
GUI.DisableCallback(true);
if (CurrentThing!=-1)
{
sLayerThing &ThisThing=ThingList[CurrentThing];
GUI.SetVal(GUI.m_Speed,ThisThing.Data.Speed);
GUI.SetVal(GUI.m_TurnRate,ThisThing.Data.TurnRate);
GUI.SetVal(GUI.m_Health,ThisThing.Data.Health);
GUI.SetVal(GUI.m_Attack,ThisThing.Data.AttackStrength);
GUI.m_Collision.SetCheck(ThisThing.Data.CollisionFlag);
GUI.m_Player.SetCheck(ThisThing.Data.PlayerFlag);
}
else
{
GUI.m_Speed.SetWindowText("");
GUI.m_TurnRate.SetWindowText("");
GUI.m_Health.SetWindowText("");
GUI.m_Attack.SetWindowText("");
GUI.m_Collision.SetCheck(false);
GUI.m_Player.SetCheck(false);
}
GUI.DisableCallback(false);
*/
}
/*****************************************************************************/
void CLayerPlatform::GUIThingPointUpdate()
{
/*
int i,ListSize;
sLayerThing &ThisThing=ThingList[CurrentThing];
CListBox &List=GUI.m_PosList;
List.ResetContent();
if (CurrentThing==-1)
{
}
else
{
// Setup ThingPointList
ListSize=ThisThing.XY.size();
for (i=0; i<ListSize; i++)
{
CString Str;
Str.Format("%i: %i, %i",i,ThisThing.XY[i].x,ThisThing.XY[i].y);
List.AddString(Str);
}
List.SetCurSel(CurrentThingPoint);
}
*/
}
/*****************************************************************************/
void CLayerPlatform::GUIChanged(CCore *Core)
{
/*
if (CurrentThing!=-1)
{
sLayerThing &ThisThing=ThingList[CurrentThing];
ThisThing.Data.Speed=GUI.GetVal(GUI.m_Speed);
ThisThing.Data.TurnRate=GUI.GetVal(GUI.m_TurnRate);
ThisThing.Data.Health=GUI.GetVal(GUI.m_Health);
ThisThing.Data.AttackStrength=GUI.GetVal(GUI.m_Attack);
ThisThing.Data.CollisionFlag=GUI.m_Collision.GetCheck()!=0;
ThisThing.Data.PlayerFlag=GUI.m_Player.GetCheck()!=0;
}
*/
}
/*****************************************************************************/
/*** Functions ***************************************************************/
/*****************************************************************************/
/*****************************************************************************/
void CLayerPlatform::Export(CCore *Core,CExport &Exp)
void CLayerPlatform::ExportThing(CExport &Exp,sLayerThing &ThisThing)
{
/*
int i,ListSize=ThisThing.XY.size();
sExpLayerPlatform OutThing;
// Point List
Exp.Write(&ListSize,sizeof(int));
for (i=0 ;i<ListSize; i++)
{
Exp.Write(&ThisThing.XY[i],sizeof(CPoint));
}
// Thing
OutThing.Health=ThisThing.Data.Health;
OutThing.AttackStrength=ThisThing.Data.AttackStrength;
OutThing.Speed=ThisThing.Data.Speed;
OutThing.TurnRate=ThisThing.Data.TurnRate;
OutThing.CollisionFlag=ThisThing.Data.CollisionFlag;
OutThing.PlayerFlag=ThisThing.Data.PlayerFlag;
Exp.Write(&OutThing,sizeof(sExpLayerPlatform));
*/
}