switch for map preview in ingame options

some language fixes
faction preview is default now
in unix systems text is better centered on the buttons
This commit is contained in:
Titus Tscharntke 2010-09-26 21:34:00 +00:00
parent e6ade03509
commit d3ccebef15
7 changed files with 35 additions and 10 deletions

View File

@ -81,7 +81,8 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
NetworkManager &networkManager= NetworkManager::getInstance();
Config &config = Config::getInstance();
defaultPlayerName = config.getString("NetPlayerName",Socket::getHostName().c_str());
enableFactionTexturePreview = config.getBool("FactionPreview","false");
enableFactionTexturePreview = config.getBool("FactionPreview","true");
enableMapPreview = config.getBool("MapPreview","true");
vector<string> teamItems, controlItems, results;
int setupPos=590;
@ -599,7 +600,7 @@ void MenuStateConnectedGame::render() {
if(program != NULL) program->renderProgramMsgBox();
if(mapPreview.hasFileLoaded() == true) {
if(enableMapPreview && (mapPreview.hasFileLoaded() == true)) {
int mouseX = mainMenu->getMouseX();
int mouseY = mainMenu->getMouseY();

View File

@ -115,6 +115,7 @@ private:
string defaultPlayerName;
bool enableFactionTexturePreview;
bool enableMapPreview;
string currentFactionLogo;
Texture2D *factionTexture;

View File

@ -62,7 +62,8 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b
NetworkManager &networkManager= NetworkManager::getInstance();
Config &config = Config::getInstance();
defaultPlayerName = config.getString("NetPlayerName",Socket::getHostName().c_str());
enableFactionTexturePreview = config.getBool("FactionPreview","false");
enableFactionTexturePreview = config.getBool("FactionPreview","true");
enableMapPreview = config.getBool("MapPreview","true");
showFullConsole=false;
@ -1097,7 +1098,7 @@ void MenuStateCustomGame::render() {
if(program != NULL) program->renderProgramMsgBox();
if(mapPreview.hasFileLoaded() == true) {
if(enableMapPreview && (mapPreview.hasFileLoaded() == true)) {
int mouseX = mainMenu->getMouseX();
int mouseY = mainMenu->getMouseY();

View File

@ -127,6 +127,7 @@ private:
int8 switchSetupRequestFlagType;
bool enableFactionTexturePreview;
bool enableMapPreview;
string currentFactionLogo;
Texture2D *factionTexture;

View File

@ -38,8 +38,8 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos);
activeInputLabel=NULL;
int leftline=670;
int rightline=670;
int leftline=700;
int rightline=700;
int leftLabelStart=250;
int leftColumnStart=leftLabelStart+150;
int rightLabelStart=500;
@ -64,7 +64,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
labelSoundFactory.setText(lang.get("SoundAndMusic"));
listBoxSoundFactory.registerGraphicComponent(containerName,"listBoxSoundFactory");
listBoxSoundFactory.init(leftColumnStart, leftline, 80);
listBoxSoundFactory.init(leftColumnStart, leftline, 100);
listBoxSoundFactory.pushBackItem("None");
listBoxSoundFactory.pushBackItem("OpenAL");
#ifdef WIN32
@ -276,6 +276,18 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
listBoxUnitParticles.setSelectedItemIndex(clamp(config.getBool("UnitParticles"), 0, 1));
leftline-=30;
//unit particles
labelMapPreview.registerGraphicComponent(containerName,"labelMapPreview");
labelMapPreview.init(leftLabelStart,leftline);
labelMapPreview.setText(lang.get("ShowMapPreview"));
listBoxMapPreview.registerGraphicComponent(containerName,"listBoxMapPreview");
listBoxMapPreview.init(leftColumnStart,leftline,80);
listBoxMapPreview.pushBackItem(lang.get("No"));
listBoxMapPreview.pushBackItem(lang.get("Yes"));
listBoxMapPreview.setSelectedItemIndex(clamp(config.getBool("MapPreview","true"), 0, 1));
leftline-=30;
// buttons
buttonOk.registerGraphicComponent(containerName,"buttonOk");
buttonOk.init(200, buttonRowPos, 100);
@ -291,7 +303,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
buttonVideoInfo.setText(lang.get("VideoInfo"));
buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo");
buttonVideoInfo.init(620, buttonRowPos, 100);
buttonVideoInfo.init(620, buttonRowPos, 125);
GraphicComponent::applyAllCustomProperties(containerName);
}
@ -393,6 +405,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
listBoxFilter.mouseClick(x, y);
listBoxTextures3D.mouseClick(x, y);
listBoxUnitParticles.mouseClick(x, y);
listBoxMapPreview.mouseClick(x, y);
listBoxLights.mouseClick(x, y);
listBoxSoundFactory.mouseClick(x, y);
listBoxVolumeFx.mouseClick(x, y);
@ -422,6 +435,7 @@ void MenuStateOptions::mouseMove(int x, int y, const MouseState *ms){
listBoxShadows.mouseMove(x, y);
listBoxTextures3D.mouseMove(x, y);
listBoxUnitParticles.mouseMove(x, y);
listBoxMapPreview.mouseMove(x, y);
listBoxLights.mouseMove(x, y);
listBoxScreenModes.mouseMove(x, y);
listFontSizeAdjustment.mouseMove(x, y);
@ -482,6 +496,7 @@ void MenuStateOptions::render(){
renderer.renderListBox(&listBoxShadows);
renderer.renderListBox(&listBoxTextures3D);
renderer.renderListBox(&listBoxUnitParticles);
renderer.renderListBox(&listBoxMapPreview);
renderer.renderListBox(&listBoxLights);
renderer.renderListBox(&listBoxFilter);
renderer.renderListBox(&listBoxSoundFactory);
@ -494,6 +509,7 @@ void MenuStateOptions::render(){
renderer.renderLabel(&labelShadows);
renderer.renderLabel(&labelTextures3D);
renderer.renderLabel(&labelUnitParticles);
renderer.renderLabel(&labelMapPreview);
renderer.renderLabel(&labelLights);
renderer.renderLabel(&labelFilter);
renderer.renderLabel(&labelSoundFactory);
@ -536,6 +552,7 @@ void MenuStateOptions::saveConfig(){
config.setString("Filter", listBoxFilter.getSelectedItem());
config.setBool("Textures3D", listBoxTextures3D.getSelectedItemIndex());
config.setBool("UnitParticles", listBoxUnitParticles.getSelectedItemIndex());
config.setBool("MapPreview", listBoxMapPreview.getSelectedItemIndex());
config.setInt("MaxLights", listBoxLights.getSelectedItemIndex()+1);
config.setString("FactorySound", listBoxSoundFactory.getSelectedItem());
config.setString("SoundVolumeFx", listBoxVolumeFx.getSelectedItem());

View File

@ -70,6 +70,9 @@ private:
GraphicLabel labelFontSizeAdjustment;
GraphicListBox listFontSizeAdjustment;
GraphicLabel labelMapPreview;
GraphicListBox listBoxMapPreview;
GraphicMessageBox mainMessageBox;
int mainMessageBoxState;

View File

@ -56,8 +56,9 @@ void createGlFontBitmaps(uint32 &base, const string &type, int size, int width,
} else {
int p = i - fontInfo->min_char_or_byte2;
metrics.setWidth(i, static_cast<float> (
fontInfo->per_char[p].rbearing
- fontInfo->per_char[p].lbearing));
fontInfo->per_char[p].width));
// fontInfo->per_char[p].rbearing
// - fontInfo->per_char[p].lbearing));
}
}