mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 13:23:59 +02:00
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:
@@ -81,7 +81,8 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
|
|||||||
NetworkManager &networkManager= NetworkManager::getInstance();
|
NetworkManager &networkManager= NetworkManager::getInstance();
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
defaultPlayerName = config.getString("NetPlayerName",Socket::getHostName().c_str());
|
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;
|
vector<string> teamItems, controlItems, results;
|
||||||
int setupPos=590;
|
int setupPos=590;
|
||||||
@@ -599,7 +600,7 @@ void MenuStateConnectedGame::render() {
|
|||||||
if(program != NULL) program->renderProgramMsgBox();
|
if(program != NULL) program->renderProgramMsgBox();
|
||||||
|
|
||||||
|
|
||||||
if(mapPreview.hasFileLoaded() == true) {
|
if(enableMapPreview && (mapPreview.hasFileLoaded() == true)) {
|
||||||
|
|
||||||
int mouseX = mainMenu->getMouseX();
|
int mouseX = mainMenu->getMouseX();
|
||||||
int mouseY = mainMenu->getMouseY();
|
int mouseY = mainMenu->getMouseY();
|
||||||
|
@@ -115,6 +115,7 @@ private:
|
|||||||
string defaultPlayerName;
|
string defaultPlayerName;
|
||||||
|
|
||||||
bool enableFactionTexturePreview;
|
bool enableFactionTexturePreview;
|
||||||
|
bool enableMapPreview;
|
||||||
string currentFactionLogo;
|
string currentFactionLogo;
|
||||||
Texture2D *factionTexture;
|
Texture2D *factionTexture;
|
||||||
|
|
||||||
|
@@ -62,7 +62,8 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b
|
|||||||
NetworkManager &networkManager= NetworkManager::getInstance();
|
NetworkManager &networkManager= NetworkManager::getInstance();
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
defaultPlayerName = config.getString("NetPlayerName",Socket::getHostName().c_str());
|
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;
|
showFullConsole=false;
|
||||||
|
|
||||||
@@ -1097,7 +1098,7 @@ void MenuStateCustomGame::render() {
|
|||||||
|
|
||||||
if(program != NULL) program->renderProgramMsgBox();
|
if(program != NULL) program->renderProgramMsgBox();
|
||||||
|
|
||||||
if(mapPreview.hasFileLoaded() == true) {
|
if(enableMapPreview && (mapPreview.hasFileLoaded() == true)) {
|
||||||
|
|
||||||
int mouseX = mainMenu->getMouseX();
|
int mouseX = mainMenu->getMouseX();
|
||||||
int mouseY = mainMenu->getMouseY();
|
int mouseY = mainMenu->getMouseY();
|
||||||
|
@@ -127,6 +127,7 @@ private:
|
|||||||
int8 switchSetupRequestFlagType;
|
int8 switchSetupRequestFlagType;
|
||||||
|
|
||||||
bool enableFactionTexturePreview;
|
bool enableFactionTexturePreview;
|
||||||
|
bool enableMapPreview;
|
||||||
string currentFactionLogo;
|
string currentFactionLogo;
|
||||||
Texture2D *factionTexture;
|
Texture2D *factionTexture;
|
||||||
|
|
||||||
|
@@ -38,8 +38,8 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
|||||||
Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos);
|
Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos);
|
||||||
activeInputLabel=NULL;
|
activeInputLabel=NULL;
|
||||||
|
|
||||||
int leftline=670;
|
int leftline=700;
|
||||||
int rightline=670;
|
int rightline=700;
|
||||||
int leftLabelStart=250;
|
int leftLabelStart=250;
|
||||||
int leftColumnStart=leftLabelStart+150;
|
int leftColumnStart=leftLabelStart+150;
|
||||||
int rightLabelStart=500;
|
int rightLabelStart=500;
|
||||||
@@ -64,7 +64,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
|||||||
labelSoundFactory.setText(lang.get("SoundAndMusic"));
|
labelSoundFactory.setText(lang.get("SoundAndMusic"));
|
||||||
|
|
||||||
listBoxSoundFactory.registerGraphicComponent(containerName,"listBoxSoundFactory");
|
listBoxSoundFactory.registerGraphicComponent(containerName,"listBoxSoundFactory");
|
||||||
listBoxSoundFactory.init(leftColumnStart, leftline, 80);
|
listBoxSoundFactory.init(leftColumnStart, leftline, 100);
|
||||||
listBoxSoundFactory.pushBackItem("None");
|
listBoxSoundFactory.pushBackItem("None");
|
||||||
listBoxSoundFactory.pushBackItem("OpenAL");
|
listBoxSoundFactory.pushBackItem("OpenAL");
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -276,6 +276,18 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
|||||||
listBoxUnitParticles.setSelectedItemIndex(clamp(config.getBool("UnitParticles"), 0, 1));
|
listBoxUnitParticles.setSelectedItemIndex(clamp(config.getBool("UnitParticles"), 0, 1));
|
||||||
leftline-=30;
|
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
|
// buttons
|
||||||
buttonOk.registerGraphicComponent(containerName,"buttonOk");
|
buttonOk.registerGraphicComponent(containerName,"buttonOk");
|
||||||
buttonOk.init(200, buttonRowPos, 100);
|
buttonOk.init(200, buttonRowPos, 100);
|
||||||
@@ -291,7 +303,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
|||||||
|
|
||||||
buttonVideoInfo.setText(lang.get("VideoInfo"));
|
buttonVideoInfo.setText(lang.get("VideoInfo"));
|
||||||
buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo");
|
buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo");
|
||||||
buttonVideoInfo.init(620, buttonRowPos, 100);
|
buttonVideoInfo.init(620, buttonRowPos, 125);
|
||||||
|
|
||||||
GraphicComponent::applyAllCustomProperties(containerName);
|
GraphicComponent::applyAllCustomProperties(containerName);
|
||||||
}
|
}
|
||||||
@@ -393,6 +405,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
|
|||||||
listBoxFilter.mouseClick(x, y);
|
listBoxFilter.mouseClick(x, y);
|
||||||
listBoxTextures3D.mouseClick(x, y);
|
listBoxTextures3D.mouseClick(x, y);
|
||||||
listBoxUnitParticles.mouseClick(x, y);
|
listBoxUnitParticles.mouseClick(x, y);
|
||||||
|
listBoxMapPreview.mouseClick(x, y);
|
||||||
listBoxLights.mouseClick(x, y);
|
listBoxLights.mouseClick(x, y);
|
||||||
listBoxSoundFactory.mouseClick(x, y);
|
listBoxSoundFactory.mouseClick(x, y);
|
||||||
listBoxVolumeFx.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);
|
listBoxShadows.mouseMove(x, y);
|
||||||
listBoxTextures3D.mouseMove(x, y);
|
listBoxTextures3D.mouseMove(x, y);
|
||||||
listBoxUnitParticles.mouseMove(x, y);
|
listBoxUnitParticles.mouseMove(x, y);
|
||||||
|
listBoxMapPreview.mouseMove(x, y);
|
||||||
listBoxLights.mouseMove(x, y);
|
listBoxLights.mouseMove(x, y);
|
||||||
listBoxScreenModes.mouseMove(x, y);
|
listBoxScreenModes.mouseMove(x, y);
|
||||||
listFontSizeAdjustment.mouseMove(x, y);
|
listFontSizeAdjustment.mouseMove(x, y);
|
||||||
@@ -482,6 +496,7 @@ void MenuStateOptions::render(){
|
|||||||
renderer.renderListBox(&listBoxShadows);
|
renderer.renderListBox(&listBoxShadows);
|
||||||
renderer.renderListBox(&listBoxTextures3D);
|
renderer.renderListBox(&listBoxTextures3D);
|
||||||
renderer.renderListBox(&listBoxUnitParticles);
|
renderer.renderListBox(&listBoxUnitParticles);
|
||||||
|
renderer.renderListBox(&listBoxMapPreview);
|
||||||
renderer.renderListBox(&listBoxLights);
|
renderer.renderListBox(&listBoxLights);
|
||||||
renderer.renderListBox(&listBoxFilter);
|
renderer.renderListBox(&listBoxFilter);
|
||||||
renderer.renderListBox(&listBoxSoundFactory);
|
renderer.renderListBox(&listBoxSoundFactory);
|
||||||
@@ -494,6 +509,7 @@ void MenuStateOptions::render(){
|
|||||||
renderer.renderLabel(&labelShadows);
|
renderer.renderLabel(&labelShadows);
|
||||||
renderer.renderLabel(&labelTextures3D);
|
renderer.renderLabel(&labelTextures3D);
|
||||||
renderer.renderLabel(&labelUnitParticles);
|
renderer.renderLabel(&labelUnitParticles);
|
||||||
|
renderer.renderLabel(&labelMapPreview);
|
||||||
renderer.renderLabel(&labelLights);
|
renderer.renderLabel(&labelLights);
|
||||||
renderer.renderLabel(&labelFilter);
|
renderer.renderLabel(&labelFilter);
|
||||||
renderer.renderLabel(&labelSoundFactory);
|
renderer.renderLabel(&labelSoundFactory);
|
||||||
@@ -536,6 +552,7 @@ void MenuStateOptions::saveConfig(){
|
|||||||
config.setString("Filter", listBoxFilter.getSelectedItem());
|
config.setString("Filter", listBoxFilter.getSelectedItem());
|
||||||
config.setBool("Textures3D", listBoxTextures3D.getSelectedItemIndex());
|
config.setBool("Textures3D", listBoxTextures3D.getSelectedItemIndex());
|
||||||
config.setBool("UnitParticles", listBoxUnitParticles.getSelectedItemIndex());
|
config.setBool("UnitParticles", listBoxUnitParticles.getSelectedItemIndex());
|
||||||
|
config.setBool("MapPreview", listBoxMapPreview.getSelectedItemIndex());
|
||||||
config.setInt("MaxLights", listBoxLights.getSelectedItemIndex()+1);
|
config.setInt("MaxLights", listBoxLights.getSelectedItemIndex()+1);
|
||||||
config.setString("FactorySound", listBoxSoundFactory.getSelectedItem());
|
config.setString("FactorySound", listBoxSoundFactory.getSelectedItem());
|
||||||
config.setString("SoundVolumeFx", listBoxVolumeFx.getSelectedItem());
|
config.setString("SoundVolumeFx", listBoxVolumeFx.getSelectedItem());
|
||||||
|
@@ -70,6 +70,9 @@ private:
|
|||||||
GraphicLabel labelFontSizeAdjustment;
|
GraphicLabel labelFontSizeAdjustment;
|
||||||
GraphicListBox listFontSizeAdjustment;
|
GraphicListBox listFontSizeAdjustment;
|
||||||
|
|
||||||
|
GraphicLabel labelMapPreview;
|
||||||
|
GraphicListBox listBoxMapPreview;
|
||||||
|
|
||||||
GraphicMessageBox mainMessageBox;
|
GraphicMessageBox mainMessageBox;
|
||||||
int mainMessageBoxState;
|
int mainMessageBoxState;
|
||||||
|
|
||||||
|
@@ -56,8 +56,9 @@ void createGlFontBitmaps(uint32 &base, const string &type, int size, int width,
|
|||||||
} else {
|
} else {
|
||||||
int p = i - fontInfo->min_char_or_byte2;
|
int p = i - fontInfo->min_char_or_byte2;
|
||||||
metrics.setWidth(i, static_cast<float> (
|
metrics.setWidth(i, static_cast<float> (
|
||||||
fontInfo->per_char[p].rbearing
|
fontInfo->per_char[p].width));
|
||||||
- fontInfo->per_char[p].lbearing));
|
// fontInfo->per_char[p].rbearing
|
||||||
|
// - fontInfo->per_char[p].lbearing));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user