2010-04-15 23:16:13 +02:00
|
|
|
|
// ==============================================================
|
|
|
|
|
// This file is part of Glest (www.glest.org)
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2001-2008 Marti<74>o Figueroa
|
|
|
|
|
//
|
2010-12-24 03:10:31 +01:00
|
|
|
|
// You can redistribute this code and/or modify it under
|
|
|
|
|
// the terms of the GNU General Public License as published
|
|
|
|
|
// by the Free Software Foundation; either version 2 of the
|
2010-04-15 23:16:13 +02:00
|
|
|
|
// License, or (at your option) any later version
|
|
|
|
|
// ==============================================================
|
|
|
|
|
|
|
|
|
|
#ifndef _GLEST_GAME_CHATMANAGER_H_
|
|
|
|
|
#define _GLEST_GAME_CHATMANAGER_H_
|
|
|
|
|
|
|
|
|
|
#include <string>
|
2010-12-27 01:59:57 +01:00
|
|
|
|
#include "font.h"
|
2010-09-07 07:25:40 +02:00
|
|
|
|
#include "leak_dumper.h"
|
2010-04-15 23:16:13 +02:00
|
|
|
|
|
|
|
|
|
using std::string;
|
2010-12-27 01:59:57 +01:00
|
|
|
|
using Shared::Graphics::Font2D;
|
2010-04-15 23:16:13 +02:00
|
|
|
|
|
|
|
|
|
namespace Glest{ namespace Game{
|
|
|
|
|
|
|
|
|
|
class Console;
|
|
|
|
|
|
|
|
|
|
// =====================================================
|
|
|
|
|
// class ChatManager
|
|
|
|
|
// =====================================================
|
|
|
|
|
|
|
|
|
|
class ChatManager{
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool editEnabled;
|
|
|
|
|
bool teamMode;
|
2010-05-15 20:59:17 +02:00
|
|
|
|
bool disableTeamMode;
|
2010-04-15 23:16:13 +02:00
|
|
|
|
Console* console;
|
|
|
|
|
string text;
|
|
|
|
|
int thisTeamIndex;
|
2010-06-09 00:50:37 +02:00
|
|
|
|
bool inMenu;
|
2010-12-24 03:10:31 +01:00
|
|
|
|
string manualPlayerNameOverride;
|
2010-12-27 01:59:57 +01:00
|
|
|
|
int xPos;
|
|
|
|
|
int yPos;
|
|
|
|
|
int maxTextLenght;
|
|
|
|
|
Font2D *font;
|
|
|
|
|
|
2010-04-15 23:16:13 +02:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ChatManager();
|
2010-12-24 03:10:31 +01:00
|
|
|
|
void init(Console* console, int thisTeamIndex, const bool inMenu=false, string manualPlayerNameOverride="");
|
2010-04-15 23:16:13 +02:00
|
|
|
|
|
|
|
|
|
void keyDown(char key);
|
|
|
|
|
void keyUp(char key);
|
|
|
|
|
void keyPress(char c);
|
|
|
|
|
void updateNetwork();
|
|
|
|
|
|
|
|
|
|
bool getEditEnabled() const {return editEnabled;}
|
|
|
|
|
bool getTeamMode() const {return teamMode;}
|
|
|
|
|
string getText() const {return text;}
|
2010-12-27 01:59:57 +01:00
|
|
|
|
int getXPos() const {return xPos;}
|
|
|
|
|
void setXPos(int xPos) {this->xPos= xPos;}
|
|
|
|
|
int getYPos() const {return yPos;}
|
|
|
|
|
void setYPos(int yPos) {this->yPos= yPos;}
|
|
|
|
|
int getMaxTextLenght() const {return maxTextLenght;}
|
|
|
|
|
void setMaxTextLenght(int maxTextLenght) {this->maxTextLenght= maxTextLenght;}
|
|
|
|
|
Font2D *getFont() const {return font;}
|
|
|
|
|
void setFont(Font2D *font) {this->font= font;}
|
|
|
|
|
void addText(string text);
|
|
|
|
|
void switchOnEdit();
|
|
|
|
|
|
2010-05-15 20:59:17 +02:00
|
|
|
|
|
|
|
|
|
bool getDisableTeamMode() const { return disableTeamMode; }
|
|
|
|
|
void setDisableTeamMode(bool value);
|
2010-04-15 23:16:13 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}}//end namespace
|
|
|
|
|
|
|
|
|
|
#endif
|