]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/guiPasswordChange.cpp
Add replacements to schematics
[dragonfireclient.git] / src / guiPasswordChange.cpp
index ec1cd029ab321165df02086198bc0b71240316b1..8b55234c2a6b914ab9fd13fd14ee85200a2ce2e0 100644 (file)
@@ -1,7 +1,7 @@
 /*
 /*
-Part of Minetest-c55
-Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
-Copyright (C) 2011 Ciaran Gultnieks <ciaran@ciarang.com>
+Part of Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2013 Ciaran Gultnieks <ciaran@ciarang.com>
 
 Permission to use, copy, modify, and distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
 
 Permission to use, copy, modify, and distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
@@ -20,6 +20,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "debug.h"
 #include "serialization.h"
 #include <string>
 #include "debug.h"
 #include "serialization.h"
 #include <string>
+#include <IGUICheckBox.h>
+#include <IGUIEditBox.h>
+#include <IGUIButton.h>
+#include <IGUIStaticText.h>
+#include <IGUIFont.h>
+
+#include "gettext.h"
 
 const int ID_oldPassword = 256;
 const int ID_newPassword1 = 257;
 
 const int ID_oldPassword = 256;
 const int ID_newPassword1 = 257;
@@ -88,18 +95,20 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
 
        v2s32 size = rect.getSize();
        v2s32 topleft_client(40, 0);
 
        v2s32 size = rect.getSize();
        v2s32 topleft_client(40, 0);
-       v2s32 size_client = size - v2s32(40, 0);
 
        /*
                Add stuff
        */
        s32 ypos = 50;
 
        /*
                Add stuff
        */
        s32 ypos = 50;
+       changeCtype("");
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
-               const wchar_t *text = L"Old Password";
+               wchar_t* text = wgettext("Old Password");
                Environment->addStaticText(text, rect, false, true, this, -1);
                Environment->addStaticText(text, rect, false, true, this, -1);
+               delete[] text;
        }
        }
+       changeCtype("C");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
@@ -109,12 +118,15 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
                e->setPasswordBox(true);
        }
        ypos += 50;
                e->setPasswordBox(true);
        }
        ypos += 50;
+       changeCtype("");
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
-               const wchar_t *text = L"New Password";
+               wchar_t* text = wgettext("New Password");
                Environment->addStaticText(text, rect, false, true, this, -1);
                Environment->addStaticText(text, rect, false, true, this, -1);
+               delete[] text;
        }
        }
+       changeCtype("C");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
@@ -123,12 +135,15 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
                e->setPasswordBox(true);
        }
        ypos += 50;
                e->setPasswordBox(true);
        }
        ypos += 50;
+       changeCtype("");
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
        {
                core::rect<s32> rect(0, 0, 110, 20);
                rect += topleft_client + v2s32(35, ypos+6);
-               const wchar_t *text = L"Confirm Password";
+               wchar_t* text = wgettext("Confirm Password");
                Environment->addStaticText(text, rect, false, true, this, -1);
                Environment->addStaticText(text, rect, false, true, this, -1);
+               delete[] text;
        }
        }
+       changeCtype("C");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
@@ -138,21 +153,28 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
        }
 
        ypos += 50;
        }
 
        ypos += 50;
+       changeCtype("");
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, ypos);
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, ypos);
-               Environment->addButton(rect, this, ID_change, L"Change");
+               wchar_t* text = wgettext("Change");
+               Environment->addButton(rect, this, ID_change, text);
+               delete[] text;
        }
 
        ypos += 50;
        {
                core::rect<s32> rect(0, 0, 300, 20);
                rect += topleft_client + v2s32(35, ypos);
        }
 
        ypos += 50;
        {
                core::rect<s32> rect(0, 0, 300, 20);
                rect += topleft_client + v2s32(35, ypos);
-               const wchar_t *text = L"Passwords do not match!";
+               wchar_t* text = wgettext("Passwords do not match!");
                IGUIElement *e = 
                IGUIElement *e = 
-               Environment->addStaticText(text, rect, false, true, this, ID_message);
+               Environment->addStaticText(
+                       text,
+                       rect, false, true, this, ID_message);
                e->setVisible(false);
                e->setVisible(false);
+               delete[] text;
        }
        }
+       changeCtype("C");
 
 }
 
 
 }