Add trainer=1 BotFactory
parent
5e606336ca
commit
d0e29d4875
|
@ -661,6 +661,7 @@ bool CAutoFactory::CreateVehicle()
|
||||||
params.angle = angle;
|
params.angle = angle;
|
||||||
params.type = m_type;
|
params.type = m_type;
|
||||||
params.team = m_object->GetTeam();
|
params.team = m_object->GetTeam();
|
||||||
|
params.trainer = m_object->GetTrainer();
|
||||||
CObject* vehicle = CObjectManager::GetInstancePointer()->CreateObject(params);
|
CObject* vehicle = CObjectManager::GetInstancePointer()->CreateObject(params);
|
||||||
|
|
||||||
vehicle->SetLock(true); // not usable
|
vehicle->SetLock(true); // not usable
|
||||||
|
@ -719,84 +720,86 @@ bool CAutoFactory::CreateInterface(bool bSelect)
|
||||||
|
|
||||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||||
if ( pw == nullptr ) return false;
|
if ( pw == nullptr ) return false;
|
||||||
|
|
||||||
dim.x = 33.0f/640.0f;
|
dim.x = 33.0f/640.0f;
|
||||||
dim.y = 33.0f/480.0f;
|
dim.y = 33.0f/480.0f;
|
||||||
ox = 3.0f/640.0f;
|
ox = 3.0f/640.0f;
|
||||||
oy = 3.0f/480.0f;
|
oy = 3.0f/480.0f;
|
||||||
sx = 33.0f/640.0f;
|
sx = 33.0f/640.0f;
|
||||||
sy = 33.0f/480.0f;
|
sy = 33.0f/480.0f;
|
||||||
|
if( !m_object->GetTrainer() )
|
||||||
|
{
|
||||||
|
pos.x = 0.0f;
|
||||||
|
pos.y = oy+sy*2.6f;
|
||||||
|
ddim.x = 138.0f/640.0f;
|
||||||
|
ddim.y = 258.0f/480.0f;
|
||||||
|
pw->CreateGroup(pos, ddim, 6, EVENT_WINDOW3);
|
||||||
|
|
||||||
pos.x = 0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*2.6f;
|
pos.y = oy+sy*9.3f;
|
||||||
ddim.x = 138.0f/640.0f;
|
pw->CreateButton(pos, dim, 128+9, EVENT_OBJECT_FACTORYwa);
|
||||||
ddim.y = 258.0f/480.0f;
|
pos.x += dim.x;
|
||||||
pw->CreateGroup(pos, ddim, 6, EVENT_WINDOW3);
|
pw->CreateButton(pos, dim, 128+10, EVENT_OBJECT_FACTORYta);
|
||||||
|
pos.x += dim.x;
|
||||||
|
pw->CreateButton(pos, dim, 128+11, EVENT_OBJECT_FACTORYfa);
|
||||||
|
pos.x += dim.x;
|
||||||
|
pw->CreateButton(pos, dim, 128+22, EVENT_OBJECT_FACTORYia);
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*9.3f;
|
pos.y = oy+sy*8.2f;
|
||||||
pw->CreateButton(pos, dim, 128+9, EVENT_OBJECT_FACTORYwa);
|
pw->CreateButton(pos, dim, 128+12, EVENT_OBJECT_FACTORYws);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+10, EVENT_OBJECT_FACTORYta);
|
pw->CreateButton(pos, dim, 128+13, EVENT_OBJECT_FACTORYts);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+11, EVENT_OBJECT_FACTORYfa);
|
pw->CreateButton(pos, dim, 128+14, EVENT_OBJECT_FACTORYfs);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+22, EVENT_OBJECT_FACTORYia);
|
pw->CreateButton(pos, dim, 128+24, EVENT_OBJECT_FACTORYis);
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*8.2f;
|
pos.y = oy+sy*7.1f;
|
||||||
pw->CreateButton(pos, dim, 128+12, EVENT_OBJECT_FACTORYws);
|
pw->CreateButton(pos, dim, 128+15, EVENT_OBJECT_FACTORYwc);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+13, EVENT_OBJECT_FACTORYts);
|
pw->CreateButton(pos, dim, 128+16, EVENT_OBJECT_FACTORYtc);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+14, EVENT_OBJECT_FACTORYfs);
|
pw->CreateButton(pos, dim, 128+17, EVENT_OBJECT_FACTORYfc);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+24, EVENT_OBJECT_FACTORYis);
|
pw->CreateButton(pos, dim, 128+23, EVENT_OBJECT_FACTORYic);
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*7.1f;
|
pos.y = oy+sy*6.0f;
|
||||||
pw->CreateButton(pos, dim, 128+15, EVENT_OBJECT_FACTORYwc);
|
pw->CreateButton(pos, dim, 128+25, EVENT_OBJECT_FACTORYwi);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+16, EVENT_OBJECT_FACTORYtc);
|
pw->CreateButton(pos, dim, 128+26, EVENT_OBJECT_FACTORYti);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+17, EVENT_OBJECT_FACTORYfc);
|
pw->CreateButton(pos, dim, 128+27, EVENT_OBJECT_FACTORYfi);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+23, EVENT_OBJECT_FACTORYic);
|
pw->CreateButton(pos, dim, 128+28, EVENT_OBJECT_FACTORYii);
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
|
||||||
pos.y = oy+sy*6.0f;
|
|
||||||
pw->CreateButton(pos, dim, 128+25, EVENT_OBJECT_FACTORYwi);
|
|
||||||
pos.x += dim.x;
|
|
||||||
pw->CreateButton(pos, dim, 128+26, EVENT_OBJECT_FACTORYti);
|
|
||||||
pos.x += dim.x;
|
|
||||||
pw->CreateButton(pos, dim, 128+27, EVENT_OBJECT_FACTORYfi);
|
|
||||||
pos.x += dim.x;
|
|
||||||
pw->CreateButton(pos, dim, 128+28, EVENT_OBJECT_FACTORYii);
|
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*4.9f;
|
pos.y = oy+sy*4.9f;
|
||||||
pw->CreateButton(pos, dim, 192+0, EVENT_OBJECT_FACTORYwb);
|
pw->CreateButton(pos, dim, 192+0, EVENT_OBJECT_FACTORYwb);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 192+1, EVENT_OBJECT_FACTORYtb);
|
pw->CreateButton(pos, dim, 192+1, EVENT_OBJECT_FACTORYtb);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 192+2, EVENT_OBJECT_FACTORYfb);
|
pw->CreateButton(pos, dim, 192+2, EVENT_OBJECT_FACTORYfb);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 192+3, EVENT_OBJECT_FACTORYib);
|
pw->CreateButton(pos, dim, 192+3, EVENT_OBJECT_FACTORYib);
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*3.8f;
|
pos.y = oy+sy*3.8f;
|
||||||
pw->CreateButton(pos, dim, 128+18, EVENT_OBJECT_FACTORYrt);
|
pw->CreateButton(pos, dim, 128+18, EVENT_OBJECT_FACTORYrt);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+19, EVENT_OBJECT_FACTORYrc);
|
pw->CreateButton(pos, dim, 128+19, EVENT_OBJECT_FACTORYrc);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+20, EVENT_OBJECT_FACTORYrr);
|
pw->CreateButton(pos, dim, 128+20, EVENT_OBJECT_FACTORYrr);
|
||||||
pos.x += dim.x;
|
pos.x += dim.x;
|
||||||
pw->CreateButton(pos, dim, 128+29, EVENT_OBJECT_FACTORYrs);
|
pw->CreateButton(pos, dim, 128+29, EVENT_OBJECT_FACTORYrs);
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
|
||||||
pos.y = oy+sy*2.7f;
|
|
||||||
pw->CreateButton(pos, dim, 128+21, EVENT_OBJECT_FACTORYsa);
|
|
||||||
|
|
||||||
|
pos.x = ox+sx*0.0f;
|
||||||
|
pos.y = oy+sy*2.7f;
|
||||||
|
pw->CreateButton(pos, dim, 128+21, EVENT_OBJECT_FACTORYsa);
|
||||||
|
}
|
||||||
|
|
||||||
pos.x = ox+sx*0.0f;
|
pos.x = ox+sx*0.0f;
|
||||||
pos.y = oy+sy*0;
|
pos.y = oy+sy*0;
|
||||||
ddim.x = 66.0f/640.0f;
|
ddim.x = 66.0f/640.0f;
|
||||||
|
|
|
@ -64,6 +64,7 @@ std::unique_ptr<CBaseBuilding> CBaseBuilding::Create(
|
||||||
{
|
{
|
||||||
auto obj = MakeUnique<CBaseBuilding>(params.id, params.type);
|
auto obj = MakeUnique<CBaseBuilding>(params.id, params.type);
|
||||||
|
|
||||||
|
obj->SetTrainer(params.trainer);
|
||||||
obj->SetTeam(params.team);
|
obj->SetTeam(params.team);
|
||||||
|
|
||||||
float height = params.height;
|
float height = params.height;
|
||||||
|
|
Loading…
Reference in New Issue