#include "CreateRoleForm.h"


using namespace ObjDataEdit;
//######################################################################################################
ReaderClass< DB_GameObjDbStruct >* CreateRoleForm::ObjReader( )
{
	return GameObjDbStructEx::ObjReader_CreateRole();
}
//主要需要繼承的涵式
void    CreateRoleForm::OnActive()
{
	static bool FirstTime = true;

	//設定種族職業資訊
	if( FirstTime  == false )
		return;

	BaseForm::OnActive();
}
void    CreateRoleForm::OnSelectObj( bool LockOk )
{
    _ObjDB.GameData.Classification = EM_ObjectClass_CreateRole;
//    panel1->Enabled = LockOk;
}
//輸出時額外設定
void    CreateRoleForm::OnOutputObjSetting( DB_GameObjDbStruct* TempObj )
{
    TempObj->GameData.Classification = EM_ObjectClass_CreateRole;
	TempObj->GameData.CreateRole.Job = (Voc_ENUM)(TempObj->GameData.CreateRole.Job+1);
}

void    CreateRoleForm::OnTimeProc()
{
    
}
int     CreateRoleForm::ObjSize(  )
{
    GameObjDbStruct *P = NULL;
    int Size = sizeof( GameObjDbStruct ) - sizeof( P->Temp ) +  sizeof( P->CreateRole ) + 3;
    Size = Size & 0xfffffC;
    return Size;
}
void    CreateRoleForm::OnValueChange()
{
    DB_GameObjDbStruct __pin * TempObj = &_ObjDB;

	LB_EQ1->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[0] );
	LB_EQ2->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[1] );
	LB_EQ3->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[2] );
	LB_EQ4->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[3] );
	LB_EQ5->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[4] );
	LB_EQ6->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[5] );
	LB_EQ7->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[6] );
	LB_EQ8->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[7] );
	LB_EQ9->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[8] );
	LB_EQ10->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[9] );
	LB_EQ11->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[10] );
	LB_EQ12->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[11] );
	LB_EQ13->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[12] );
	LB_EQ14->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[13] );
	LB_EQ15->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[14] );
	LB_EQ16->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[15] );
	LB_EQ17->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[16] );
	LB_EQ18->Text = SearchObjName( TempObj->GameData.CreateRole.EQ.ID[17] );


	LB_Item1->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[0] );
	LB_Item2->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[1] );
	LB_Item3->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[2] );
	LB_Item4->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[3] );
	LB_Item5->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[4] );
	LB_Item6->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[5] );
	LB_Item7->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[6] );
	LB_Item8->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[7] );
	LB_Item9->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[8] );
	LB_Item10->Text = SearchObjName( TempObj->GameData.CreateRole.ItemID[9] );


	LB_EQPreview1->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[0] );
	LB_EQPreview2->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[1] );
	LB_EQPreview3->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[2] );
	LB_EQPreview4->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[3] );
	LB_EQPreview5->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[4] );
	LB_EQPreview6->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[5] );
	LB_EQPreview7->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[6] );
	LB_EQPreview8->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[7] );
	LB_EQPreview16->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[15] );
	LB_EQPreview17->Text = SearchObjName( TempObj->GameData.CreateRole.EQPreview.ID[16] );



}
//######################################################################################################

