114 lines
3.1 KiB
C++
114 lines
3.1 KiB
C++
/*
|
||
* This file is part of the Colobot: Gold Edition source code
|
||
* Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam
|
||
* http://epsiteс.ch; http://colobot.info; http://github.com/colobot
|
||
*
|
||
* This program is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation, either version 3 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* This program is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||
* See the GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with this program. If not, see http://gnu.org/licenses
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include "common/event.h"
|
||
|
||
class COldObject;
|
||
class CTaskExecutorObject;
|
||
class CProgrammableObject;
|
||
class CPhysics;
|
||
class CMotion;
|
||
class CRobotMain;
|
||
class CSoundInterface;
|
||
class CLevelParserLine;
|
||
struct Program;
|
||
|
||
namespace Gfx
|
||
{
|
||
class CEngine;
|
||
class CTerrain;
|
||
class CWater;
|
||
class CCamera;
|
||
class CParticle;
|
||
} /* Gfx */
|
||
|
||
namespace Ui
|
||
{
|
||
class CStudio;
|
||
class CInterface;
|
||
class CWindow;
|
||
|
||
|
||
class CObjectInterface
|
||
{
|
||
public:
|
||
CObjectInterface(COldObject* object);
|
||
~CObjectInterface();
|
||
|
||
void DeleteObject(bool bAll=false);
|
||
|
||
bool EventProcess(const Event &event);
|
||
bool CreateInterface(bool bSelect);
|
||
|
||
void UpdateInterface(float rTime);
|
||
void UpdateInterface();
|
||
|
||
protected:
|
||
bool EventFrame(const Event &event);
|
||
|
||
void StartEditScript(Program* program, char* name);
|
||
void StopEditScript(bool bCancel);
|
||
|
||
void GroundFlat();
|
||
void ColorFlag(int color);
|
||
|
||
void UpdateScript(CWindow *pw);
|
||
int GetSelScript();
|
||
void SetSelScript(int index);
|
||
void BlinkScript(bool bEnable);
|
||
|
||
void CheckInterface(CWindow *pw, EventType event, bool bState);
|
||
void EnableInterface(CWindow *pw, EventType event, bool bState);
|
||
void DeadInterface(CWindow *pw, EventType event, bool bState);
|
||
void DefaultEnter(CWindow *pw, EventType event, bool bState=true);
|
||
|
||
protected:
|
||
Gfx::CEngine* m_engine;
|
||
Gfx::CTerrain* m_terrain;
|
||
Gfx::CWater* m_water;
|
||
Gfx::CCamera* m_camera;
|
||
Gfx::CParticle* m_particle;
|
||
CRobotMain* m_main;
|
||
CInterface* m_interface;
|
||
CSoundInterface* m_sound;
|
||
|
||
COldObject* m_object;
|
||
CTaskExecutorObject* m_taskExecutor;
|
||
CProgrammableObject* m_programmable;
|
||
CPhysics* m_physics;
|
||
CMotion* m_motion;
|
||
|
||
std::unique_ptr<CStudio> m_studio;
|
||
|
||
int m_selScript; // rank of the selected script
|
||
|
||
EventType m_manipStyle;
|
||
EventType m_defaultEnter;
|
||
|
||
float m_time;
|
||
float m_lastUpdateTime;
|
||
float m_lastAlarmTime;
|
||
int m_soundChannelAlarm;
|
||
int m_flagColor;
|
||
};
|
||
|
||
} // namespace Ui
|