some rearrangement in options, player names in chat with colors again
This commit is contained in:
parent
d9bc605974
commit
df2df4bcfc
|
@ -46,16 +46,36 @@ void Console::addStdMessage(const string &s) {
|
||||||
addLine(Lang::getInstance().get(s));
|
addLine(Lang::getInstance().get(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::addLine(string line, bool playSound,int playerIndex, Vec3f textColor) {
|
void Console::addLine(string line, bool playSound, int playerIndex, Vec3f textColor) {
|
||||||
try {
|
try {
|
||||||
string playername="";
|
if(playSound == true) {
|
||||||
|
SoundRenderer::getInstance().playFx(CoreData::getInstance().getClickSoundA());
|
||||||
|
}
|
||||||
|
ConsoleLineInfo info;
|
||||||
|
info.text = line;
|
||||||
|
info.timeStamp = timeElapsed;
|
||||||
|
info.PlayerIndex = playerIndex;
|
||||||
|
info.originalPlayerName = "";
|
||||||
|
info.color = textColor;
|
||||||
if(playerIndex >= 0) {
|
if(playerIndex >= 0) {
|
||||||
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
||||||
if(gameNetworkInterface != NULL) {
|
if(gameNetworkInterface != NULL) {
|
||||||
playername=gameNetworkInterface->getGameSettings()->getNetworkPlayerNameByPlayerIndex(playerIndex);
|
info.originalPlayerName = gameNetworkInterface->getGameSettings()->getNetworkPlayerNameByPlayerIndex(playerIndex);
|
||||||
|
//for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
||||||
|
// printf("i = %d, playerName = [%s]\n",i,gameNetworkInterface->getGameSettings()->getNetworkPlayerName(i).c_str());
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addLine(line, playSound,playername, textColor);
|
//printf("info.PlayerIndex = %d, line [%s]\n",info.PlayerIndex,info.originalPlayerName.c_str());
|
||||||
|
|
||||||
|
lines.insert(lines.begin(), info);
|
||||||
|
if(lines.size() > maxLines) {
|
||||||
|
lines.pop_back();
|
||||||
|
}
|
||||||
|
storedLines.insert(storedLines.begin(), info);
|
||||||
|
if(storedLines.size() > maxStoredLines) {
|
||||||
|
storedLines.pop_back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(const exception &ex) {
|
catch(const exception &ex) {
|
||||||
char szBuf[1024]="";
|
char szBuf[1024]="";
|
||||||
|
|
|
@ -39,11 +39,12 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
||||||
Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos);
|
Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos);
|
||||||
activeInputLabel=NULL;
|
activeInputLabel=NULL;
|
||||||
|
|
||||||
int leftLabelStart=150;
|
int leftLabelStart=130;
|
||||||
int leftColumnStart=leftLabelStart+150;
|
int leftColumnStart=leftLabelStart+150;
|
||||||
int rightLabelStart=550;
|
int rightLabelStart=530;
|
||||||
int rightColumnStart=rightLabelStart+150;
|
int rightColumnStart=rightLabelStart+200;
|
||||||
int buttonRowPos=80;
|
int buttonRowPos=80;
|
||||||
|
int buttonStartPos=170;
|
||||||
int captionOffset=75;
|
int captionOffset=75;
|
||||||
int currentLabelStart=leftLabelStart;
|
int currentLabelStart=leftLabelStart;
|
||||||
int currentColumnStart=leftColumnStart;
|
int currentColumnStart=leftColumnStart;
|
||||||
|
@ -273,6 +274,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
||||||
labelPlayerName.registerGraphicComponent(containerName,"labelPlayerName");
|
labelPlayerName.registerGraphicComponent(containerName,"labelPlayerName");
|
||||||
labelPlayerName.init(currentColumnStart,currentLine);
|
labelPlayerName.init(currentColumnStart,currentLine);
|
||||||
labelPlayerName.setText(config.getString("NetPlayerName",Socket::getHostName().c_str()));
|
labelPlayerName.setText(config.getString("NetPlayerName",Socket::getHostName().c_str()));
|
||||||
|
labelPlayerName.setFont(CoreData::getInstance().getMenuFontBig());
|
||||||
currentLine-=30;
|
currentLine-=30;
|
||||||
|
|
||||||
//FontSizeAdjustment
|
//FontSizeAdjustment
|
||||||
|
@ -414,24 +416,24 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
buttonOk.registerGraphicComponent(containerName,"buttonOk");
|
buttonOk.registerGraphicComponent(containerName,"buttonOk");
|
||||||
buttonOk.init(200, buttonRowPos, 100);
|
buttonOk.init(buttonStartPos, buttonRowPos, 100);
|
||||||
buttonOk.setText(lang.get("Ok"));
|
buttonOk.setText(lang.get("Ok"));
|
||||||
buttonAbort.setText(lang.get("Abort"));
|
buttonAbort.setText(lang.get("Abort"));
|
||||||
|
|
||||||
buttonAbort.registerGraphicComponent(containerName,"buttonAbort");
|
buttonAbort.registerGraphicComponent(containerName,"buttonAbort");
|
||||||
buttonAbort.init(310, buttonRowPos, 100);
|
buttonAbort.init(buttonStartPos+110, buttonRowPos, 100);
|
||||||
buttonAutoConfig.setText(lang.get("AutoConfig"));
|
buttonAutoConfig.setText(lang.get("AutoConfig"));
|
||||||
|
|
||||||
buttonAutoConfig.registerGraphicComponent(containerName,"buttonAutoConfig");
|
buttonAutoConfig.registerGraphicComponent(containerName,"buttonAutoConfig");
|
||||||
buttonAutoConfig.init(450, buttonRowPos, 125);
|
buttonAutoConfig.init(buttonStartPos+250, buttonRowPos, 125);
|
||||||
|
|
||||||
buttonVideoInfo.setText(lang.get("VideoInfo"));
|
buttonVideoInfo.setText(lang.get("VideoInfo"));
|
||||||
buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo");
|
buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo");
|
||||||
buttonVideoInfo.init(585, buttonRowPos, 125); // was 620
|
buttonVideoInfo.init(buttonStartPos+385, buttonRowPos, 125); // was 620
|
||||||
|
|
||||||
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
|
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
|
||||||
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
|
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
|
||||||
buttonKeyboardSetup.init(720, buttonRowPos, 125);
|
buttonKeyboardSetup.init(buttonStartPos+520, buttonRowPos, 125);
|
||||||
|
|
||||||
GraphicComponent::applyAllCustomProperties(containerName);
|
GraphicComponent::applyAllCustomProperties(containerName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue