diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index b6a799fe..11a19fe9 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -332,7 +332,11 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu): buttonVideoInfo.setText(lang.get("VideoInfo")); buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo"); - buttonVideoInfo.init(620, buttonRowPos, 125); + buttonVideoInfo.init(585, buttonRowPos, 125); // was 620 + + buttonKeyboardSetup.setText(lang.get("Keyboard")); + buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup"); + buttonKeyboardSetup.init(720, buttonRowPos, 125); GraphicComponent::applyAllCustomProperties(containerName); } @@ -424,6 +428,11 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){ soundRenderer.playFx(coreData.getClickSoundA()); mainMenu->setState(new MenuStateGraphicInfo(program, mainMenu)); } + else if(buttonKeyboardSetup.mouseClick(x, y)){ + soundRenderer.playFx(coreData.getClickSoundA()); +// mainMenu->setState(new MenuStateKeyboardSetup(program, mainMenu)); // open keyboard shortcuts setup screen + showMessageBox("Not implemented yet", "Keyboard setup", false); + } else if(labelPlayerName.mouseClick(x, y) && ( activeInputLabel != &labelPlayerName )){ setActiveInputLable(&labelPlayerName); } @@ -455,6 +464,7 @@ void MenuStateOptions::mouseMove(int x, int y, const MouseState *ms){ buttonAbort.mouseMove(x, y); buttonAutoConfig.mouseMove(x, y); buttonVideoInfo.mouseMove(x, y); + buttonKeyboardSetup.mouseMove(x, y); listBoxLang.mouseMove(x, y); listBoxSoundFactory.mouseMove(x, y); listBoxVolumeFx.mouseMove(x, y); @@ -488,9 +498,13 @@ void MenuStateOptions::keyDown(char key){ void MenuStateOptions::keyPress(char c){ if(activeInputLabel!=NULL) { + //printf("[%d]\n",c); fflush(stdout); int maxTextSize= 16; if(&labelPlayerName==activeInputLabel){ if((c>='0' && c<='9')||(c>='a' && c<='z')||(c>='A' && c<='Z')|| + // (c>=(192-256) && c<=(255-256))|| // test some support for accented letters in names, is this ok? (latin1 signed char) + // no master server breaks, and a russian translation with game switched to KOI-8p encoding? probably irc too. + // (use Shared::Platform::charSet in shared_lib/include/platform/sdl/gl_wrap.h ?) (c=='-')||(c=='(')||(c==')')){ if(activeInputLabel->getText().size()getText(); @@ -523,6 +537,7 @@ void MenuStateOptions::render(){ renderer.renderButton(&buttonAbort); renderer.renderButton(&buttonAutoConfig); renderer.renderButton(&buttonVideoInfo); + renderer.renderButton(&buttonKeyboardSetup); renderer.renderListBox(&listBoxLang); renderer.renderListBox(&listBoxShadows); renderer.renderListBox(&listBoxTextures3D); diff --git a/source/glest_game/menu/menu_state_options.h b/source/glest_game/menu/menu_state_options.h index 09087ee0..75330b43 100644 --- a/source/glest_game/menu/menu_state_options.h +++ b/source/glest_game/menu/menu_state_options.h @@ -3,9 +3,9 @@ // // Copyright (C) 2001-2005 Marti�o Figueroa // -// 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 +// 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 // License, or (at your option) any later version // ============================================================== @@ -18,17 +18,18 @@ namespace Glest{ namespace Game{ // =============================== -// class MenuStateOptions +// class MenuStateOptions // =============================== class MenuStateOptions: public MenuState{ private: - GraphicButton buttonOk; + GraphicButton buttonOk; GraphicButton buttonAbort; - GraphicButton buttonAutoConfig; + GraphicButton buttonAutoConfig; GraphicButton buttonVideoInfo; - + GraphicButton buttonKeyboardSetup; // configure the keyboard + GraphicLabel labelLang; GraphicLabel labelShadows; GraphicLabel labelFilter; @@ -54,31 +55,31 @@ private: GraphicLabel *activeInputLabel; GraphicLabel labelServerPort; GraphicLabel labelServerPortLabel; - - + + GraphicLabel labelScreenModes; GraphicListBox listBoxScreenModes; list modeInfos; - + GraphicLabel labelFullscreenWindowed; GraphicListBox listBoxFullscreenWindowed; - + GraphicLabel labelVideoSection; GraphicLabel labelAudioSection; GraphicLabel labelMiscSection; - + GraphicLabel labelFontSizeAdjustment; GraphicListBox listFontSizeAdjustment; - + GraphicLabel labelMapPreview; GraphicListBox listBoxMapPreview; - + GraphicMessageBox mainMessageBox; int mainMessageBoxState; - + GraphicLabel labelPublishServerExternalPort; GraphicListBox listBoxPublishServerExternalPort; - + public: MenuStateOptions(Program *program, MainMenu *mainMenu); @@ -88,7 +89,7 @@ public: void render(); virtual void keyDown(char key); virtual void keyPress(char c); - + private: void saveConfig(); diff --git a/source/glest_map_editor/icons.h b/source/glest_map_editor/icons.h index 86ebcb61..1cde5f49 100644 --- a/source/glest_map_editor/icons.h +++ b/source/glest_map_editor/icons.h @@ -80,7 +80,7 @@ #include "icons/brush_resource_5.xpm" #include "icons/edit_randomize-heights.xpm" -#include "icons/edit_randomize.xpm" +// #include "icons/edit_randomize.xpm" #include "icons/edit_redo.xpm" #include "icons/edit_switch-surfaces.xpm" #include "icons/edit_undo.xpm" diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index 4baeb032..ece3b438 100755 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -593,7 +593,7 @@ void MainWindow::onMenuEditResize(wxCommandEvent &event) { simpleDialog.addValue("Height", intToStr(program->getMap()->getH()),"(must be 16,32,64,128,256,512...)"); simpleDialog.addValue("Surface", "1","(surface material for new area around map)"); simpleDialog.addValue("Altitude", "10","(surface height for new area around map)"); - if (!simpleDialog.show("Resze - expand around, shrink to topleft")) return; + if (!simpleDialog.show("Resize - expand around, shrink to topleft")) return; try { program->resize( @@ -750,11 +750,13 @@ void MainWindow::onMenuViewAbout(wxCommandEvent &event) { void MainWindow::onMenuViewHelp(wxCommandEvent &event) { MsgDialog(this, - wxT("Draw with left mouse\nMove viewport with right mouse drag\nZoom with center mouse drag, or mousewheel\n\ + wxT("Draw with left mouse\nMove viewport with right mouse drag\nZoom with center mouse drag, or mousewheel\n\n\ You can change brush in the same category with key 1-9\n\ +and change category with their first letter (keys S, R, O, G, H)\n\ +Press Space to set brush to the resource or object under the mouse cursor\n\ To center things in the map shift it with Shift-Up/Down/Left/Right keys\n\ Height tool (blue) builds with integer height steps 0-20, \nwhile Gradient tool (red) uses any real number \n\ -Units can go over water as long as it is less than 1.5 deep\n\ +Units can go over water as long as it is less than 1.5 deep\n\n\ A good idea is to put some stone, gold and tree near starting position\n\ Starting position needs an open area for the tower and the starting units\n"), wxT("Help")).ShowModal(); diff --git a/source/glest_map_editor/program.h b/source/glest_map_editor/program.h index 83b30d20..92e35e4a 100644 --- a/source/glest_map_editor/program.h +++ b/source/glest_map_editor/program.h @@ -74,7 +74,7 @@ class UndoPoint { class ChangeStack : public std::stack { public: - static const int maxSize = 100; + static const unsigned int maxSize = 100; void clear() { c.clear(); } diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index 920385de..6683043a 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -379,7 +379,7 @@ void MapPreview::changeObject(int x, int y, int object, int radius) { for (j = y - radius + 1; j < y + radius; j++) { if (inside(i, j)) { dist = get_dist(i - x, j - y); - if (radius >= dist) { + if (radius > dist) { // was >= cells[i][j].object = object; cells[i][j].resource = 0; } @@ -401,7 +401,7 @@ void MapPreview::changeResource(int x, int y, int resource, int radius) { for (j = y - radius + 1; j < y + radius; j++) { if (inside(i, j)) { dist = get_dist(i - x, j - y); - if (radius >= dist) { + if (radius > dist) { // was >= cells[i][j].resource = resource; cells[i][j].object = 0; }