Some Ui refactoring

dev-ui
erihel 2013-06-24 22:09:39 +02:00
parent 5c15855009
commit 41fa8458c2
30 changed files with 51 additions and 83 deletions

View File

@ -32,8 +32,6 @@
#include "object/robotmain.h" #include "object/robotmain.h"
#include "object/motion/motionhuman.h" #include "object/motion/motionhuman.h"
#include "ui/displaytext.h"
// Graphics module namespace // Graphics module namespace
namespace Gfx { namespace Gfx {
@ -49,7 +47,6 @@ CPyro::CPyro()
m_camera = m_main->GetCamera(); m_camera = m_main->GetCamera();
m_particle = m_engine->GetParticle(); m_particle = m_engine->GetParticle();
m_lightMan = m_engine->GetLightManager(); m_lightMan = m_engine->GetLightManager();
m_displayText = m_main->GetDisplayText();
m_sound = CApplication::GetInstancePointer()->GetSound(); m_sound = CApplication::GetInstancePointer()->GetSound();
m_object = nullptr; m_object = nullptr;
@ -1301,13 +1298,13 @@ void CPyro::DisplayError(PyroType type, CObject* obj)
oType == OBJECT_END ) oType == OBJECT_END )
{ {
err = ERR_DELETEBUILDING; err = ERR_DELETEBUILDING;
m_displayText->DisplayError(err, obj->GetPosition(0), 5.0f); m_main->DisplayError(err, obj->GetPosition(0), 5.0f);
return; return;
} }
if ( err != ERR_OK ) if ( err != ERR_OK )
{ {
m_displayText->DisplayError(err, obj); m_main->DisplayError(err, obj);
} }
} }
} }

View File

@ -35,10 +35,6 @@ class CObject;
class CRobotMain; class CRobotMain;
class CSoundInterface; class CSoundInterface;
namespace Ui {
class CDisplayText;
}
// Graphics module namespace // Graphics module namespace
namespace Gfx { namespace Gfx {
@ -179,7 +175,6 @@ protected:
CParticle* m_particle; CParticle* m_particle;
CLightManager* m_lightMan; CLightManager* m_lightMan;
CObject* m_object; CObject* m_object;
Ui::CDisplayText* m_displayText;
CRobotMain* m_main; CRobotMain* m_main;
CSoundInterface* m_sound; CSoundInterface* m_sound;

View File

@ -52,7 +52,6 @@ CAuto::CAuto(CObject* object)
m_lightning = m_engine->GetLightning(); m_lightning = m_engine->GetLightning();
m_camera = m_main->GetCamera(); m_camera = m_main->GetCamera();
m_interface = m_main->GetInterface(); m_interface = m_main->GetInterface();
m_displayText = m_main->GetDisplayText();
m_type = m_object->GetType(); m_type = m_object->GetType();
m_time = 0.0f; m_time = 0.0f;
@ -83,7 +82,6 @@ CAuto::~CAuto()
m_lightning = nullptr; m_lightning = nullptr;
m_camera = nullptr; m_camera = nullptr;
m_interface = nullptr; m_interface = nullptr;
m_displayText = nullptr;
} }

View File

@ -28,7 +28,6 @@ class CRobotMain;
class CSoundInterface; class CSoundInterface;
namespace Ui { namespace Ui {
class CDisplayText;
class CInterface; class CInterface;
class CWindow; class CWindow;
} /* Ui */ } /* Ui */
@ -101,7 +100,6 @@ protected:
Gfx::CLightning* m_lightning; Gfx::CLightning* m_lightning;
Gfx::CCamera* m_camera; Gfx::CCamera* m_camera;
Ui::CInterface* m_interface; Ui::CInterface* m_interface;
Ui::CDisplayText* m_displayText;
CRobotMain* m_main; CRobotMain* m_main;
CObject* m_object; CObject* m_object;
CSoundInterface* m_sound; CSoundInterface* m_sound;

View File

@ -34,7 +34,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
@ -317,14 +316,14 @@ begin:
err = CheckCloseDoor(); err = CheckCloseDoor();
if ( err != ERR_OK ) if ( err != ERR_OK )
{ {
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
return false; return false;
} }
err = m_main->CheckEndMission(false); err = m_main->CheckEndMission(false);
if ( err != ERR_OK ) if ( err != ERR_OK )
{ {
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
return false; return false;
} }

View File

@ -26,7 +26,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -515,7 +514,7 @@ void CAutoConvert::CreateMetal()
if ( !fret->CreateResource(pos, angle, OBJECT_METAL) ) if ( !fret->CreateResource(pos, angle, OBJECT_METAL) )
{ {
delete fret; delete fret;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return; return;
} }
@ -524,6 +523,6 @@ void CAutoConvert::CreateMetal()
fret->SetResetCap(RESET_DELETE); fret->SetResetCap(RESET_DELETE);
} }
m_displayText->DisplayError(INFO_CONVERT, m_object); m_main->DisplayError(INFO_CONVERT, m_object);
} }

View File

@ -28,7 +28,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -535,7 +534,7 @@ void CAutoDerrick::CreateFret(Math::Vector pos, float angle, ObjectType type,
if ( !fret->CreateResource(pos, angle, type) ) if ( !fret->CreateResource(pos, angle, type) )
{ {
delete fret; delete fret;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return; return;
} }
fret->SetLock(true); // object not yet usable fret->SetLock(true); // object not yet usable

View File

@ -24,7 +24,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -122,7 +121,7 @@ bool CAutoDestroyer::EventProcess(const Event &event)
{ {
Error err = StartAction(0); Error err = StartAction(0);
if ( err != ERR_OK ) if ( err != ERR_OK )
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
return false; return false;
} }

View File

@ -29,7 +29,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/gauge.h" #include "ui/gauge.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -325,7 +324,7 @@ bool CAutoEnergy::EventProcess(const Event &event)
fret->SetPosition(0, Math::Vector(0.0f, 3.0f, 0.0f)); fret->SetPosition(0, Math::Vector(0.0f, 3.0f, 0.0f));
m_object->SetPower(fret); m_object->SetPower(fret);
m_displayText->DisplayError(INFO_ENERGY, m_object); m_main->DisplayError(INFO_ENERGY, m_object);
} }
SetBusy(false); SetBusy(false);
@ -468,7 +467,7 @@ void CAutoEnergy::CreatePower()
if ( !power->CreateResource(pos, angle, OBJECT_POWER) ) if ( !power->CreateResource(pos, angle, OBJECT_POWER) )
{ {
delete power; delete power;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return; return;
} }
power->SetLock(true); // battery not yet usable power->SetLock(true); // battery not yet usable

View File

@ -32,7 +32,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -211,7 +210,7 @@ bool CAutoFactory::EventProcess(const Event &event)
Error err = StartAction(type); Error err = StartAction(type);
if( err != ERR_OK && err != ERR_GENERIC ) if( err != ERR_OK && err != ERR_GENERIC )
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
if( err != ERR_GENERIC ) if( err != ERR_GENERIC )
return false; return false;
@ -379,7 +378,7 @@ bool CAutoFactory::EventProcess(const Event &event)
} }
else else
{ {
m_displayText->DisplayError(INFO_FACTORY, m_object); m_main->DisplayError(INFO_FACTORY, m_object);
SoundManip(2.0f, 1.0f, 1.2f); SoundManip(2.0f, 1.0f, 1.2f);
fret = SearchFret(); // transform metal? fret = SearchFret(); // transform metal?
@ -678,7 +677,7 @@ bool CAutoFactory::CreateVehicle()
if ( !vehicle->CreateVehicle(pos, angle, m_type, -1.0f, false, false) ) if ( !vehicle->CreateVehicle(pos, angle, m_type, -1.0f, false, false) )
{ {
delete vehicle; delete vehicle;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return false; return false;
} }
vehicle->UpdateMapping(); vehicle->UpdateMapping();

View File

@ -29,7 +29,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -179,7 +178,7 @@ bool CAutoLabo::EventProcess(const Event &event)
if ( event.type == EVENT_OBJECT_RiGUN ) err = StartAction(RESEARCH_iGUN); if ( event.type == EVENT_OBJECT_RiGUN ) err = StartAction(RESEARCH_iGUN);
if( err != ERR_OK && err != ERR_GENERIC ) if( err != ERR_OK && err != ERR_GENERIC )
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
if( err != ERR_GENERIC ) if( err != ERR_GENERIC )
return false; return false;
@ -370,7 +369,7 @@ bool CAutoLabo::EventProcess(const Event &event)
delete power; delete power;
} }
m_displayText->DisplayError(INFO_LABO, m_object); m_main->DisplayError(INFO_LABO, m_object);
SoundManip(1.5f, 1.0f, 0.5f); SoundManip(1.5f, 1.0f, 0.5f);
m_phase = ALAP_CLOSE1; m_phase = ALAP_CLOSE1;

View File

@ -26,7 +26,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -274,7 +273,7 @@ bool CAutoNuclear::EventProcess(const Event &event)
SetBusy(false); SetBusy(false);
UpdateInterface(); UpdateInterface();
m_displayText->DisplayError(INFO_NUCLEAR, m_object); m_main->DisplayError(INFO_NUCLEAR, m_object);
m_phase = ANUP_WAIT; m_phase = ANUP_WAIT;
m_progress = 0.0f; m_progress = 0.0f;
@ -402,7 +401,7 @@ void CAutoNuclear::CreatePower()
if ( !power->CreateResource(pos, angle, OBJECT_ATOMIC) ) if ( !power->CreateResource(pos, angle, OBJECT_ATOMIC) )
{ {
delete power; delete power;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return; return;
} }

View File

@ -29,7 +29,6 @@
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/gauge.h" #include "ui/gauge.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/displaytext.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -178,7 +177,7 @@ bool CAutoResearch::EventProcess(const Event &event)
if ( event.type == EVENT_OBJECT_RATOMIC ) err = StartAction(RESEARCH_ATOMIC); if ( event.type == EVENT_OBJECT_RATOMIC ) err = StartAction(RESEARCH_ATOMIC);
if( err != ERR_OK && err != ERR_GENERIC ) if( err != ERR_OK && err != ERR_GENERIC )
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
if( err != ERR_GENERIC ) if( err != ERR_GENERIC )
return false; return false;
@ -257,7 +256,7 @@ bool CAutoResearch::EventProcess(const Event &event)
m_eventQueue->AddEvent(newEvent); m_eventQueue->AddEvent(newEvent);
UpdateInterface(); UpdateInterface();
m_displayText->DisplayError(INFO_RESEARCH, m_object); m_main->DisplayError(INFO_RESEARCH, m_object);
message = ERR_OK; message = ERR_OK;
if ( m_research == RESEARCH_TANK ) message = INFO_RESEARCHTANK; if ( m_research == RESEARCH_TANK ) message = INFO_RESEARCHTANK;
@ -270,7 +269,7 @@ bool CAutoResearch::EventProcess(const Event &event)
if ( m_research == RESEARCH_ATOMIC ) message = INFO_RESEARCHATOMIC; if ( m_research == RESEARCH_ATOMIC ) message = INFO_RESEARCHATOMIC;
if ( message != ERR_OK ) if ( message != ERR_OK )
{ {
m_displayText->DisplayError(message, m_object); m_main->DisplayError(message, m_object);
} }
SetBusy(false); SetBusy(false);

View File

@ -27,7 +27,6 @@
#include "script/cmdtoken.h" #include "script/cmdtoken.h"
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/displaytext.h"
#include "ui/window.h" #include "ui/window.h"
#include "ui/gauge.h" #include "ui/gauge.h"
@ -179,7 +178,7 @@ bool CAutoTower::EventProcess(const Event &event)
target = SearchTarget(m_targetPos); target = SearchTarget(m_targetPos);
if ( energy < ENERGY_FIRE ) if ( energy < ENERGY_FIRE )
{ {
m_displayText->DisplayError(ERR_TOWER_ENERGY, m_object); m_main->DisplayError(ERR_TOWER_ENERGY, m_object);
} }
if ( target == 0 || energy < ENERGY_FIRE ) if ( target == 0 || energy < ENERGY_FIRE )
{ {

View File

@ -35,7 +35,6 @@
#include "sound/sound.h" #include "sound/sound.h"
#include "ui/displaytext.h"
#include "ui/interface.h" #include "ui/interface.h"
#include "ui/slider.h" #include "ui/slider.h"
#include "ui/studio.h" #include "ui/studio.h"
@ -61,7 +60,6 @@ CBrain::CBrain(CObject* object)
m_terrain = m_main->GetTerrain(); m_terrain = m_main->GetTerrain();
m_camera = m_main->GetCamera(); m_camera = m_main->GetCamera();
m_interface = m_main->GetInterface(); m_interface = m_main->GetInterface();
m_displayText = m_main->GetDisplayText();
m_sound = CApplication::GetInstancePointer()->GetSound(); m_sound = CApplication::GetInstancePointer()->GetSound();
m_physics = nullptr; m_physics = nullptr;
m_motion = nullptr; m_motion = nullptr;
@ -733,7 +731,7 @@ bool CBrain::EventProcess(const Event &event)
if ( err != ERR_OK ) if ( err != ERR_OK )
{ {
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
} }
return true; return true;
@ -1201,7 +1199,7 @@ void CBrain::GroundFlat()
err = ERR_FLAG_FLY; err = ERR_FLAG_FLY;
pos = m_object->GetPosition(0); pos = m_object->GetPosition(0);
if ( pos.y < m_water->GetLevel() ) err = ERR_FLAG_WATER; if ( pos.y < m_water->GetLevel() ) err = ERR_FLAG_WATER;
m_displayText->DisplayError(err, m_object); m_main->DisplayError(err, m_object);
return; return;
} }

View File

@ -43,7 +43,6 @@ namespace Ui {
class CStudio; class CStudio;
class CInterface; class CInterface;
class CWindow; class CWindow;
class CDisplayText;
} }
namespace Gfx { namespace Gfx {
@ -177,7 +176,6 @@ protected:
CPhysics* m_physics; CPhysics* m_physics;
CMotion* m_motion; CMotion* m_motion;
Ui::CInterface* m_interface; Ui::CInterface* m_interface;
Ui::CDisplayText* m_displayText;
CRobotMain* m_main; CRobotMain* m_main;
Ui::CStudio* m_studio; Ui::CStudio* m_studio;
CSoundInterface* m_sound; CSoundInterface* m_sound;

View File

@ -79,8 +79,6 @@
#include "script/cbottoken.h" #include "script/cbottoken.h"
#include "script/cmdtoken.h" #include "script/cmdtoken.h"
#include "ui/displaytext.h"
#define ADJUST_ONBOARD false // true -> adjusts the camera ONBOARD #define ADJUST_ONBOARD false // true -> adjusts the camera ONBOARD
@ -228,7 +226,6 @@ CObject::CObject()
m_main = CRobotMain::GetInstancePointer(); m_main = CRobotMain::GetInstancePointer();
m_terrain = m_main->GetTerrain(); m_terrain = m_main->GetTerrain();
m_camera = m_main->GetCamera(); m_camera = m_main->GetCamera();
m_displayText = m_main->GetDisplayText();
m_physics = nullptr; m_physics = nullptr;
m_brain = nullptr; m_brain = nullptr;
m_motion = nullptr; m_motion = nullptr;
@ -5988,7 +5985,7 @@ bool CObject::EventFrame(const Event &event)
m_sound->Play(SOUND_FINDING); m_sound->Play(SOUND_FINDING);
pyro = new Gfx::CPyro(); pyro = new Gfx::CPyro();
pyro->Create(Gfx::PT_FINDING, this, 0.0f); pyro->Create(Gfx::PT_FINDING, this, 0.0f);
m_displayText->DisplayError(INFO_FINDING, this); m_main->DisplayError(INFO_FINDING, this);
} }
} }
@ -6639,7 +6636,7 @@ void CObject::SetSelect(bool bMode, bool bDisplayError)
} }
if ( err != ERR_OK && bDisplayError ) if ( err != ERR_OK && bDisplayError )
{ {
m_displayText->DisplayError(err, this); m_main->DisplayError(err, this);
} }
} }

View File

@ -38,10 +38,6 @@ class CRobotMain;
class CBotVar; class CBotVar;
class CScript; class CScript;
namespace Ui {
class CDisplayText;
}
/** /**
* \enum ObjectType * \enum ObjectType
@ -689,7 +685,6 @@ protected:
CBrain* m_brain; CBrain* m_brain;
CMotion* m_motion; CMotion* m_motion;
CAuto* m_auto; CAuto* m_auto;
Ui::CDisplayText* m_displayText;
CRobotMain* m_main; CRobotMain* m_main;
CSoundInterface* m_sound; CSoundInterface* m_sound;
CBotVar* m_botVar; CBotVar* m_botVar;

View File

@ -7520,3 +7520,12 @@ void CRobotMain::RestoreNumericLocale()
setlocale(LC_NUMERIC, m_oldLocale.c_str()); setlocale(LC_NUMERIC, m_oldLocale.c_str());
} }
void CRobotMain::DisplayError(Error err, CObject* pObj, float time)
{
m_displayText->DisplayError(err, pObj, time);
}
void CRobotMain::DisplayError(Error err, Math::Vector goal, float height, float dist, float time)
{
m_displayText->DisplayError(err, goal, height, dist, time);
}

View File

@ -379,6 +379,9 @@ public:
CObject* GetSelect(); CObject* GetSelect();
void DisplayError(Error err, CObject* pObj, float time=10.0f);
void DisplayError(Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f);
protected: protected:
bool EventFrame(const Event &event); bool EventFrame(const Event &event);
bool EventObject(const Event &event); bool EventObject(const Event &event);

View File

@ -35,7 +35,6 @@ CTask::CTask(CObject* object)
m_main = CRobotMain::GetInstancePointer(); m_main = CRobotMain::GetInstancePointer();
m_terrain = m_main->GetTerrain(); m_terrain = m_main->GetTerrain();
m_camera = m_main->GetCamera(); m_camera = m_main->GetCamera();
m_displayText = m_main->GetDisplayText();
m_object = object; m_object = object;
m_physics = m_object->GetPhysics(); m_physics = m_object->GetPhysics();

View File

@ -32,9 +32,6 @@ class CObject;
class CRobotMain; class CRobotMain;
class CSoundInterface; class CSoundInterface;
namespace Ui {
class CDisplayText;
} /* Ui */
namespace Gfx { namespace Gfx {
class CEngine; class CEngine;
@ -84,7 +81,6 @@ protected:
CPhysics* m_physics; CPhysics* m_physics;
CObject* m_object; CObject* m_object;
CRobotMain* m_main; CRobotMain* m_main;
Ui::CDisplayText* m_displayText;
CSoundInterface* m_sound; CSoundInterface* m_sound;
}; };

View File

@ -33,8 +33,6 @@
#include "physics/physics.h" #include "physics/physics.h"
#include "ui/displaytext.h"
#include <string.h> #include <string.h>
// Object's constructor. // Object's constructor.
@ -264,7 +262,7 @@ bool CTaskBuild::EventProcess(const Event &event)
m_camera->FlushEffect(); m_camera->FlushEffect();
Abort(); Abort();
m_bError = true; m_bError = true;
m_displayText->DisplayError(ERR_TOOMANY, m_object->GetPosition(0)); m_main->DisplayError(ERR_TOOMANY, m_object->GetPosition(0));
return false; return false;
} }
CreateLight(); CreateLight();
@ -486,7 +484,7 @@ Error CTaskBuild::IsEnded()
m_building->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f)); m_building->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
m_building->SetLock(false); // building usable m_building->SetLock(false); // building usable
m_main->CreateShortcuts(); m_main->CreateShortcuts();
m_displayText->DisplayError(INFO_BUILD, m_buildingPos, 10.0f, 50.0f); m_main->DisplayError(INFO_BUILD, m_buildingPos, 10.0f, 50.0f);
automat = m_building->GetAuto(); automat = m_building->GetAuto();
if ( automat != 0 ) if ( automat != 0 )

View File

@ -27,7 +27,7 @@
#include "physics/physics.h" #include "physics/physics.h"
#include "ui/displaytext.h" #include "object/robotmain.h"
const float ENERGY_RECOVER = 0.25f; // energy consumed by recovery const float ENERGY_RECOVER = 0.25f; // energy consumed by recovery
@ -305,7 +305,7 @@ Error CTaskRecover::IsEnded()
m_metal = 0; m_metal = 0;
Abort(); Abort();
m_bError = true; m_bError = true;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return ERR_STOP; return ERR_STOP;
} }
m_metal->SetLock(true); // metal not yet usable m_metal->SetLock(true); // metal not yet usable

View File

@ -26,9 +26,7 @@
#include "physics/physics.h" #include "physics/physics.h"
#include "ui/displaytext.h" #include "object/robotmain.h"
// Object's constructor. // Object's constructor.
@ -293,11 +291,11 @@ bool CTaskSearch::CreateMark()
if ( !fret->CreateResource(pos, 0.0f, type) ) if ( !fret->CreateResource(pos, 0.0f, type) )
{ {
delete fret; delete fret;
m_displayText->DisplayError(ERR_TOOMANY, m_object); m_main->DisplayError(ERR_TOOMANY, m_object);
return false; return false;
} }
m_displayText->DisplayError(info, pos, 5.0f, 50.0f); // displays the message m_main->DisplayError(info, pos, 5.0f, 50.0f); // displays the message
return true; return true;
} }

View File

@ -26,6 +26,7 @@
#include "math/geometry.h" #include "math/geometry.h"
#include "object/brain.h" #include "object/brain.h"
#include "object/robotmain.h"
#include "physics/physics.h" #include "physics/physics.h"

View File

@ -28,6 +28,7 @@
#include "math/geometry.h" #include "math/geometry.h"
#include "object/brain.h" #include "object/brain.h"
#include "object/robotmain.h"
#include "object/motion/motionant.h" #include "object/motion/motionant.h"
#include "object/motion/motionspider.h" #include "object/motion/motionspider.h"

View File

@ -20,7 +20,7 @@
#include "graphics/engine/terrain.h" #include "graphics/engine/terrain.h"
#include "physics/physics.h" #include "physics/physics.h"
#include "object/robotmain.h"
// Object's constructor. // Object's constructor.

View File

@ -3174,7 +3174,7 @@ bool CScript::rMessage(CBotVar* var, CBotVar* result, int& exception, void* user
type = static_cast<Ui::TextType>(var->GetValInt()); type = static_cast<Ui::TextType>(var->GetValInt());
} }
script->m_displayText->DisplayText(p, script->m_object, 10.0f, type); script->m_main->GetDisplayText()->DisplayText(p, script->m_object, 10.0f, type);
script->m_main->CheckEndMessage(p); script->m_main->CheckEndMessage(p);
return true; return true;
@ -3504,7 +3504,6 @@ CScript::CScript(CObject* object, CTaskManager** secondaryTask)
m_secondaryTask = secondaryTask; m_secondaryTask = secondaryTask;
m_interface = m_main->GetInterface(); m_interface = m_main->GetInterface();
m_displayText = m_main->GetDisplayText();
m_ipf = CBOT_IPF; m_ipf = CBOT_IPF;
m_errMode = ERM_STOP; m_errMode = ERM_STOP;
@ -3899,7 +3898,7 @@ bool CScript::Continue(const Event &event)
{ {
char s[100]; char s[100];
GetError(s); GetError(s);
m_displayText->DisplayText(s, m_object, 10.0f, Ui::TT_ERROR); m_main->GetDisplayText()->DisplayText(s, m_object, 10.0f, Ui::TT_ERROR);
} }
m_engine->SetPause(true); // gives pause m_engine->SetPause(true); // gives pause
return true; return true;
@ -3932,7 +3931,7 @@ bool CScript::Continue(const Event &event)
{ {
char s[100]; char s[100];
GetError(s); GetError(s);
m_displayText->DisplayText(s, m_object, 10.0f, Ui::TT_ERROR); m_main->GetDisplayText()->DisplayText(s, m_object, 10.0f, Ui::TT_ERROR);
} }
return true; return true;
} }
@ -3974,7 +3973,7 @@ bool CScript::Step(const Event &event)
{ {
char s[100]; char s[100];
GetError(s); GetError(s);
m_displayText->DisplayText(s, m_object, 10.0f, Ui::TT_ERROR); m_main->GetDisplayText()->DisplayText(s, m_object, 10.0f, Ui::TT_ERROR);
} }
return true; return true;
} }

View File

@ -34,7 +34,6 @@ class CTaskManager;
class CRobotMain; class CRobotMain;
namespace Ui{ namespace Ui{
class CDisplayText;
class CEdit; class CEdit;
class CInterface; class CInterface;
class CList; class CList;
@ -210,7 +209,6 @@ private:
protected: protected:
Gfx::CEngine* m_engine; Gfx::CEngine* m_engine;
Ui::CInterface* m_interface; Ui::CInterface* m_interface;
Ui::CDisplayText* m_displayText;
CBotProgram* m_botProg; CBotProgram* m_botProg;
CRobotMain* m_main; CRobotMain* m_main;
Gfx::CTerrain* m_terrain; Gfx::CTerrain* m_terrain;