Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/3rdparty/glm b/3rdparty/glm
- index d162eee1e..13724cfae 160000
- --- a/3rdparty/glm
- +++ b/3rdparty/glm
- @@ -1 +1 @@
- -Subproject commit d162eee1e6f7c317a09229fe6ceab8ec6ab9a4b4
- +Subproject commit 13724cfae64a8b5313d1cabc9a963d2c9dbeda12
- diff --git a/3rdparty/miniupnp b/3rdparty/miniupnp
- index 564464efd..927e2f366 160000
- --- a/3rdparty/miniupnp
- +++ b/3rdparty/miniupnp
- @@ -1 +1 @@
- -Subproject commit 564464efdbb7ab3a5982ebc411879ec84114129f
- +Subproject commit 927e2f36666f543d59a8080686921069832a3393-dirty
- diff --git a/3rdparty/sha b/3rdparty/sha
- --- a/3rdparty/sha
- +++ b/3rdparty/sha
- @@ -1 +1 @@
- -Subproject commit 4b9e13ead2c5b5e41ca27c65de4dd69ae0bac228
- +Subproject commit 4b9e13ead2c5b5e41ca27c65de4dd69ae0bac228-dirty
- diff --git a/3rdparty/utf8proc b/3rdparty/utf8proc
- --- a/3rdparty/utf8proc
- +++ b/3rdparty/utf8proc
- @@ -1 +1 @@
- -Subproject commit 5c632c57426f2e4246e3b64dd2fd088d3920f9e5
- +Subproject commit 5c632c57426f2e4246e3b64dd2fd088d3920f9e5-dirty
- diff --git a/3rdparty/utfcpp b/3rdparty/utfcpp
- index 170e2d11f..c3f9261eb 160000
- --- a/3rdparty/utfcpp
- +++ b/3rdparty/utfcpp
- @@ -1 +1 @@
- -Subproject commit 170e2d11f516539d18bf39f552fa204dbf41d9ce
- +Subproject commit c3f9261eb8e793fa6c6a62309d3a3942ee03486a
- diff --git a/src/cheat.cpp b/src/cheat.cpp
- index 2c0136b52..d62bc209e 100644
- --- a/src/cheat.cpp
- +++ b/src/cheat.cpp
- @@ -77,6 +77,7 @@ static CHEAT_ENTRY cheatCodes[] =
- {"work harder", kf_FinishResearch},
- {"tileinfo", kf_TileInfo}, // output debug info about a tile
- {"showfps", kf_ToggleFPS}, //displays your average FPS
- + {"showkills", kf_ToggleKillCount}, //displays your kills
- {"showsamples", kf_ToggleSamples}, //displays the # of Sound samples in Queue & List
- {"showorders", kf_ToggleOrders}, //displays unit order/action state.
- {"pause", kf_TogglePauseMode}, // Pause the game.
- @@ -100,6 +101,11 @@ bool attemptCheatCode(const char *cheat_name)
- kf_ToggleFPS();
- return true;
- }
- + if (!strcasecmp("showkills", cheat_name))
- + {
- + kf_ToggleKillCount();
- + return true;
- + }
- if (strcmp(cheat_name, "cheat on") == 0 || strcmp(cheat_name, "debug") == 0)
- {
- diff --git a/src/configuration.cpp b/src/configuration.cpp
- index 6faf6571e..4098aa838 100644
- --- a/src/configuration.cpp
- +++ b/src/configuration.cpp
- @@ -113,6 +113,7 @@ bool loadConfig()
- wz_texture_compression = false;
- }
- showFPS = ini.value("showFPS", false).toBool();
- + showKILLCOUNT = ini.value("showKILLCOUNT", false).toBool();
- if (ini.contains("cameraSpeed"))
- {
- war_SetCameraSpeed(ini.value("cameraSpeed").toInt());
- @@ -258,6 +259,7 @@ bool saveConfig()
- ini.setValue("RightClickOrders", (SDWORD)(getRightClickOrders()));
- ini.setValue("MiddleClickRotate", (SDWORD)(getMiddleClickRotate()));
- ini.setValue("showFPS", (SDWORD)showFPS);
- + ini.setValue("showKILLCOUNT", (SDWORD)showKILLCOUNT);
- ini.setValue("shadows", (SDWORD)(getDrawShadows())); // shadows
- ini.setValue("sound", (SDWORD)war_getSoundEnabled());
- ini.setValue("FMVmode", (SDWORD)(war_GetFMVmode())); // sequences
- diff --git a/src/console.cpp b/src/console.cpp
- index 291bcbe51..e99011546 100644
- --- a/src/console.cpp
- +++ b/src/console.cpp
- @@ -175,7 +175,16 @@ bool addConsoleMessage(const char *Text, CONSOLE_TEXT_JUSTIFICATION jusType, SDW
- return false; // Don't allow it to be added if we've disabled adding of new messages
- }
- - std::istringstream stream(Text);
- + time_t current_time;
- + time(¤t_time);
- + struct tm time_info;
- + gmtime_r(¤t_time, &time_info);
- + char time_str[9];
- + ssprintf(time_str, "%d:%d", time_info.tm_hour, time_info.tm_min);
- + char buff2[2048]; // can be not enough to fit all message?
- + ssprintf(buff2, "[%s] %s", time_str, Text);
- +
- + std::istringstream stream(buff2);
- std::string lines;
- while (std::getline(stream, lines))
- diff --git a/src/display3d.cpp b/src/display3d.cpp
- index 6bbf5dbe8..3cb8d09bb 100644
- --- a/src/display3d.cpp
- +++ b/src/display3d.cpp
- @@ -79,6 +79,7 @@
- #include "order.h"
- #include "scores.h"
- #include "multiplay.h"
- +#include "multistat.h"
- #include "advvis.h"
- #include "cmddroid.h"
- #include "terrain.h"
- @@ -128,6 +129,7 @@ static WzText txtLevelName;
- static WzText txtDebugStatus;
- static WzText txtCurrentTime;
- static WzText txtShowFPS;
- +static WzText txtKills;
- // show Samples text
- static WzText txtShowSamples_Que;
- static WzText txtShowSamples_Lst;
- @@ -228,6 +230,10 @@ bool showFPS = false; //
- /** Show how many samples we are rendering per second
- * default OFF, turn ON via console command 'showsamples'
- */
- +bool showKILLCOUNT = false;
- +/** Show how many kills/deaths (produced units) made
- + * default OFF, turn ON via console command 'showkills'
- + */
- bool showSAMPLES = false;
- /** Show the current selected units order / action
- * default OFF, turn ON via console command 'showorders'
- @@ -821,6 +827,17 @@ void draw3DScene()
- const unsigned height = txtShowFPS.height();
- txtShowFPS.render(pie_GetVideoBufferWidth() - width, pie_GetVideoBufferHeight() - height, WZCOL_TEXT_BRIGHT);
- }
- + if (showKILLCOUNT)
- + {
- + char *killdiff;
- + unsigned int UnitsLost = missionData.unitsLost;
- + unsigned int UnitsKilled = bMultiPlayer ? getMultiStats(selectedPlayer).recentKills : missionData.unitsKilled;
- + unsigned int UnitsBuilt = missionData.unitsBuilt;
- + double KDRaito = (double)UnitsKilled / (double)UnitsLost;
- + sasprintf(&killdiff, "Kills: %d/%d %f (%d)", UnitsKilled, UnitsLost, KDRaito, UnitsBuilt);
- + txtKills.setText(killdiff, font_regular);
- + txtKills.render(pie_GetVideoBufferWidth() - txtKills.width() + 10 - 100, pie_GetVideoBufferHeight() - txtKills.height(), WZCOL_TEXT_BRIGHT);
- + }
- if (showORDERS)
- {
- unsigned int height;
- diff --git a/src/display3d.h b/src/display3d.h
- index 66438c016..d94d6bda1 100644
- --- a/src/display3d.h
- +++ b/src/display3d.h
- @@ -54,6 +54,7 @@ struct iView
- };
- extern bool showFPS;
- +extern bool showKILLCOUNT;
- extern bool showSAMPLES;
- extern bool showORDERS;
- diff --git a/src/frontend.cpp b/src/frontend.cpp
- index 63ed36f33..8ce39d180 100644
- --- a/src/frontend.cpp
- +++ b/src/frontend.cpp
- @@ -51,6 +51,7 @@
- #include "configuration.h"
- #include "difficulty.h"
- #include "display.h"
- +#include "display3d.h"
- #include "droid.h"
- #include "frend.h"
- #include "frontend.h"
- @@ -101,6 +102,7 @@ bool bLimiterLoaded = false;
- // Forward definitions
- static W_BUTTON * addSmallTextButton(UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt, unsigned int style);
- +void addText(UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt, UDWORD formID);
- // ////////////////////////////////////////////////////////////////////////////
- // Helper functions
- @@ -665,6 +667,7 @@ static bool startOptionsMenu()
- addTextButton(FRONTEND_MOUSEOPTIONS, FRONTEND_POS6X, FRONTEND_POS6Y, _("Mouse Options"), WBUT_TXTCENTRE);
- addTextButton(FRONTEND_KEYMAP, FRONTEND_POS7X, FRONTEND_POS7Y, _("Key Mappings"), WBUT_TXTCENTRE);
- addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI);
- + addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_UPGRDLINK, 60, 7, MULTIOP_BUTW, MULTIOP_BUTH, _("All enemies destroyed by cheating!"), IMAGE_GAMEVERSION, IMAGE_GAMEVERSION_HI, true);
- return true;
- }
- @@ -694,6 +697,9 @@ bool runOptionsMenu()
- case FRONTEND_KEYMAP:
- changeTitleMode(KEYMAP);
- break;
- + case FRONTEND_UPGRDLINK:
- + changeTitleMode(GUI_OPTIONS);
- + break;
- case FRONTEND_QUIT:
- changeTitleMode(TITLE);
- break;
- @@ -712,6 +718,63 @@ bool runOptionsMenu()
- return true;
- }
- +// ////////////////////////////////////////////////////////////////////////////
- +// GUI options
- +
- +static char const *guiIsKillcountEnabledString() {
- + return (showKILLCOUNT ? "Shown" : "Hidden");
- +}
- +
- +static bool startGUIOptionsMenu()
- +{
- + sliderEnableDrag(true);
- +
- + addBackdrop();
- + addTopForm();
- + addBottomForm();
- +
- + addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, _("GUI OPTIONS"));
- +
- + addTextButton(FRONTEND_GUI_KILLCOUNT, FRONTEND_POS2X - 35, FRONTEND_POS2Y, "Show kills", WBUT_SECONDARY);
- + addTextButton(FRONTEND_GUI_KILLCOUNT_R, FRONTEND_POS2M - 55, FRONTEND_POS2Y, guiIsKillcountEnabledString(), WBUT_SECONDARY);
- +
- + addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI);
- +
- + return true;
- +}
- +
- +bool runGUIOptionsMenu()
- +{
- + WidgetTriggers const &triggers = widgRunScreen(psWScreen);
- + unsigned id = triggers.empty() ? 0 : triggers.front().widget->id; // Just use first click here, since the next click could be on another menu.
- +
- + switch (id)
- + {
- + case FRONTEND_GUI_KILLCOUNT:
- + case FRONTEND_GUI_KILLCOUNT_R:
- + showKILLCOUNT = !showKILLCOUNT;
- + widgSetString(psWScreen, FRONTEND_GUI_KILLCOUNT_R, guiIsKillcountEnabledString());
- + break;
- + case FRONTEND_QUIT:
- + changeTitleMode(OPTIONS);
- + break;
- + default:
- + break;
- + }
- +
- + // If close button pressed then return from this menu.
- + if (CancelPressed())
- + {
- + changeTitleMode(TITLE);
- + }
- +
- + widgDisplayScreen(psWScreen); // show the widgets currently running
- +
- + return true;
- +}
- +
- +///////////////////////////
- +
- static char const *graphicsOptionsFmvmodeString()
- {
- switch (war_GetFMVmode())
- @@ -1992,6 +2055,7 @@ void addTopForm()
- sFormInit.height = dstH;
- sFormInit.pDisplay = displayLogo;
- widgAddForm(psWScreen, &sFormInit);
- + addText(FRONTEND_GUI_PATCHTEXT, FRONTEND_TOPFORM_WIDEX, 0, "GUI PATCHED", FRONTEND_TOPFORM);
- }
- // ////////////////////////////////////////////////////////////////////////////
- @@ -2194,6 +2258,9 @@ void changeTitleMode(tMode mode)
- case MOUSE_OPTIONS:
- startMouseOptionsMenu();
- break;
- + case GUI_OPTIONS:
- + startGUIOptionsMenu();
- + break;
- case TUTORIAL:
- startTutorialMenu();
- break;
- diff --git a/src/frontend.h b/src/frontend.h
- index d8c8703c5..31a82dfff 100644
- --- a/src/frontend.h
- +++ b/src/frontend.h
- @@ -48,6 +48,7 @@ enum tMode
- VIDEO_OPTIONS, // 19 video options menu
- MOUSE_OPTIONS, // 20 mouse options menu
- CAMPAIGNS, // 21 campaign selector
- + GUI_OPTIONS, // 22 GUI editor
- };
- extern tMode titleMode; // the global case
- @@ -67,6 +68,7 @@ bool runCampaignSelector();
- bool runMultiPlayerMenu();
- bool runGameOptionsMenu();
- bool runOptionsMenu();
- +bool runGUIOptionsMenu();
- bool runGraphicsOptionsMenu();
- bool runAudioAndZoomOptionsMenu();
- bool runVideoOptionsMenu();
- @@ -270,6 +272,12 @@ enum
- FRONTEND_SCROLLEVENT_R,
- FRONTEND_KEYMAP = 26000, // Keymap menu
- +
- + FRONTEND_GUI = 27000, // GUI options menu
- + FRONTEND_GUI_KILLCOUNT,
- + FRONTEND_GUI_KILLCOUNT_R,
- + FRONTEND_GUI_PATCHTEXT,
- +
- FRONTEND_NOGAMESAVAILABLE = 31666 // Used when no games are available in lobby
- };
- diff --git a/src/hci.h b/src/hci.h
- index edd9fc670..ee06e5e67 100644
- --- a/src/hci.h
- +++ b/src/hci.h
- @@ -412,4 +412,5 @@ bool isSecondaryWindowUp();
- void intOpenDebugMenu(OBJECT_TYPE id);
- +
- #endif // __INCLUDED_SRC_HCI_H__
- diff --git a/src/keybind.cpp b/src/keybind.cpp
- index a977df984..3c9eb5e21 100644
- --- a/src/keybind.cpp
- +++ b/src/keybind.cpp
- @@ -620,6 +620,10 @@ void kf_ToggleFPS() //This shows *just FPS* and is always visible (when active)
- CONPRINTF("%s", _("FPS display is disabled."));
- }
- }
- +void kf_ToggleKillCount()
- +{
- + showKILLCOUNT = !showKILLCOUNT;
- +}
- void kf_ToggleSamples() //Displays number of sound sample in the sound queues & lists.
- {
- // Toggle the boolean value of showSAMPLES
- diff --git a/src/keybind.h b/src/keybind.h
- index 778e3ddc0..87ab043a0 100644
- --- a/src/keybind.h
- +++ b/src/keybind.h
- @@ -36,6 +36,7 @@ void kf_HalveHeights();
- void kf_DebugDroidInfo();
- void kf_BuildInfo();
- void kf_ToggleFPS(); //FPS counter NOT same as kf_Framerate! -Q
- +void kf_ToggleKillCount();
- void kf_ToggleSamples(); // Displays # of sound samples in Queue/list.
- void kf_ToggleOrders(); //displays unit's Order/action state.
- void kf_FrameRate();
- diff --git a/src/research.cpp b/src/research.cpp
- index 1179c6a5a..4617fbb2a 100644
- --- a/src/research.cpp
- +++ b/src/research.cpp
- @@ -579,7 +579,6 @@ void researchResult(UDWORD researchIndex, UBYTE player, bool bDisplay, STRUCTURE
- {
- audio_QueueTrack(ID_SOUND_RESEARCH_COMPLETED);
- }
- -
- if (player == selectedPlayer && bDisplay)
- {
- //add console text message
- diff --git a/src/selection.cpp b/src/selection.cpp
- index 1dacb0ca1..b0c381218 100644
- --- a/src/selection.cpp
- +++ b/src/selection.cpp
- @@ -402,7 +402,7 @@ void selNextSpecifiedBuilding(STRUCTURE_TYPE structType)
- {
- camToggleStatus();
- }
- - setViewPos(map_coord(psResult->pos.x), map_coord(psResult->pos.y), false);
- + //setViewPos(map_coord(psResult->pos.x), map_coord(psResult->pos.y), false);
- if (psOldStruct)
- {
- psOldStruct->selected = false;
- diff --git a/src/wrappers.cpp b/src/wrappers.cpp
- index 1d17db5e3..858651304 100644
- --- a/src/wrappers.cpp
- +++ b/src/wrappers.cpp
- @@ -218,6 +218,10 @@ TITLECODE titleLoop()
- runOptionsMenu();
- break;
- + case GUI_OPTIONS:
- + runGUIOptionsMenu();
- + break;
- +
- case GAME:
- runGameOptionsMenu();
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement