]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into divVerent/gettextizing-the-source
authorRudolf Polzer <divverent@alientrap.org>
Sun, 16 Jan 2011 21:53:35 +0000 (22:53 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 16 Jan 2011 21:53:35 +0000 (22:53 +0100)
55 files changed:
qcsrc/common/util.qc
qcsrc/menu/draw.qc
qcsrc/menu/gamecommand.qc
qcsrc/menu/item/gecko.c
qcsrc/menu/item/listbox.c
qcsrc/menu/item/slider.c
qcsrc/menu/item/textslider.c
qcsrc/menu/menu.qc
qcsrc/menu/skin-customizables.inc
qcsrc/menu/stringfilelist.txt [new file with mode: 0644]
qcsrc/menu/xonotic/campaign.c
qcsrc/menu/xonotic/credits.c
qcsrc/menu/xonotic/cvarlist.c
qcsrc/menu/xonotic/dialog.c
qcsrc/menu/xonotic/dialog_credits.c
qcsrc/menu/xonotic/dialog_hudpanel_ammo.c
qcsrc/menu/xonotic/dialog_hudpanel_chat.c
qcsrc/menu/xonotic/dialog_hudpanel_engineinfo.c
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c
qcsrc/menu/xonotic/dialog_hudpanel_infomessages.c
qcsrc/menu/xonotic/dialog_hudpanel_modicons.c
qcsrc/menu/xonotic/dialog_hudpanel_notification.c
qcsrc/menu/xonotic/dialog_hudpanel_powerups.c
qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c
qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c
qcsrc/menu/xonotic/dialog_hudpanel_radar.c
qcsrc/menu/xonotic/dialog_hudpanel_score.c
qcsrc/menu/xonotic/dialog_hudpanel_timer.c
qcsrc/menu/xonotic/dialog_hudpanel_vote.c
qcsrc/menu/xonotic/dialog_hudpanel_weapons.c
qcsrc/menu/xonotic/dialog_hudsetup_exit.c
qcsrc/menu/xonotic/dialog_multiplayer.c
qcsrc/menu/xonotic/dialog_multiplayer_create.c
qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/menu/xonotic/dialog_multiplayer_demo.c
qcsrc/menu/xonotic/dialog_multiplayer_join.c
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c
qcsrc/menu/xonotic/dialog_news.c
qcsrc/menu/xonotic/dialog_quit.c
qcsrc/menu/xonotic/keybinder.c
qcsrc/menu/xonotic/mainwindow.c
qcsrc/menu/xonotic/maplist.c
qcsrc/menu/xonotic/playermodel.c
qcsrc/menu/xonotic/rootdialog.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/skinlist.c
qcsrc/menu/xonotic/slider_decibels.c
qcsrc/menu/xonotic/slider_resolution.c
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh

index 1bfbca6ae107cf27eab18fe437035669cc140e02..dcdd74deef9523b7ce3ebd9fce53ac874f07db9b 100644 (file)
@@ -360,7 +360,10 @@ float buf_load(string pFilename)
                return -1;
        fh = fopen(pFilename, FILE_READ);
        if(fh < 0)
-               return buf;
+       {
+               buf_del(buf);
+               return -1;
+       }
        i = 0;
        while((l = fgets(fh)))
        {
index a33cac91633ea8016b622d148b6840f6a1673a86..12b56d8dae8f2632ef8bbb84c847a2fde28863dd 100644 (file)
@@ -282,14 +282,14 @@ void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor
 }
 void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
 {
-       //print(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n"));
+       //dprint(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n"));
        draw_Text(theOrigin - eX * 0.5 * draw_TextWidth(theText, ICanHasKallerz, theSize), theText, theSize, theColor, theAlpha, ICanHasKallerz);
 }
 
 float draw_TextWidth(string theText, float ICanHasKallerz, vector SizeThxBye)
 {
        //return strlen(theText);
-       //print("draw_TextWidth \"", theText, "\"\n");
+       //dprint("draw_TextWidth \"", theText, "\"\n");
        vector v;
        v = '0 0 0';
        //float r;
index 439a1b5c96b4428ac82623384dc208d73ea9bf54..761cd9dcade8d2309c3ea7d5e299750fed45a108 100644 (file)
@@ -44,7 +44,7 @@ void Curl_URI_Get_Callback(float id, float status, string data)
        do_cvar = curl_uri_get_cvar[i];
        if(status != 0)
        {
-               print("error: status is ", ftos(status), "\n");
+               print(sprintf(_("error: status is %d\n"), status));
                return;
        }
        if(do_exec)
@@ -62,9 +62,9 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "help" || argc == 0)
        {
-               print("Usage: menu_cmd theCommand..., where possible theCommands are:\n");
-               print("  sync - reloads all cvars on the current menu page\n");
-               print("  directmenu ITEM - select a menu item as main item\n");
+               print(_("Usage: menu_cmd theCommand..., where possible theCommands are:\n"));
+               print(_("  sync - reloads all cvars on the current menu page\n"));
+               print(_("  directmenu ITEM - select a menu item as main item\n"));
                GameCommand_Generic("help");
                return;
        }
@@ -184,7 +184,7 @@ void GameCommand(string theCommand)
                        curl_uri_get_pos = mod(curl_uri_get_pos + 1, URI_GET_CURL_END - URI_GET_CURL + 1);
                }
                else
-                       print("error creating curl handle\n");
+                       print(_("error creating curl handle\n"));
 
                buf_del(buf);
 
@@ -230,5 +230,5 @@ void GameCommand(string theCommand)
        }
 #endif
 
-       print("Invalid theCommand. For a list of supported theCommands, try menu_cmd help.\n");
+       print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
index 139e87e1a03903baa96650e607b8347cb780d93f..dd752e6e54797aaac05e1bf5542621328810b097 100644 (file)
@@ -46,7 +46,7 @@ void Gecko_draw(entity me)
                local vector fontsize;
                fontsize_x = fontsize_y = 1.0 / 30.0;
                fontsize_z = 0.0;
-               draw_Text( '0 0 0', "Browser not initialized!", fontsize, '1 1 1', 1.0, 0 );
+               draw_Text( '0 0 0', _("Browser not initialized!"), fontsize, '1 1 1', 1.0, 0 );
        }
 }
 
index 361e3cb32561765ebb5298b1343bbf22b4acbabd..9664e93765575014aab68a8198ee3fc22bb3ca14 100644 (file)
@@ -297,6 +297,6 @@ void ListBox_clickListBoxItem(entity me, float i, vector where)
 
 void ListBox_drawListBoxItem(entity me, float i, vector absSize, float selected)
 {
-       draw_Text('0 0 0', strcat("Item ", ftos(i)), eX * (8 / absSize_x) + eY * (8 / absSize_y), (selected ? '0 1 0' : '1 1 1'), 1, 0);
+       draw_Text('0 0 0', sprintf(_("Item %d"), i), eX * (8 / absSize_x) + eY * (8 / absSize_y), (selected ? '0 1 0' : '1 1 1'), 1, 0);
 }
 #endif
index c8bab9bf80cda0314036564df6633b276d4da7d7..9a8a35fdcbc699d03ba12742342bb45f0e7fe0f4 100644 (file)
@@ -61,7 +61,7 @@ void Slider_setSliderValue(entity me, float val)
 }
 string Slider_toString(entity me)
 {
-       return strcat(ftos(me.value), " (", me.valueToText(me, me.value), ")");
+       return sprintf(_("%d (%s)"), me.value, me.valueToText(me, me.value));
 }
 void Slider_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
 {
index c4a7af7a890e6a5d84ae4cf727e7cde8d5c5151f..028a1603a16c35ef50e43577c587f2127e59b8d8 100644 (file)
@@ -26,9 +26,9 @@ string TextSlider_valueToIdentifier(entity me, float val)
 string TextSlider_valueToText(entity me, float val)
 {
        if(val >= me.nValues)
-               return "custom";
+               return _("custom");
        if(val < 0)
-               return "custom";
+               return _("custom");
        return me.(valueStrings[val]);
 }
 void TextSlider_setValueFromIdentifier(entity me, string id)
index 92da56a25377baee061139f736433b684aea0458..fbdbdd2e7f7edd36b6a90f6ba243d03fc5768018 100644 (file)
@@ -25,7 +25,7 @@ void() m_init =
        check_unacceptable_compiler_bugs();
 
 #ifdef WATERMARK
-       print("^4MQC Build information: ", WATERMARK(), "\n");
+       print(sprintf(_("^4MQC Build information: %s\n"), WATERMARK()));
 #endif
 
        // list all game dirs (TEST)
@@ -115,18 +115,18 @@ void() m_init_delayed =
        if(cvar_string("menu_skin") != "")
        {
                draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
-               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+               fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
        }
        if(fh < 0)
        if(cvar_defstring("menu_skin") != "")
        {
                draw_currentSkin = strcat("gfx/menu/", cvar_defstring("menu_skin"));
-               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+               fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
        }
        if(fh < 0)
        {
                draw_currentSkin = "gfx/menu/default";
-               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+               fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
        }
        draw_currentSkin = strzone(draw_currentSkin);
        while((s = fgets(fh)))
index afea3e752fd871c079df07fd8cc013995297894c..0a0de3d27768cfea9cc0783b87dd3ac609a74680 100644 (file)
@@ -6,7 +6,7 @@ print "\n";
 while(<DATA>)
 {
        chomp;
-       if(/^\s*(?:SKINFLOAT|SKINVECTOR)\(([A-Z_]+), ([-'0-9. ]+)\);$/)
+       if(/^\s*(?:SKINFLOAT|SKINVECTOR)\(([A-Z_]+), ([-'0-9. ]+)\);$/) #'
        {
                printf "%-31s %s\n", $1, $2;
        }
diff --git a/qcsrc/menu/stringfilelist.txt b/qcsrc/menu/stringfilelist.txt
new file mode 100644 (file)
index 0000000..b15335f
--- /dev/null
@@ -0,0 +1,34 @@
+Guideline:
+- do NOT translate strings in error() messages, or in dprint()!
+- delete obviously useless developer prints while at it
+- change obvious developer prints from print to dprint (even in comments),
+  unless in developer-only functions (e.g. *dumptree*)
+- mark translatable strings with _()
+- if a translatable string is a strcat monster, change it to sprintf
+- if code loads files with text, use language_filename()
+- test by:
+  find . -type f -not -name \*.po -not -name \*.txt | xgettext -LC -k_ -f- gamecommand.qc
+- interesting vim macros:
+  :map # /"<return>
+  :map ' i_(<esc>2f"a)<esc>/"<return>
+
+List of files to do:
+
+./xonotic/dialog_settings_audio.c
+./xonotic/dialog_settings.c
+./xonotic/dialog_settings_effects.c
+./xonotic/dialog_settings_input.c
+./xonotic/dialog_settings_input_userbind.c
+./xonotic/dialog_settings_misc.c
+./xonotic/dialog_settings_misc_cvars.c
+./xonotic/dialog_settings_network.c
+./xonotic/dialog_settings_video.c
+./xonotic/dialog_singleplayer.c
+./xonotic/dialog_singleplayer_winner.c
+./xonotic/dialog_teamselect.c
+
+
+
+Unresolved TODO:
+
+- translated campaigns
index e7667f69cfd64ceae7fd3bd7fd65b5397d5c18c6..04f7a083c2d32a035ac9bb5d15e6c2e1c127b72e 100644 (file)
@@ -281,8 +281,8 @@ void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, flo
        if(i <= me.campaignIndex)
                s = campaign_shortdesc[i]; // fteqcc sucks
        else
-               s = "???";
-       s = draw_TextShortenToWidth(strcat("Level ", ftos(i + 1), ": ", s), me.columnNameSize, 0, me.realFontSize);
+               s = _("???");
+       s = draw_TextShortenToWidth(sprintf(_("Level %d: %s"), i+1, s), me.columnNameSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 
        if(i <= me.campaignIndex)
index 86609a659865c963c6485813867eaa53e0dd33ed..daf4d22f9c8dd95b221fdaf7c4134b628c4ccfc2 100644 (file)
@@ -30,7 +30,9 @@ void XonoticCreditsList_configureXonoticCreditsList(entity me)
 {
        me.configureXonoticListBox(me);
        // load the file
-       me.bufferIndex = buf_load("xonotic-credits.txt");
+       me.bufferIndex = buf_load(language_filename("xonotic-credits.txt"));
+       if(me.bufferIndex < 0)
+               me.bufferIndex = buf_load("xonotic-credits.txt");
        me.nItems = buf_getsize(me.bufferIndex);
 }
 void XonoticCreditsList_destroy(entity me)
index 3eaf2677e9a4316231080e552e34ad0c7bf7365b..4d36c92581b277b338afbc05982d88cac6012f96 100644 (file)
@@ -81,15 +81,15 @@ void XonoticCvarList_setSelected(entity me, float i)
        t = cvar_type(me.cvarName);
        me.cvarType = "";
        if(t & CVAR_TYPEFLAG_SAVED)
-               me.cvarType = strcat(me.cvarType, ", will be saved to config.cfg");
+               me.cvarType = strcat(me.cvarType, ", ", _("will be saved to config.cfg"));
        else
-               me.cvarType = strcat(me.cvarType, ", will not be saved");
+               me.cvarType = strcat(me.cvarType, ", ", _("will not be saved"));
        if(t & CVAR_TYPEFLAG_PRIVATE)
-               me.cvarType = strcat(me.cvarType, ", private");
+               me.cvarType = strcat(me.cvarType, ", ", _("private"));
        if(t & CVAR_TYPEFLAG_ENGINE)
-               me.cvarType = strcat(me.cvarType, ", engine setting");
+               me.cvarType = strcat(me.cvarType, ", ", _("engine setting"));
        if(t & CVAR_TYPEFLAG_READONLY)
-               me.cvarType = strcat(me.cvarType, ", read only");
+               me.cvarType = strcat(me.cvarType, ", ", _("read only"));
        me.cvarType = strzone(substring(me.cvarType, 2, strlen(me.cvarType) - 2));
 
        me.cvarNameBox.setText(me.cvarNameBox, me.cvarName);
index 7087d83cb9707987437edd588a45f71119ec8b14..f18658c7154197e1f1f7d535d0e8801d619d6631 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticDialog) EXTENDS(Dialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
-       ATTRIB(XonoticDialog, title, string, "Form1") // ;)
+       ATTRIB(XonoticDialog, title, string, _("Form1")) // ;)
        ATTRIB(XonoticDialog, color, vector, '1 0.5 1')
        ATTRIB(XonoticDialog, intendedWidth, float, 0)
        ATTRIB(XonoticDialog, rows, float, 3)
index 07c2fc4f293bca09b22c1089263c274e66324bc2..e90ae4b42590d08435472ea66b76c31e5a317fe4 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticCreditsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticCreditsDialog, fill, void(entity))
        METHOD(XonoticCreditsDialog, focusEnter, void(entity))
-       ATTRIB(XonoticCreditsDialog, title, string, "Credits")
+       ATTRIB(XonoticCreditsDialog, title, string, _("Credits"))
        ATTRIB(XonoticCreditsDialog, color, vector, SKINCOLOR_DIALOG_CREDITS)
        ATTRIB(XonoticCreditsDialog, intendedWidth, float, SKINWIDTH_CREDITS)
        ATTRIB(XonoticCreditsDialog, rows, float, SKINROWS_CREDITS)
@@ -18,7 +18,7 @@ void XonoticCreditsDialog_fill(entity me)
        me.TR(me);
                me.TD(me, me.rows - 1, me.columns, me.creditsList = makeXonoticCreditsList());
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 256dbe7df028ec0a93852b1dc0ae06123680a2df..299ea09fd7dc690b49584b108e570824cabfdff7 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDAmmoDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDAmmoDialog, fill, void(entity))
-       ATTRIB(XonoticHUDAmmoDialog, title, string, "Ammo Panel")
+       ATTRIB(XonoticHUDAmmoDialog, title, string, _("Ammo Panel"))
        ATTRIB(XonoticHUDAmmoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDAmmoDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDAmmoDialog, rows, float, 15)
@@ -15,71 +15,18 @@ void XonoticHUDAmmoDialog_fill(entity me)
 {
        entity e;
        string panelname = "ammo";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_ammo", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Ammunition display:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Ammunition display:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", "Show only current ammo type"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", _("Show only current ammo type")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Align icon:"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", "Left"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", "Right"));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", _("Left")));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", _("Right")));
 }
 #endif
index c9a4eae6e80734de20449611918a871a5734aad6..331b0ee9ae265e0fe29b67f27f316f00f9cedce2 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDChatDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDChatDialog, fill, void(entity))
-       ATTRIB(XonoticHUDChatDialog, title, string, "Chat Panel")
+       ATTRIB(XonoticHUDChatDialog, title, string, _("Chat Panel"))
        ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDChatDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDChatDialog, rows, float, 15)
@@ -15,74 +15,21 @@ void XonoticHUDChatDialog_fill(entity me)
 {
        entity e;
        string panelname = "chat";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_chat", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Chat entries:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Chat entries:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Chat size:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Chat size:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(6, 20, 1, "con_chatsize"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Chat lifetime:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Chat lifetime:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(5, 60, 5, "con_chattime"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", "Chat beep sound"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat beep sound")));
 }
 #endif
index 03ef106c7decd260147dbae0a48d8c0f9ffc296a..b69a5869e79993603011a0646df5bb17cfa92b7c 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDEngineInfoDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDEngineInfoDialog, fill, void(entity))
-       ATTRIB(XonoticHUDEngineInfoDialog, title, string, "Engine Info Panel")
+       ATTRIB(XonoticHUDEngineInfoDialog, title, string, _("Engine Info Panel"))
        ATTRIB(XonoticHUDEngineInfoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDEngineInfoDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDEngineInfoDialog, rows, float, 15)
@@ -15,66 +15,13 @@ void XonoticHUDEngineInfoDialog_fill(entity me)
 {
        entity e;
        string panelname = "engineinfo";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_engineinfo", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Engine info:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Engine info:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", "Use an averaging algorithm for fps"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", _("Use an averaging algorithm for fps")));
 }
 #endif
index 3e8a43aeb38520a386ca1ef25960587e6aae83b4..91da57cdfae8da55427c3dd189f5aed28b731505 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDHealthArmorDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDHealthArmorDialog, fill, void(entity))
-       ATTRIB(XonoticHUDHealthArmorDialog, title, string, "Health/Armor Panel")
+       ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel"))
        ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15)
@@ -15,86 +15,33 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
 {
        entity e;
        string panelname = "healtharmor";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", "Enable status bar"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Status bar alignment:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "0", "Left"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "0", _("Left")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "1", "Right"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "1", _("Right")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "3", "Inward"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "3", _("Inward")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "4", "Outward"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "4", _("Outward")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Icon alignment:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Icon alignment:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "0", "Left"));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "1", "Right"));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "3", "Inward"));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "4", "Outward"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "0", _("Left")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "1", _("Right")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "3", _("Inward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "4", _("Outward")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", "Flip health and armor positions"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", _("Flip health and armor positions")));
 }
 #endif
index d8534a20e9974d34030cb4dce2da064fcb987d6e..44b20294b7cc801eac215b0fd9421ab85702319c 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDInfoMessagesDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDInfoMessagesDialog, fill, void(entity))
-       ATTRIB(XonoticHUDInfoMessagesDialog, title, string, "Info Messages Panel")
+       ATTRIB(XonoticHUDInfoMessagesDialog, title, string, _("Info Messages Panel"))
        ATTRIB(XonoticHUDInfoMessagesDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDInfoMessagesDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDInfoMessagesDialog, rows, float, 15)
@@ -15,66 +15,13 @@ void XonoticHUDInfoMessagesDialog_fill(entity me)
 {
        entity e;
        string panelname = "infomessages";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_infomessages", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Info messages:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Info messages:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", "Flip align"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", _("Flip align")));
 }
 #endif
index d60a72473f4999bf5bc96e2d105a5c2a00834130..fd5d233dcf63b0acd5229864aaa5fe7e71b719da 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDModIconsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDModIconsDialog, fill, void(entity))
-       ATTRIB(XonoticHUDModIconsDialog, title, string, "Mod Icons Panel")
+       ATTRIB(XonoticHUDModIconsDialog, title, string, _("Mod Icons Panel"))
        ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDModIconsDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDModIconsDialog, rows, float, 15)
@@ -15,61 +15,7 @@ void XonoticHUDModIconsDialog_fill(entity me)
 {
        entity e;
        string panelname = "modicons";
-       float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_modicons", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
 }
 #endif
index b0752664f2023258a2951bb0bf96b1399b79e755..1f26ab34aa92e3f909cc71a223dddc462e1d8be8 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDNotificationDialog, fill, void(entity))
-       ATTRIB(XonoticHUDNotificationDialog, title, string, "Notification Panel")
+       ATTRIB(XonoticHUDNotificationDialog, title, string, _("Notification Panel"))
        ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDNotificationDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDNotificationDialog, rows, float, 15)
@@ -15,77 +15,24 @@ void XonoticHUDNotificationDialog_fill(entity me)
 {
        entity e;
        string panelname = "notify";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Notifications:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Notifications:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_print", "Also print notifications to the console"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_print", _("Also print notifications to the console")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", "Flip notify order"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", _("Flip notify order")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Entry lifetime:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Entry lifetime:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(3, 15, 1, "hud_panel_notify_time"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Entry fadetime:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Entry fadetime:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(0.5, 5, 0.5, "hud_panel_notify_fadetime"));
 }
 #endif
index 5d4e14c08b62fc64876d7f22ae303c836a36d659..e63e785528f0ef10de774a51eb6a364c9d41f2fc 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDPowerupsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDPowerupsDialog, fill, void(entity))
-       ATTRIB(XonoticHUDPowerupsDialog, title, string, "Powerups Panel")
+       ATTRIB(XonoticHUDPowerupsDialog, title, string, _("Powerups Panel"))
        ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDPowerupsDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDPowerupsDialog, rows, float, 15)
@@ -15,86 +15,33 @@ void XonoticHUDPowerupsDialog_fill(entity me)
 {
        entity e;
        string panelname = "powerups";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", "Enable status bar"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", _("Enable status bar")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Status bar alignment:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "0", "Left"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "0", _("Left")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "1", "Right"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "1", _("Right")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "3", "Inward"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "3", _("Inward")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "4", "Outward"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "4", _("Outward")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Icon alignment:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Icon alignment:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "0", "Left"));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "1", "Right"));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "3", "Inward"));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "4", "Outward"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "0", _("Left")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "1", _("Right")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "3", _("Inward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "4", _("Outward")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", "Flip strength and shield positions"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", _("Flip strength and shield positions")));
 }
 #endif
index 30f6bfc1f2da723a813477fa3b70e4c106ab9432..bbddb7fc1b5b7abb7bf29455662c84a89e4b4e72 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDPressedKeysDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDPressedKeysDialog, fill, void(entity))
-       ATTRIB(XonoticHUDPressedKeysDialog, title, string, "Pressed Keys Panel")
+       ATTRIB(XonoticHUDPressedKeysDialog, title, string, _("Pressed Keys Panel"))
        ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDPressedKeysDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15)
@@ -15,69 +15,19 @@ void XonoticHUDPressedKeysDialog_fill(entity me)
 {
        entity e;
        string panelname = "pressedkeys";
-       float i;
 
        me.TR(me);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_panel_pressedkeys"));
-                       e.addValue(e, "Panel disabled", "0");
-                       e.addValue(e, "Panel enabled when spectating", "1");
-                       e.addValue(e, "Panel always enabled", "2");
+                       e.addValue(e, _("Panel disabled"), "0");
+                       e.addValue(e, _("Panel enabled when spectating"), "1");
+                       e.addValue(e, _("Panel always enabled"), "2");
                        e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Forced aspect:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Forced aspect:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(0.2, 4, 0.1, "hud_panel_pressedkeys_aspect"));
 }
 #endif
index 35fdc55f3c8b5d9a8ae355dde2faa245fe11975d..015979b21e72157675fb963f4c19e6208fa7eb9f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDRaceTimerDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDRaceTimerDialog, fill, void(entity))
-       ATTRIB(XonoticHUDRaceTimerDialog, title, string, "Race Timer Panel")
+       ATTRIB(XonoticHUDRaceTimerDialog, title, string, _("Race Timer Panel"))
        ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDRaceTimerDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15)
@@ -15,61 +15,7 @@ void XonoticHUDRaceTimerDialog_fill(entity me)
 {
        entity e;
        string panelname = "racetimer";
-       float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_racetimer", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
 }
 #endif
index d1202846e26c140f0140c5f3ac67b7898b1e0c8a..5a43bbdf60ac1a9ef7286637f25e13fe43e610bb 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDRadarDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDRadarDialog, fill, void(entity))
-       ATTRIB(XonoticHUDRadarDialog, title, string, "Radar Panel")
+       ATTRIB(XonoticHUDRadarDialog, title, string, _("Radar Panel"))
        ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDRadarDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDRadarDialog, rows, float, 15)
@@ -15,94 +15,44 @@ void XonoticHUDRadarDialog_fill(entity me)
 {
        entity e;
        string panelname = "radar";
-       float i;
 
        me.TR(me);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_panel_radar"));
-                       e.addValue(e, "Panel disabled", "0");
-                       e.addValue(e, "Panel enabled in teamgames", "1");
-                       e.addValue(e, "Panel always enabled", "2");
+                       e.addValue(e, _("Panel disabled"), "0");
+                       e.addValue(e, _("Panel enabled in teamgames"), "1");
+                       e.addValue(e, _("Panel always enabled"), "2");
                        e.configureXonoticTextSliderValues(e);
+
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+
        me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Radar:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Radar:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_radar_foreground_alpha"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Rotation:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Rotation:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_radar_rotation"));
-                               e.addValue(e, "Forward", "0");
-                               e.addValue(e, "West", "1");
-                               e.addValue(e, "South", "2");
-                               e.addValue(e, "East", "3");
-                               e.addValue(e, "North", "4");
+                               e.addValue(e, _("Forward"), "0");
+                               e.addValue(e, _("West"), "1");
+                               e.addValue(e, _("South"), "2");
+                               e.addValue(e, _("East"), "3");
+                               e.addValue(e, _("North"), "4");
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Scale:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Scale:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(1024, 8192, 512, "hud_panel_radar_scale"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Zoom mode:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Zoom mode:")));
                        me.TD(me, 1, 1.6, e = makeXonoticTextSlider("hud_panel_radar_zoommode"));
-                               e.addValue(e, "Zoomed in", "0");
-                               e.addValue(e, "Zoomed out", "1");
-                               e.addValue(e, "Always zoomed", "2");
-                               e.addValue(e, "Never zoomed", "3");
+                               e.addValue(e, _("Zoomed in"), "0");
+                               e.addValue(e, _("Zoomed out"), "1");
+                               e.addValue(e, _("Always zoomed"), "2");
+                               e.addValue(e, _("Never zoomed"), "3");
                                e.configureXonoticTextSliderValues(e);
 }
 #endif
index fc51921e23777a3b2980123ca42ba99e2f446cd1..ccb8d9528bed1807833c8acaa8f0d2124e34b3d2 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDScoreDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDScoreDialog, fill, void(entity))
-       ATTRIB(XonoticHUDScoreDialog, title, string, "Score Panel")
+       ATTRIB(XonoticHUDScoreDialog, title, string, _("Score Panel"))
        ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDScoreDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDScoreDialog, rows, float, 15)
@@ -15,61 +15,7 @@ void XonoticHUDScoreDialog_fill(entity me)
 {
        entity e;
        string panelname = "score";
-       float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_score", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
 }
 #endif
index 96dc4aa6959f8fa8c18c4423cfc0c49afb913483..5f2fc5dd747b63cf8d73589ecc90b377c59fae7f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDTimerDialog, fill, void(entity))
-       ATTRIB(XonoticHUDTimerDialog, title, string, "Timer Panel")
+       ATTRIB(XonoticHUDTimerDialog, title, string, _("Timer Panel"))
        ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDTimerDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDTimerDialog, rows, float, 15)
@@ -15,66 +15,13 @@ void XonoticHUDTimerDialog_fill(entity me)
 {
        entity e;
        string panelname = "timer";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_timer", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Timer:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Timer:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", "Show elapsed time"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", _("Show elapsed time")));
 }
 #endif
index b5f5b6e27b965713d2cb0099a3457fd28fccd5a8..d3d35c22a45b19a2cd975509e43f74f5f8ee470e 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDVoteDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDVoteDialog, fill, void(entity))
-       ATTRIB(XonoticHUDVoteDialog, title, string, "Vote Panel")
+       ATTRIB(XonoticHUDVoteDialog, title, string, _("Vote Panel"))
        ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDVoteDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDVoteDialog, rows, float, 15)
@@ -15,64 +15,11 @@ void XonoticHUDVoteDialog_fill(entity me)
 {
        entity e;
        string panelname = "vote";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_vote", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Alpha after voting:"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Alpha after voting:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_vote_alreadyvoted_alpha"));
 }
 #endif
index ad3d080415e6547af2452536ff50b8f8c4149321..b426a75c259cb964ed18a1b44eea496d2f638063 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDWeaponsDialog, fill, void(entity))
-       ATTRIB(XonoticHUDWeaponsDialog, title, string, "Weapons Panel")
+       ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"))
        ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDWeaponsDialog, rows, float, 17)
@@ -17,98 +17,46 @@ void XonoticHUDWeaponsDialog_fill(entity me)
        string panelname = "weapons";
        float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_weapons", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", cvar_string("hud_panel_bg_color"), strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
+
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Fade out after:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Fade out after:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout"))));
-                               e.addValue(e, "Never", "0");
+                               e.addValue(e, _("Never"), "0");
                                for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(strcat(ftos_decimals(i, 0), "s")), strzone(ftos(i)));
+                                       e.addValue(e, strzone(sprintf(_("%ds"), i)), strzone(ftos(i)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Fade effect:"));
-               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "0", "None"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Fade effect:")));
+               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "0", _("None")));
                        setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
-               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "1", "Slide"));
+               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "1", _("Slide")));
                        setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
-               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "2", "Alpha"));
+               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "2", _("Alpha")));
                        setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Weapon icons:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Weapon icons:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Show weapon ID as:"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "0", "None"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "1", "Number"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", "Bind"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Show weapon ID as:")));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "0", _("None")));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "1", _("Number")));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", _("Bind")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", "Show Accuracy"));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", "Show Ammo"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", _("Show Accuracy")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", _("Show Ammo")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Ammo bar color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Ammo bar color:")));
                me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_weapons_ammo_color", "hud_panel_weapons_ammo_color"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
                me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Ammo bar alpha:"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Ammo bar alpha:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
 }
index 751b3cf95c73004f35b08ea92bb3ecc97e1150ec..5a7139fdc9d62d33b1a0c8b8f32a587dd957df08 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDExitDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDExitDialog, fill, void(entity))
-       ATTRIB(XonoticHUDExitDialog, title, string, "Panel HUD Setup")
+       ATTRIB(XonoticHUDExitDialog, title, string, _("Panel HUD Setup"))
        ATTRIB(XonoticHUDExitDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDExitDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDExitDialog, rows, float, 18)
@@ -18,95 +18,95 @@ void XonoticHUDExitDialog_fill(entity me)
        float i;
 
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Panel background defaults:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Panel background defaults:")));
        me.TR(me);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
                        me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_bg"))));
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, "border_default", "border_default");
+                               e.addValue(e, _("Disable"), "0");
+                               e.addValue(e, "border_default", "border_default"); // this is a file name!
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
                me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_bg_color", "hud_panel_bg_color"));
        me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Border size:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_border"));
-                               e.addValue(e, "Disable", "0");
+                               e.addValue(e, _("Disable"), "0");
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_alpha"));
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_color_team"));
-                               e.addValue(e, "Disable", "0");
+                               e.addValue(e, _("Disable"), "0");
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", _("Test the team color in HUD configure mode")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Padding:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_padding"));
                                for(i = 0; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
                                e.configureXonoticTextSliderValues(e);
 
        me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "HUD Dock:"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("HUD Dock:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock"));
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, "Small", "dock_small");
-                               e.addValue(e, "Medium", "dock_medium");
-                               e.addValue(e, "Large", "dock_large");
+                               e.addValue(e, _("Disable"), "0");
+                               e.addValue(e, _("Small"), "dock_small");
+                               e.addValue(e, _("Medium"), "dock_medium");
+                               e.addValue(e, _("Large"), "dock_large");
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
                me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_dock_color", "hud_dock_color"));
        me.TR(me);
        me.TR(me);      
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_alpha"));
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_color_team"));
-                               e.addValue(e, "Disable", "0");
+                               e.addValue(e, _("Disable"), "0");
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Grid settings:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Grid settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_grid", "Snap panels to grid"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_grid", _("Snap panels to grid")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Grid size:"));
-               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "X:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Grid size:")));
+               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("X:")));
                        me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_xsize"));
                                for(i = 1; i <= 14; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/200, 3)), strzone(ftos(i/200)));
                                e.configureXonoticTextSliderValues(e);
                        setDependent(e, "hud_configure_grid", 1, 1);
-               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "Y:"));
+               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("Y:")));
                        me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_ysize"));
                                for(i = 1; i <= 14; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/200, 3)), strzone(ftos(i/200)));
@@ -114,6 +114,6 @@ void XonoticHUDExitDialog_fill(entity me)
                        setDependent(e, "hud_configure_grid", 1, 1);
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit setup", '0 0 0', "_hud_configure 0", 1));
+               me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", 1));
 }
 #endif
index e755710c5b31bb0bb69de0cb5d85be32c85f4380..e57ecce29f5786d62d21efd11768f99b59a53ca9 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticMultiplayerDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticMultiplayerDialog, fill, void(entity))
-       ATTRIB(XonoticMultiplayerDialog, title, string, "Multiplayer")
+       ATTRIB(XonoticMultiplayerDialog, title, string, _("Multiplayer"))
        ATTRIB(XonoticMultiplayerDialog, color, vector, SKINCOLOR_DIALOG_MULTIPLAYER)
        ATTRIB(XonoticMultiplayerDialog, intendedWidth, float, 0.96)
        ATTRIB(XonoticMultiplayerDialog, rows, float, 24)
@@ -15,12 +15,12 @@ void XonoticMultiplayerDialog_fill(entity me)
        entity mc, e;
        mc = makeXonoticTabController(me.rows - 2);
        me.TR(me);
-               me.TD(me, 1, 1, e = mc.makeTabButton(mc, "Servers",  makeXonoticServerListTab()));
+               me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Servers"),  makeXonoticServerListTab()));
                        setDependentStringNotEqual(e, "_cl_name", "Player");
-               me.TD(me, 1, 1, e = mc.makeTabButton(mc, "Create",  makeXonoticServerCreateTab()));
+               me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Create"),  makeXonoticServerCreateTab()));
                        setDependentStringNotEqual(e, "_cl_name", "Player");
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Demos",   makeXonoticDemoBrowserTab()));
-               me.TD(me, 1, 1, e = mc.makeTabButton(mc, "Player Setup",  makeXonoticPlayerSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Demos"),   makeXonoticDemoBrowserTab()));
+               me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Player Setup"),  makeXonoticPlayerSettingsTab()));
                        if(cvar_string("_cl_name") == "Player")
                                e.onClick(e, e.onClickEntity); // lol animation
 
index bf3e58dd7b7a8665b4e194dc6cd889d3c582a204..2d9689f64422e5d527692b91b753a30afb6268a8 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticServerCreateTab) EXTENDS(XonoticTab)
        METHOD(XonoticServerCreateTab, fill, void(entity))
        METHOD(XonoticServerCreateTab, gameTypeChangeNotify, void(entity))
-       ATTRIB(XonoticServerCreateTab, title, string, "Create")
+       ATTRIB(XonoticServerCreateTab, title, string, _("Create"))
        ATTRIB(XonoticServerCreateTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticServerCreateTab, rows, float, 22)
        ATTRIB(XonoticServerCreateTab, columns, float, 6.5)
@@ -32,7 +32,7 @@ void XonoticServerCreateTab_fill(entity me)
        float n;
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Game type:"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Game type:")));
        me.TR(me);
                me.TD(me, 9, 3, e = makeXonoticGametypeList());
        me.TR(me);
@@ -44,49 +44,49 @@ void XonoticServerCreateTab_fill(entity me)
        me.TR(me);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Match settings:"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Match settings:")));
        me.TR(me);
                me.sliderTimelimit = makeXonoticSlider(1.0, 60.0, 0.5, "timelimit_override");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderTimelimit, "Time limit:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderTimelimit, _("Time limit:")));
                me.TD(me, 1, 2, me.sliderTimelimit);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderTimelimit, "Use map specified default"));
+               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderTimelimit, _("Use map specified default")));
        me.TR(me);
                me.sliderFraglimit = makeXonoticSlider(1.0, 2000.0, 5, "fraglimit_override");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderFraglimit, "Point limit:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderFraglimit, _("Point limit:")));
                        me.checkboxFraglimit = e;
                me.TD(me, 1, 2, me.sliderFraglimit);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderFraglimit, "Use map specified default"));
+               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderFraglimit, _("Use map specified default")));
                        me.checkboxFraglimitMapinfo = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Player slots:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player slots:")));
                me.TD(me, 1, 2, makeXonoticSlider(1, 32, 1, "menu_maxplayers"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Number of bots:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Number of bots:")));
                me.TD(me, 1, 2, makeXonoticSlider(0, 9, 1, "bot_number"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Bot skill:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Bot skill:")));
                        setDependent(e, "bot_number", 0, -1);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("skill"));
-                       e.addValue(e, "Botlike", "0");
-                       e.addValue(e, "Beginner", "1");
-                       e.addValue(e, "You will win", "2");
-                       e.addValue(e, "You can win", "3");
-                       e.addValue(e, "You might win", "4");
-                       e.addValue(e, "Advanced", "5");
-                       e.addValue(e, "Expert", "6");
-                       e.addValue(e, "Pro", "7");
-                       e.addValue(e, "Assassin", "8");
-                       e.addValue(e, "Unhuman", "9");
-                       e.addValue(e, "Godlike", "10");
+                       e.addValue(e, _("Botlike"), "0");
+                       e.addValue(e, _("Beginner"), "1");
+                       e.addValue(e, _("You will win"), "2");
+                       e.addValue(e, _("You can win"), "3");
+                       e.addValue(e, _("You might win"), "4");
+                       e.addValue(e, _("Advanced"), "5");
+                       e.addValue(e, _("Expert"), "6");
+                       e.addValue(e, _("Pro"), "7");
+                       e.addValue(e, _("Assassin"), "8");
+                       e.addValue(e, _("Unhuman"), "9");
+                       e.addValue(e, _("Godlike"), "10");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "bot_number", 0, -1);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticButton("Mutators...", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Mutators..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.mutatorsDialog;
                        main.mutatorsDialog.refilterEntity = me.mapListBox;
@@ -95,29 +95,29 @@ void XonoticServerCreateTab_fill(entity me)
                        e0.allowCut = 1;
        me.TR(me);
                me.TDempty(me, 0.5);
-               me.TD(me, 1, 2, e = makeXonoticButton("Advanced settings...", '0 0 0'));
+               me.TD(me, 1, 2, e = makeXonoticButton(_("Advanced settings..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.advancedDialog;
                        main.advancedDialog.refilterEntity = me.mapListBox;
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
                me.mapListBox = makeXonoticMapList();
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Map list:"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Map list:")));
                        makeCallback(e, me.mapListBox, me.mapListBox.refilterCallback);
        me.TR(me);
                me.TD(me, me.rows - 4, 3, me.mapListBox);
        me.gotoRC(me, me.rows - 3, 3.5);
                me.TDempty(me, 0.25);
-               me.TD(me, 1, 1.125, e = makeXonoticButton("Select all", '0 0 0'));
+               me.TD(me, 1, 1.125, e = makeXonoticButton(_("Select all"), '0 0 0'));
                        e.onClick = MapList_All;
                        e.onClickEntity = me.mapListBox;
-               me.TD(me, 1, 1.125, e = makeXonoticButton("Select none", '0 0 0'));
+               me.TD(me, 1, 1.125, e = makeXonoticButton(_("Select none"), '0 0 0'));
                        e.onClick = MapList_None;
                        e.onClickEntity = me.mapListBox;
                me.TDempty(me, 0.25);
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("Start Multiplayer!", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("Start Multiplayer!"), '0 0 0'));
                        e.onClick = MapList_LoadMap;
                        e.onClickEntity = me.mapListBox;
                        me.mapListBox.startButton = e;
@@ -152,17 +152,17 @@ void XonoticServerCreateTab_gameTypeChangeNotify(entity me)
        l2 = me.checkboxFraglimitMapinfo;
        switch(gt)
        {
-               case MAPINFO_TYPE_CTF:        GameType_ConfigureSliders(e, l, l2, "Capture limit:",   1,   20, 1, "capturelimit_override");     break;
-               case MAPINFO_TYPE_DOMINATION: GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "g_domination_point_limit"); break;
-               case MAPINFO_TYPE_KEYHUNT:    GameType_ConfigureSliders(e, l, l2, "Point limit:",   200, 1500, 50, "g_keyhunt_point_limit");    break;
-               case MAPINFO_TYPE_RUNEMATCH:  GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "g_runematch_point_limit");  break;
-               case MAPINFO_TYPE_LMS:        GameType_ConfigureSliders(e, l, l2, "Lives:",           3,   50,  1, "g_lms_lives_override");     break;
-               case MAPINFO_TYPE_RACE:       GameType_ConfigureSliders(e, l, l2, "Laps:",            1,   25,  1, "g_race_laps_limit");        break;
-               case MAPINFO_TYPE_NEXBALL:    GameType_ConfigureSliders(e, l, l2, "Goals:",           1,   50,  1, "g_nexball_goallimit");      break;
-               case MAPINFO_TYPE_ASSAULT:    GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "");                         break;
-               case MAPINFO_TYPE_ONSLAUGHT:  GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "");                         break;
-               case MAPINFO_TYPE_CTS:        GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "");                         break;
-               default:                      GameType_ConfigureSliders(e, l, l2, "Frag limit:",      5,  100,  5, "fraglimit_override");       break;
+               case MAPINFO_TYPE_CTF:        GameType_ConfigureSliders(e, l, l2, _("Capture limit:"),   1,   20, 1, "capturelimit_override");     break;
+               case MAPINFO_TYPE_DOMINATION: GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "g_domination_point_limit"); break;
+               case MAPINFO_TYPE_KEYHUNT:    GameType_ConfigureSliders(e, l, l2, _("Point limit:"),   200, 1500, 50, "g_keyhunt_point_limit");    break;
+               case MAPINFO_TYPE_RUNEMATCH:  GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "g_runematch_point_limit");  break;
+               case MAPINFO_TYPE_LMS:        GameType_ConfigureSliders(e, l, l2, _("Lives:"),           3,   50,  1, "g_lms_lives_override");     break;
+               case MAPINFO_TYPE_RACE:       GameType_ConfigureSliders(e, l, l2, _("Laps:"),            1,   25,  1, "g_race_laps_limit");        break;
+               case MAPINFO_TYPE_NEXBALL:    GameType_ConfigureSliders(e, l, l2, _("Goals:"),           1,   50,  1, "g_nexball_goallimit");      break;
+               case MAPINFO_TYPE_ASSAULT:    GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "");                         break;
+               case MAPINFO_TYPE_ONSLAUGHT:  GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "");                         break;
+               case MAPINFO_TYPE_CTS:        GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "");                         break;
+               default:                      GameType_ConfigureSliders(e, l, l2, _("Frag limit:"),      5,  100,  5, "fraglimit_override");       break;
        }
        me.mapListBox.refilter(me.mapListBox);
 }
index b2b68f18ec73729fe51b1e91bf53658e8bd63070..226f346b643ae55e715a7b5e5cf87eea887412cf 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticAdvancedDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticAdvancedDialog, fill, void(entity))
        METHOD(XonoticAdvancedDialog, showNotify, void(entity))
        METHOD(XonoticAdvancedDialog, close, void(entity))
-       ATTRIB(XonoticAdvancedDialog, title, string, "Advanced server settings")
+       ATTRIB(XonoticAdvancedDialog, title, string, _("Advanced server settings"))
        ATTRIB(XonoticAdvancedDialog, color, vector, SKINCOLOR_DIALOG_ADVANCED)
        ATTRIB(XonoticAdvancedDialog, intendedWidth, float, 0.5)
        ATTRIB(XonoticAdvancedDialog, rows, float, 17)
@@ -22,39 +22,39 @@ void XonoticAdvancedDialog_fill(entity me)
 {
        entity e;
        me.TR(me);
-               me.TD(me, 1, 3, makeXonoticTextLabel(0, "Game settings:"));
+               me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Game settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "sv_spectate", "Allow spectating"));
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "sv_spectate", _("Allow spectating")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Spawn shield:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Spawn shield:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 15, 0.5, "g_spawnshieldtime"));
        me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Game speed:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Game speed:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0.5, 2.0, 0.1, "slowmo"));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, makeXonoticTextLabel(0, "Teamplay settings:"));
+               me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Teamplay settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire scale:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Friendly fire scale:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire"));
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_friendlyfire_virtual", "Virtual friendly fire (effect only)"));
+               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_friendlyfire_virtual", _("Virtual friendly fire (effect only)")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire penalty:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Friendly fire penalty:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage"));
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_mirrordamage_virtual", "Virtual penalty (effect only)"));
+               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_mirrordamage_virtual", _("Virtual penalty (effect only)")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Teams:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Teams:")));
                me.TD(me, 1, 1.6, e = makeXonoticTextSlider("g_tdm_teams_override g_domination_teams_override g_keyhunt_teams_override"));
                        e.addValue(e, "Default", "0");
                        e.addValue(e, "2 teams", "2");
@@ -63,23 +63,23 @@ void XonoticAdvancedDialog_fill(entity me)
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Map voting:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Map voting:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("g_maplist_votable"));
-                       e.addValue(e, "No voting", "0");
-                       e.addValue(e, "2 choices", "2");
-                       e.addValue(e, "3 choices", "3");
-                       e.addValue(e, "4 choices", "4");
-                       e.addValue(e, "5 choices", "5");
-                       e.addValue(e, "6 choices", "6");
-                       e.addValue(e, "7 choices", "7");
-                       e.addValue(e, "8 choices", "8");
-                       e.addValue(e, "9 choices", "9");
+                       e.addValue(e, _("No voting"), "0");
+                       e.addValue(e, _("2 choices"), "2");
+                       e.addValue(e, _("3 choices"), "3");
+                       e.addValue(e, _("4 choices"), "4");
+                       e.addValue(e, _("5 choices"), "5");
+                       e.addValue(e, _("6 choices"), "6");
+                       e.addValue(e, _("7 choices"), "7");
+                       e.addValue(e, _("8 choices"), "8");
+                       e.addValue(e, _("9 choices"), "9");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "sv_vote_simple_majority_factor", "Simple majority wins vcall"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "sv_vote_simple_majority_factor", _("Simple majority wins vcall")));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 2f2f5a2558c3a1c413b0e54dd4bcaa09d7344833..677161b637077ff6aab7d7b57f329e4cc965c9f5 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticMapInfoDialog, fill, void(entity))
        METHOD(XonoticMapInfoDialog, loadMapInfo, void(entity, float, entity))
-       ATTRIB(XonoticMapInfoDialog, title, string, "Map Information")
+       ATTRIB(XonoticMapInfoDialog, title, string, _("Map Information"))
        ATTRIB(XonoticMapInfoDialog, color, vector, SKINCOLOR_DIALOG_MAPINFO)
        ATTRIB(XonoticMapInfoDialog, intendedWidth, float, 1.0)
        ATTRIB(XonoticMapInfoDialog, rows, float, 12)
@@ -46,7 +46,7 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb)
        me.currentMapTitle = strzone(MapInfo_Map_title);
        me.currentMapAuthor = strzone(MapInfo_Map_author);
        me.currentMapDescription = strzone(MapInfo_Map_description);
-       me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? "Full item placement" : "MinstaGib only");
+       me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? _("Full item placement") : _("MinstaGib only"));
        me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
 
        me.frame.setText(me.frame, me.currentMapBSPName);
@@ -75,24 +75,24 @@ void XonoticMapInfoDialog_fill(entity me)
                me.previewImage = e;
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
        w = me.columns - me.currentColumn;
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Title:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Title:")));
                me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
                        e.colorL = SKINCOLOR_MAPLIST_TITLE;
                        e.allowCut = 1;
                        me.titleLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Author:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Author:")));
                me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
                        e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
                        e.allowCut = 1;
                        me.authorLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Features:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Features:")));
                me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.featuresLabel = e;
        me.TR(me);
-               me.TD(me, 1, w, e = makeXonoticTextLabel(0, "Game types:"));
+               me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
 
        
        n = ceil(GameType_GetCount() / (me.rows - 6));
@@ -116,10 +116,10 @@ void XonoticMapInfoDialog_fill(entity me)
        me.gotoRC(me, me.rows - 1, 0);
                me.TDempty(me, 0.5);
 
-               me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton("Close", '0 0 0'));
+               me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton(_("Close"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
-               me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton("Play", '0 0 0'));
+               me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton(_("Play"), '0 0 0'));
                        me.startButton.onClick = MapList_LoadMap;
                        me.startButton.onClickEntity = NULL; // filled later
 }
index 4390fb910e70bf582f987145fc5cb57bd0c38a67..267d237b4b713793210850fc69fbe085e9fc1a3e 100644 (file)
@@ -4,7 +4,7 @@ CLASS(XonoticMutatorsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticMutatorsDialog, fill, void(entity))
        METHOD(XonoticMutatorsDialog, showNotify, void(entity))
        METHOD(XonoticMutatorsDialog, close, void(entity))
-       ATTRIB(XonoticMutatorsDialog, title, string, "Mutators")
+       ATTRIB(XonoticMutatorsDialog, title, string, _("Mutators"))
        ATTRIB(XonoticMutatorsDialog, color, vector, SKINCOLOR_DIALOG_MUTATORS)
        ATTRIB(XonoticMutatorsDialog, intendedWidth, float, 0.9)
        ATTRIB(XonoticMutatorsDialog, rows, float, 17)
@@ -30,9 +30,9 @@ string WeaponArenaString()
        if(s == "0")
                return "";
        if(s == "all")
-               return "All Weapons Arena";
+               return _("All Weapons Arena");
        if(s == "most")
-               return "Most Weapons Arena";
+               return _("Most Weapons Arena");
        if(s == weaponarenastring_cvar)
                return weaponarenastring;
        if(weaponarenastring)
@@ -53,7 +53,7 @@ string WeaponArenaString()
                                s = strcat(s, " & ", e.message);
                }
        }
-       s = strcat(substring(s, 3, strlen(s) - 3), " Arena");
+       s = sprintf(_("%s Arena"), substring(s, 3, strlen(s) - 3));
        
        weaponarenastring = strzone(s);
 
@@ -65,37 +65,37 @@ string XonoticMutatorsDialog_toString(entity me)
        string s;
        s = "";
        if(cvar("g_dodging"))
-               s = strcat(s, ", Dodging");
+               s = strcat(s, ", ", _("Dodging"));
        if(cvar("g_minstagib"))
-               s = strcat(s, ", MinstaGib");
+               s = strcat(s, ", ", _("MinstaGib"));
        if(cvar("g_nix"))
-               s = strcat(s, ", NIX");
+               s = strcat(s, ", ", _("NIX"));
        if(cvar("g_rocket_flying"))
-               s = strcat(s, ", Rocket Flying");
+               s = strcat(s, ", ", _("Rocket Flying"));
        if(cvar_string("g_weaponarena") != "0")
                s = strcat(s, ", ", WeaponArenaString());
        if(cvar("g_start_weapon_laser") == 0)
-               s = strcat(s, ", No start weapons");
+               s = strcat(s, ", ", _("No start weapons"));
        if(cvar("sv_gravity") < 800)
-               s = strcat(s, ", Low gravity");
+               s = strcat(s, ", ", _("Low gravity"));
        if(cvar("g_cloaked"))
-               s = strcat(s, ", Cloaked");
+               s = strcat(s, ", ", _("Cloaked"));
        if(cvar("g_grappling_hook"))
-               s = strcat(s, ", Hook");
+               s = strcat(s, ", ", _("Hook"));
        if(cvar("g_midair"))
-               s = strcat(s, ", Midair");
+               s = strcat(s, ", ", _("Midair"));
        if(cvar("g_vampire"))
-               s = strcat(s, ", Vampire");
+               s = strcat(s, ", ", _("Vampire"));
        if(cvar("g_pinata"))
-               s = strcat(s, ", Pinata");
+               s = strcat(s, ", ", _("Pinata"));
        if(cvar("g_weapon_stay"))
-               s = strcat(s, ", Weapons stay");
+               s = strcat(s, ", ", _("Weapons stay"));
        if(cvar("g_bloodloss") > 0)
-               s = strcat(s, ", Bloodloss");
+               s = strcat(s, ", ", _("Bloodloss"));
        if(cvar("g_jetpack"))
-               s = strcat(s, ", Jet pack");
+               s = strcat(s, ", ", _("Jet pack"));
        if(s == "")
-               return "None";
+               return _("None");
        else
                return substring(s, 2, strlen(s) - 2);
 }
@@ -161,23 +161,23 @@ void XonoticMutatorsDialog_fill(entity me)
        float i, j;
        string str, hstr;
        me.TR(me);
-               me.TD(me, 1, 2, makeXonoticTextLabel(0, "Gameplay mutators:"));
+               me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Gameplay mutators:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_dodging", "Dodging"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_dodging", _("Dodging")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_cloaked", "Cloaked"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_cloaked", _("Cloaked")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_midair", "Midair"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_midair", _("Midair")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_vampire", "Vampire"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_vampire", _("Vampire")));
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticSlider(10, 50, 1, "g_bloodloss");
-               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(0, 1, s, "Blood loss"));
+               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(0, 1, s, _("Blood loss")));
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 1.8, s);
@@ -186,36 +186,36 @@ void XonoticMutatorsDialog_fill(entity me)
                s = makeXonoticSlider(80, 400, 8, "sv_gravity");
                        s.valueDigits = 0;
                        s.valueDisplayMultiplier = 0.125; // show gravity in percent
-               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(800, 1, s, "Low gravity"));
+               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(800, 1, s, _("Low gravity")));
                        e.savedValue = 200; // good on silvercity
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 1.8, s);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 2, makeXonoticTextLabel(0, "Weapon & item mutators:"));
+               me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Weapon & item mutators:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_grappling_hook", "Grappling hook"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_grappling_hook", _("Grappling hook")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_jetpack", "Jet pack"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_jetpack", _("Jet pack")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", "Rocket Flying"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", _("Rocket Flying")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", "Pinata"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", _("Pinata")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(2, 0, "g_weapon_stay", "Weapons stay"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(2, 0, "g_weapon_stay", _("Weapons stay")));
        me.TR(me);
 
        me.gotoRC(me, 0, 2); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Weapon arenas:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Weapon arenas:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, "Regular (no arena)"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, _("Regular (no arena)")));
        for(i = WEP_FIRST, j = 0; i <= WEP_LAST; ++i)
        {
                w = get_weaponinfo(i);
@@ -236,7 +236,7 @@ void XonoticMutatorsDialog_fill(entity me)
        }
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "menu_weaponarena_with_laser", "with laser"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "menu_weaponarena_with_laser", _("with laser")));
                        // hook the draw function to gray it out
                        e.draw_weaponarena = e.draw;
                        e.draw = preDrawLaserWeaponArenaLaserButton;
@@ -244,29 +244,29 @@ void XonoticMutatorsDialog_fill(entity me)
                        e.saveCvars_weaponarena = e.saveCvars;
                        e.saveCvars = saveCvarsLaserWeaponArenaLaserButton;
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Special arenas:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Special arenas:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_minstagib", string_null, "MinstaGib"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_minstagib", string_null, _("MinstaGib")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_nix", string_null, "NIX"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_nix", string_null, _("NIX")));
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "g_nix_with_laser", "with laser"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "g_nix_with_laser", _("with laser")));
                        setDependent(e, "g_nix", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_weaponarena", "most", "Most weapons"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_weaponarena", "most", _("Most weapons")));
                        e.cvarOffValue = "0";
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_start_weapon_laser", "0", "No start weapons"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_start_weapon_laser", "0", _("No start weapons")));
                        e.cvarOffValue = "-1";
                        makeMulti(e, "g_start_weapon_shotgun g_start_weapon_uzi g_start_weapon_grenadelauncher g_start_weapon_minelayer g_start_weapon_electro g_start_weapon_crylink g_start_weapon_nex g_start_weapon_hagar g_start_weapon_rocketlauncher g_start_weapon_sniperrifle g_start_weapon_hlac g_start_weapon_seeker g_start_weapon_minstanex g_start_weapon_hook g_start_weapon_porto g_start_weapon_tuba g_start_weapon_minelayer");
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index ec57b7fca809ec5e917f1bceafc6d82e59bf07c5..85171e094099818a2fc3f93b5fc359368dad932f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab)
        METHOD(XonoticDemoBrowserTab, fill, void(entity))
-       ATTRIB(XonoticDemoBrowserTab, title, string, "Demo")
+       ATTRIB(XonoticDemoBrowserTab, title, string, _("Demo"))
        ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticDemoBrowserTab, rows, float, 22)
        ATTRIB(XonoticDemoBrowserTab, columns, float, 6.5)
@@ -25,12 +25,12 @@ void XonoticDemoBrowserTab_fill(entity me)
        entity dlist;
 
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticCheckBox(0, "cl_autodemo", "Record demos while playing"));
+               me.TD(me, 1, me.columns, e = makeXonoticCheckBox(0, "cl_autodemo", _("Record demos while playing")));
        me.TR(me);
        dlist = makeXonoticDemoList();
        me.TR(me);
-               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Filter:"));
-               me.TD(me, 1, 0.5, btn = makeXonoticButton("Clear", '0 0 0'));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Filter:")));
+               me.TD(me, 1, 0.5, btn = makeXonoticButton(_("Clear"), '0 0 0'));
                        btn.onClick = InputBox_Clear_Click;
                me.TD(me, 1, me.columns - 1, e = makeXonoticInputBox(0, string_null));
                        e.onChange = DemoList_Filter_Change;
@@ -40,10 +40,10 @@ void XonoticDemoBrowserTab_fill(entity me)
        me.TR(me);
                me.TD(me, me.rows - 4, me.columns, dlist);
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns / 2, e = makeXonoticButton("Timedemo", '0 0 0'));
+               me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Timedemo"), '0 0 0'));
                        e.onClick = TimeDemo_Click;
                        e.onClickEntity = dlist;
-               me.TD(me, 1, me.columns / 2, e = makeXonoticButton("Play", '0 0 0'));
+               me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Play"), '0 0 0'));
                        e.onClick = StartDemo_Click;
                        e.onClickEntity = dlist;
 }
index 799d33455f19f0015025c141d4e84612c01089ab..cfe1ab06611451a4253cf58b88dcb0b0849e000a 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticServerListTab) EXTENDS(XonoticTab)
        METHOD(XonoticServerListTab, fill, void(entity))
-       ATTRIB(XonoticServerListTab, title, string, "Join")
+       ATTRIB(XonoticServerListTab, title, string, _("Join"))
        ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticServerListTab, rows, float, 22)
        ATTRIB(XonoticServerListTab, columns, float, 6.5)
@@ -25,23 +25,23 @@ void XonoticServerListTab_fill(entity me)
        slist  = makeXonoticServerList();
 
        me.TR(me);
-               me.TD(me, 1, 0.4, e = makeXonoticTextLabel(0, "Filter:"));
-               me.TD(me, 1, 0.6, btn = makeXonoticButton("Clear", '0 0 0'));
+               me.TD(me, 1, 0.4, e = makeXonoticTextLabel(0, _("Filter:")));
+               me.TD(me, 1, 0.6, btn = makeXonoticButton(_("Clear"), '0 0 0'));
                        btn.onClick = InputBox_Clear_Click;
                me.TD(me, 1, me.columns - 0.6 * 4 - 0.4, e = makeXonoticInputBox(0, string_null));
                        e.onChange = ServerList_Filter_Change;
                        e.onChangeEntity = slist;
                        btn.onClickEntity = e;
                        slist.controlledTextbox = e;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showempty", "Empty"));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showempty", _("Empty")));
                        slist.filterShowEmpty = e.checked;
                        e.onClickEntity = slist;
                        e.onClick = ServerList_ShowEmpty_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showfull", "Full"));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showfull", _("Full")));
                        slist.filterShowFull = e.checked;
                        e.onClickEntity = slist;
                        e.onClick = ServerList_ShowFull_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "net_slist_pause", "Pause"));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "net_slist_pause", _("Pause")));
 
        me.TR(me);
                me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
@@ -53,7 +53,7 @@ void XonoticServerListTab_fill(entity me)
                me.TD(me, me.rows - 4, me.columns, slist);
 
        me.gotoRC(me, me.rows - 2, 0);
-               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, "Address:"));
+               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
                me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
                        e.onEnter = ServerList_Connect_Click;
                        e.onEnterEntity = slist;
@@ -62,12 +62,12 @@ void XonoticServerListTab_fill(entity me)
                        e.onClick = ServerList_Favorite_Click;
                        e.onClickEntity = slist;
                        slist.favoriteButton = e;
-               me.TD(me, 1, 1.5, e = makeXonoticButton("Info", '0 0 0'));
+               me.TD(me, 1, 1.5, e = makeXonoticButton(_("Info"), '0 0 0'));
                        e.onClick = ServerList_Info_Click;
                        e.onClickEntity = slist;
                        slist.infoButton = e;
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("Join!", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
                        e.onClick = ServerList_Connect_Click;
                        e.onClickEntity = slist;
                        slist.connectButton = e;
index 5f6262cf45e5bdb508f69dd32f7117cd4b9c673e..5eaabf67acbdeb5110dad849e5f379f4bd78f0b3 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticServerInfoDialog, fill, void(entity))
        METHOD(XonoticServerInfoDialog, loadServerInfo, void(entity, float))
-       ATTRIB(XonoticServerInfoDialog, title, string, "Server Information")
+       ATTRIB(XonoticServerInfoDialog, title, string, _("Server Information"))
        ATTRIB(XonoticServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO)
        ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.68)
        ATTRIB(XonoticServerInfoDialog, rows, float, 15)
@@ -56,8 +56,8 @@ void Join_Click(entity btn, entity me);
 #ifdef IMPLEMENTATION
 void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
 {
-       float m, pure, j;
-       string s, typestr, versionstr, numh, maxp, k, v;
+       float m, pure, j, numh, maxp;
+       string s, typestr, versionstr, k, v;
 
        if(me.currentServerName)
                strunzone(me.currentServerName);
@@ -112,8 +112,8 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.cnameLabel.setText(me.cnameLabel, me.currentServerCName);
 
        pure = -1;
-       typestr = "N/A";
-       versionstr = "N/A";
+       typestr = _("N/A");
+       versionstr = _("N/A");
 
        SLIST_FIELD_QCSTATUS = gethostcacheindexforkey("qcstatus");
        s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
@@ -145,10 +145,10 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.rawPlayerList.setPlayerList(me.rawPlayerList, me.currentServerPlayers);
 
        SLIST_FIELD_NUMHUMANS = gethostcacheindexforkey("numhumans");
-       numh = ftos(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i));
+       numh = gethostcachenumber(SLIST_FIELD_NUMHUMANS, i);
        SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey("maxplayers");
-       maxp = ftos(gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i));
-       me.currentServerNumPlayers = strzone(strcat(numh,"/",maxp));
+       maxp = gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i);
+       me.currentServerNumPlayers = strzone(sprintf(_("%d/%d"), numh, maxp));
        me.numPlayersLabel.setText(me.numPlayersLabel, me.currentServerNumPlayers);
 
        SLIST_FIELD_NUMBOTS = gethostcacheindexforkey("numbots");
@@ -163,7 +163,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.currentServerVersion = strzone(versionstr);
        me.versionLabel.setText(me.versionLabel, me.currentServerVersion);
 
-       me.currentServerPure = ((pure < 0) ? "N/A" : (pure == 0) ? "Official settings" : sprintf("%d modified settings", pure));
+       me.currentServerPure = ((pure < 0) ? "N/A" : (pure == 0) ? _("Official settings") : sprintf(_("%d modified settings"), pure));
        me.currentServerPure = strzone(me.currentServerPure);
        me.pureLabel.setText(me.pureLabel, me.currentServerPure);
 
@@ -174,13 +174,13 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
 
        s = crypto_getidfp(me.currentServerCName);
        if not(s)
-               s = "N/A";
+               s = _("N/A");
        me.currentServerID = strzone(s);
        me.idLabel.setText(me.idLabel, me.currentServerID);
 
        s = crypto_getkeyfp(me.currentServerCName);
        if not(s)
-               s = "N/A";
+               s = _("N/A");
        me.currentServerKey = strzone(s);
        me.keyLabel.setText(me.keyLabel, me.currentServerKey);
 
@@ -188,35 +188,35 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        if(s == "")
        {
                if(cvar("crypto_aeslevel") >= 3)
-                       me.currentServerEncrypt = "N/A (can't connect)";
+                       me.currentServerEncrypt = _("N/A (can't connect)");
                else
-                       me.currentServerEncrypt = "N/A";
+                       me.currentServerEncrypt = _("N/A");
        }
        else switch(stof(substring(s, 0, 1)))
        {
                case 0:
                        if(cvar("crypto_aeslevel") >= 3)
-                               me.currentServerEncrypt = "not supported (can't connect)";
+                               me.currentServerEncrypt = _("not supported (can't connect)");
                        else
-                               me.currentServerEncrypt = "not supported (won't encrypt)";
+                               me.currentServerEncrypt = _("not supported (won't encrypt)");
                        break;
                case 1:
                        if(cvar("crypto_aeslevel") >= 2)
-                               me.currentServerEncrypt = "supported (will encrypt)";
+                               me.currentServerEncrypt = _("supported (will encrypt)");
                        else
-                               me.currentServerEncrypt = "supported (won't encrypt)";
+                               me.currentServerEncrypt = _("supported (won't encrypt)");
                        break;
                case 2:
                        if(cvar("crypto_aeslevel") >= 1)
-                               me.currentServerEncrypt = "requested (will encrypt)";
+                               me.currentServerEncrypt = _("requested (will encrypt)");
                        else
-                               me.currentServerEncrypt = "requested (won't encrypt)";
+                               me.currentServerEncrypt = _("requested (won't encrypt)");
                        break;
                case 3:
                        if(cvar("crypto_aeslevel") <= 0)
-                               me.currentServerEncrypt = "required (can't connect)";
+                               me.currentServerEncrypt = _("required (can't connect)");
                        else
-                               me.currentServerEncrypt = "required (will encrypt)";
+                               me.currentServerEncrypt = _("required (will encrypt)");
                        break;
        }
        me.encryptLabel.setText(me.encryptLabel, me.currentServerEncrypt);
@@ -237,7 +237,7 @@ void XonoticServerInfoDialog_fill(entity me)
                        me.cnameLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 5.5, e = makeXonoticTextLabel(0, "Players:"));
+               me.TD(me, 1, 5.5, e = makeXonoticTextLabel(0, _("Players:")));
        me.TR(me);
                me.TD(me, me.rows - 4, 6, e = makeXonoticPlayerList());
                        me.rawPlayerList = e;
@@ -245,70 +245,70 @@ void XonoticServerInfoDialog_fill(entity me)
        me.gotoRC(me, 1, 6.25); me.setFirstColumn(me, me.currentColumn);
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Type:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Type:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.typeLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Map:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Map:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.mapLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Gameplay:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Gameplay:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.pureLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Players:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Players:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.numPlayersLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Bots:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Bots:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.numBotsLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Mod:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Mod:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.modLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Version:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Version:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.versionLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Ping:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Ping:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.pingLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "CA:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("CA:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.keyLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Key:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Key:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.idLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Encryption:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Encryption:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.encryptLabel = e;
 
        me.gotoRC(me, me.rows - 1, 0);
 
-               me.TD(me, 1, me.columns - 6, e = makeXonoticButton("Close", '0 0 0'));
+               me.TD(me, 1, me.columns - 6, e = makeXonoticButton(_("Close"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
-               me.TD(me, 1, me.columns - 6, e = makeXonoticButton("Join!", '0 0 0'));
+               me.TD(me, 1, me.columns - 6, e = makeXonoticButton(_("Join!"), '0 0 0'));
                        e.onClick = Join_Click;
                        e.onClickEntity = me;
 }
index 9365544e9694bc4fe6c0c5730b27f6289f36dad6..d42c9aaa9366d0537b916bccc14c96ee15c754f3 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticPlayerSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticPlayerSettingsTab, fill, void(entity))
        METHOD(XonoticPlayerSettingsTab, draw, void(entity))
-       ATTRIB(XonoticPlayerSettingsTab, title, string, "Player Setup")
+       ATTRIB(XonoticPlayerSettingsTab, title, string, _("Player Setup"))
        ATTRIB(XonoticPlayerSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticPlayerSettingsTab, rows, float, 22)
        ATTRIB(XonoticPlayerSettingsTab, columns, float, 6.5)
@@ -37,7 +37,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
        float i, r, m, n;
 
        me.TR(me);
-               me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, "Name:"));
+               me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, _("Name:")));
                        me.playerNameLabelAlpha = me.playerNameLabel.alpha;
                me.TD(me, 1, 2.5, label = makeXonoticTextLabel(0, string_null));
                        label.allowCut = 1;
@@ -59,7 +59,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
        me.TR(me);
        me.gotoRC(me, 8, 0.0);
                pms = makeXonoticPlayerModelSelector();
-               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, "Model:"));
+               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Model:")));
                me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
                        e.onClick = PlayerModelSelector_Prev_Click;
                        e.onClickEntity = pms;
@@ -84,30 +84,30 @@ void XonoticPlayerSettingsTab_fill(entity me)
                }
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Field of view:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 1, "fov"));
        me.TR(me);
                sl = makeXonoticSlider(0.45, 0.75, 0.01, "cl_bobcycle");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, sl, "View bobbing:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, sl, _("View bobbing:")));
                makeMulti(sl, "cl_bob2cycle");
                me.TD(me, 1, 2, sl);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Zoom factor:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Zoom factor:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(2, 16, 0.5, "cl_zoomfactor"));
        me.TR(me);
                sl = makeXonoticSlider(1, 8, 0.5, "cl_zoomspeed");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(-1, 1, sl, "Zoom speed:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(-1, 1, sl, _("Zoom speed:")));
                me.TD(me, 1, 2, sl);
        me.TR(me);
-               me.TD(me, 1, 1.5, e = makeXonoticButton("Weapon settings...", '0 0 0'));
+               me.TD(me, 1, 1.5, e = makeXonoticButton(_("Weapon settings..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.weaponsDialog;
                me.TD(me, 1, 1.5, e0 = makeXonoticTextLabel(0, string_null));
                        e0.textEntity = main.weaponsDialog;
                        e0.allowCut = 1;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair:"));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "crosshair_per_weapon", "Per weapon"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair:")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "crosshair_per_weapon", _("Per weapon")));
        me.TR(me);
                me.TDempty(me, 0.2);
                for(i = 1; i <= 10; ++i) {
@@ -126,71 +126,71 @@ void XonoticPlayerSettingsTab_fill(entity me)
                }
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair size:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair size:")));
                me.TD(me, 1, 1.8, e = makeXonoticSlider(0.10, 1.5, 0.05, "crosshair_size"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair alpha:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair alpha:")));
                me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair color:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair color:")));
                me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
                setDependent(e, "crosshair_color_per_weapon", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.3);
-               me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", "Per weapon"));
+               me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", _("Per weapon")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable center dot"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center dot")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Size:"));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Size:")));
                me.TD(me, 1, 0.9, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
                        setDependent(e, "crosshair_dot", 1, 1);
-               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Alpha:")));
                me.TD(me, 1, 0.9, e = makeXonoticSlider(0.10, 1, 0.1, "crosshair_dot_alpha"));
                        setDependent(e, "crosshair_dot", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Hit test:"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "0",    "None"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1",    "TrueAim"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1.25", "Enemies"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit test:")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "0",    _("None")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1",    _("TrueAim")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1.25", _("Enemies")));
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 2.2, e = makeXonoticButton("Waypoints setup...", '0 0 0'));
+               me.TD(me, 1, 2.2, e = makeXonoticButton(_("Waypoints setup..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.waypointDialog;
                me.TDempty(me, 0.5);
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 2.2, e = makeXonoticButton("Enter HUD editor", '0 0 0'));
+               me.TD(me, 1, 2.2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
                        e.onClick = HUDSetup_Join_Click;
                        e.onClickEntity = me;
                me.TDempty(me, 0.5);
        me.TR(me);
        me.TR(me);
        #ifdef ALLOW_FORCEMODELS
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Force models:"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, string_null, string_null, "None"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodelsfromxonotic", string_null, "Custom"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodels", string_null, "All"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Force models:")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, string_null, string_null, _("None")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodelsfromxonotic", string_null, _("Custom")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodels", string_null, _("All")));
        #endif
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_gentle", "Disable gore effects"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_gentle", _("Disable gore effects")));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Gibs:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gibs:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_nogibs"));
-                       e.addValue(e, "None", "1");
-                       e.addValue(e, "Few", "0.75");
-                       e.addValue(e, "Many", "0.5");
-                       e.addValue(e, "Lots", "0");
+                       e.addValue(e, _("None"), "1");
+                       e.addValue(e, _("Few"), "0.75");
+                       e.addValue(e, _("Many"), "0.5");
+                       e.addValue(e, _("Lots"), "0");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "cl_gentle", 0, 0);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Damage splash:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage splash:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
 }
 void HUDSetup_Join_Click(entity me, entity btn)
 {
index dcc6a64f3681652d777d6fcf090ccf9779b60059..470fc678522c6a4f49decbdd864252512119d8d0 100644 (file)
@@ -1,9 +1,8 @@
 #ifdef INTERFACE
 CLASS(XonoticWaypointDialog) EXTENDS(XonoticDialog)
-       METHOD(XonoticWaypointDialog, toString, string(entity))
        METHOD(XonoticWaypointDialog, fill, void(entity))
        METHOD(XonoticWaypointDialog, showNotify, void(entity))
-       ATTRIB(XonoticWaypointDialog, title, string, "Waypoints")
+       ATTRIB(XonoticWaypointDialog, title, string, _("Waypoints"))
        ATTRIB(XonoticWaypointDialog, color, vector, SKINCOLOR_DIALOG_RADAR)
        ATTRIB(XonoticWaypointDialog, intendedWidth, float, 0.7)
        ATTRIB(XonoticWaypointDialog, rows, float, 6)
@@ -16,39 +15,35 @@ void XonoticWaypointDialog_showNotify(entity me)
 {
         loadAllCvars(me);
 }
-string XonoticWaypointDialog_toString(entity me)
-{
-       return "XXX";
-}
 void XonoticWaypointDialog_fill(entity me)
 {
        entity e;
        
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Waypoint settings:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Waypoint settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(1, "cl_hidewaypoints", "Show base waypoints"));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Show base waypoints")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint scale:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Waypoint scale:")));
                        me.TD(me, 1, 3, e = makeXonoticSlider(0.5, 1.5, 0.01, "g_waypointsprite_scale"));
                                setDependent(e, "cl_hidewaypoints", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint alpha:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Waypoint alpha:")));
                        me.TD(me, 1, 3, e = makeXonoticSlider(0.1, 1, 0.01, "g_waypointsprite_alpha"));
                                setDependent(e, "cl_hidewaypoints", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Show names:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Show names:")));
                me.TD(me, 1, 3, e = makeXonoticTextSlider("cl_shownames"));
-                       e.addValue(e, "Never", "0");
-                       e.addValue(e, "Teammates", "1");
-                       e.addValue(e, "All players", "2");
+                       e.addValue(e, _("Never"), "0");
+                       e.addValue(e, _("Teammates"), "1");
+                       e.addValue(e, _("All players"), "2");
                        e.configureXonoticTextSliderValues(e);
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index ca6d705c6fd68df9a85226533dd8573c9601faa5..ed5802a972d5dfcbd6ccef2671a412b821df8d44 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticWeaponsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticWeaponsDialog, toString, string(entity))
        METHOD(XonoticWeaponsDialog, fill, void(entity))
        METHOD(XonoticWeaponsDialog, showNotify, void(entity))
-       ATTRIB(XonoticWeaponsDialog, title, string, "Weapon settings")
+       ATTRIB(XonoticWeaponsDialog, title, string, _("Weapon settings"))
        ATTRIB(XonoticWeaponsDialog, color, vector, SKINCOLOR_DIALOG_WEAPONS)
        ATTRIB(XonoticWeaponsDialog, intendedWidth, float, 0.5)
        ATTRIB(XonoticWeaponsDialog, rows, float, 17)
@@ -26,33 +26,33 @@ void XonoticWeaponsDialog_fill(entity me)
        entity e;
 
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Weapon priority list:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Weapon priority list:")));
        me.TR(me);
                me.TD(me, 9, 4, e = me.weaponsList = makeXonoticWeaponsList());
        me.gotoRC(me, 10, 0);
                me.TDempty(me, 1);
-               me.TD(me, 1, 1, e = makeXonoticButton("Up", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Up"), '0 0 0'));
                        e.onClick = WeaponsList_MoveUp_Click;
                        e.onClickEntity = me.weaponsList;
-               me.TD(me, 1, 1, e = makeXonoticButton("Down", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Down"), '0 0 0'));
                        e.onClick = WeaponsList_MoveDown_Click;
                        e.onClickEntity = me.weaponsList;
        me.gotoRC(me, 11, 0);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", "Use priority list for weapon cycling"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_autoswitch", "Auto switch weapons on pickup"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_autoswitch", _("Auto switch weapons on pickup")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_drawviewmodel", "Draw 1st person weapon model"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_drawviewmodel", _("Draw 1st person weapon model")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "4", "Left align"));
+               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "4", _("Left align")));
                        setDependent(e, "r_drawviewmodel", 1, 1);
-               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "3", "Right align"));
+               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "3", _("Right align")));
                        setDependent(e, "r_drawviewmodel", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_flipped", "Flip view horizontally"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_flipped", _("Flip view horizontally")));
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 92726f842ac7fba26700c42bf8ea235f847a2067..12cf0c23bc72fcd5ee78abd5fa6609bccb6f6701 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticNewsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticNewsDialog, fill, void(entity))
-       ATTRIB(XonoticNewsDialog, title, string, "News")
+       ATTRIB(XonoticNewsDialog, title, string, _("News"))
        ATTRIB(XonoticNewsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS)
        ATTRIB(XonoticNewsDialog, intendedWidth, float, 0.96)
        ATTRIB(XonoticNewsDialog, rows, float, 24)
index 0229e026766d4037daa76339c003a3e910f4a80f..6d9dde47b30d80dd2be57c1b396dde04e13f192f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticQuitDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticQuitDialog, fill, void(entity))
-       ATTRIB(XonoticQuitDialog, title, string, "Quit")
+       ATTRIB(XonoticQuitDialog, title, string, _("Quit"))
        ATTRIB(XonoticQuitDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
        ATTRIB(XonoticQuitDialog, intendedWidth, float, 0.5)
        ATTRIB(XonoticQuitDialog, rows, float, 3)
@@ -14,11 +14,11 @@ void XonoticQuitDialog_fill(entity me)
 {
        entity e;
        me.TR(me);
-               me.TD(me, 1, 2, makeXonoticTextLabel(0.5, "Are you sure you want to quit?"));
+               me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to quit?")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCommandButton("Yes", '1 0 0', "quit", 0));
-               me.TD(me, 1, 1, e = makeXonoticButton("No", '0 1 0'));
+               me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Yes"), '1 0 0', "quit", 0));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 87273b24c653eb5c7c89e2635bce336341f544d9..f4a6c5a3e3dc40adbefdaf5d4eb1f7a75b94be4a 100644 (file)
@@ -47,7 +47,7 @@ void Xonotic_KeyBinds_Read()
        string s;
 
        Xonotic_KeyBinds_Count = 0;
-       fh = fopen("keybinds.txt", FILE_READ);
+       fh = fopen(language_filename("keybinds.txt"), FILE_READ);
        if(fh < 0)
                return;
        while((s = fgets(fh)))
index 72e5faac36fa62d140a0d52b95e55853b2b24252..18fdcf5c087240599ec62cb516e1b04e3dbc11db 100644 (file)
@@ -19,10 +19,10 @@ ENDCLASS(MainWindow)
 
 void DemoButton_Click(entity me, entity other)
 {
-       if(me.text == "Do not press this button again!")
+       if(me.text == _("Do not press this button again!"))
                DialogOpenButton_Click(me, other);
        else
-               me.setText(me, "Do not press this button again!");
+               me.setText(me, _("Do not press this button again!"));
 }
 
 void MainWindow_configureMainWindow(entity me)
index 8b5ce6d6a7b46a3a9c58f0e1b090b47ee71c52c0..1390ff3b1a1c22abd115612719341a3ac234b0f1 100644 (file)
@@ -275,20 +275,22 @@ void MapList_LoadMap(entity btn, entity me)
        m = MapInfo_BSPName_ByID(i);
        if not(m)
        {
-               print("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n");
+               print(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
+               me.refilter(me);
                return;
        }
        if(MapInfo_CheckMap(m))
        {
                localcmd("\nmenu_loadmap_prepare\n");
                if(cvar("menu_use_default_hostname"))
-                       localcmd("hostname \"", strdecolorize(cvar_string("_cl_name")), "'s Xonotic server\"\n");
+                       localcmd("hostname \"", sprintf(_("%s's Xonotic Server"), strdecolorize(cvar_string("_cl_name"))), "\"\n");
                MapInfo_LoadMap(m);
        }
        else
        {
-               print("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n");
+               print(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
                me.refilter(me);
+               return;
        }
 }
 
index bbef3a6b1c2d6acdeb245a401e18f3d4b1afa00c..ef02224dfaf8bc332b45d4947b78f131fcb33e83 100644 (file)
@@ -47,7 +47,7 @@ void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me)
        float sortbuf, glob, i;
        string fn;
 
-       glob = search_begin(get_model_datafilename(string_null, -1, "txt"), TRUE, TRUE);
+       glob = search_begin(language_filename(get_model_datafilename(string_null, -1, "txt")), TRUE, TRUE);
        if (glob < 0)
                return;
 
@@ -77,11 +77,11 @@ void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me)
                bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_SKIN, ftos(get_model_parameters_modelskin));
                get_model_parameters_desc = strcat(get_model_parameters_desc, "\n");
                if(get_model_parameters_sex)
-                       get_model_parameters_desc = strcat(get_model_parameters_desc, "\nSex: ", get_model_parameters_sex);
+                       get_model_parameters_desc = strcat(get_model_parameters_desc, sprintf("\nSex: %s", get_model_parameters_sex));
                if(get_model_parameters_weight)
-                       get_model_parameters_desc = strcat(get_model_parameters_desc, "\nWeight: ", ftos(get_model_parameters_weight), " kg");
+                       get_model_parameters_desc = strcat(get_model_parameters_desc, sprintf("\nWeight: %g kg", get_model_parameters_weight));
                if(get_model_parameters_age)
-                       get_model_parameters_desc = strcat(get_model_parameters_desc, "\nAge: ", ftos(get_model_parameters_age));
+                       get_model_parameters_desc = strcat(get_model_parameters_desc, sprintf("\nAge: %g", get_model_parameters_age));
                while(substring(get_model_parameters_desc, -1, 1) == "\n")
                        get_model_parameters_desc = substring(get_model_parameters_desc, 0, -2);
                bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_DESC, get_model_parameters_desc);
@@ -171,7 +171,7 @@ void XonoticPlayerModelSelector_draw(entity me)
 
        if (me.numModels <= 0)
        {
-               draw_CenterText('0.5 0.5 0', "<no model found>", me.realFontSize, '1 1 1', 0.6, FALSE);
+               draw_CenterText('0.5 0.5 0', _("<no model found>"), me.realFontSize, '1 1 1', 0.6, FALSE);
                return;
        }
 
index efc00822d8f72456979fd721890afcfe4798e3af..e8c9db364e9d3caaa31f4ee904b82ebc08c33523 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticRootDialog) EXTENDS(XonoticDialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
-       ATTRIB(XonoticDialog, title, string, "Form1") // ;)
+       ATTRIB(XonoticDialog, title, string, _("Form1")) // ;)
        ATTRIB(XonoticDialog, color, vector, '1 0.5 1')
        ATTRIB(XonoticDialog, intendedWidth, float, 0)
        ATTRIB(XonoticDialog, rows, float, 3)
index 4128935795eb24d285b1730f0db8f199936d5792..3cd3338bc74f5541e31383cf11c09b7f23ee24ae 100644 (file)
@@ -354,9 +354,9 @@ void XonoticServerList_draw(entity me)
                if(me.ipAddressBox.focused || me.ipAddressBoxFocused < 0)
                {
                        if(IsFavorite(me.ipAddressBox.text))
-                               me.favoriteButton.setText(me.favoriteButton, "Remove");
+                               me.favoriteButton.setText(me.favoriteButton, _("Remove"));
                        else
-                               me.favoriteButton.setText(me.favoriteButton, "Bookmark");
+                               me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
                }
                me.ipAddressBoxFocused = me.ipAddressBox.focused;
        }
@@ -512,11 +512,11 @@ void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize,
        me.columnTypeOrigin = me.columnMapOrigin + me.columnMapSize + me.realFontSize_x;
        me.columnPlayersOrigin = me.columnTypeOrigin + me.columnTypeSize + me.realFontSize_x;
 
-       me.positionSortButton(me, me.sortButton1, me.columnPingOrigin, me.columnPingSize, "Ping", ServerList_PingSort_Click);
-       me.positionSortButton(me, me.sortButton2, me.columnNameOrigin, me.columnNameSize, "Host name", ServerList_NameSort_Click);
-       me.positionSortButton(me, me.sortButton3, me.columnMapOrigin, me.columnMapSize, "Map", ServerList_MapSort_Click);
-       me.positionSortButton(me, me.sortButton4, me.columnTypeOrigin, me.columnTypeSize, "Type", ServerList_TypeSort_Click);
-       me.positionSortButton(me, me.sortButton5, me.columnPlayersOrigin, me.columnPlayersSize, "Players", ServerList_PlayerSort_Click);
+       me.positionSortButton(me, me.sortButton1, me.columnPingOrigin, me.columnPingSize, _("Ping"), ServerList_PingSort_Click);
+       me.positionSortButton(me, me.sortButton2, me.columnNameOrigin, me.columnNameSize, _("Host name"), ServerList_NameSort_Click);
+       me.positionSortButton(me, me.sortButton3, me.columnMapOrigin, me.columnMapSize, _("Map"), ServerList_MapSort_Click);
+       me.positionSortButton(me, me.sortButton4, me.columnTypeOrigin, me.columnTypeSize, _("Type"), ServerList_TypeSort_Click);
+       me.positionSortButton(me, me.sortButton5, me.columnPlayersOrigin, me.columnPlayersSize, _("Players"), ServerList_PlayerSort_Click);
 
        float f;
        f = me.currentSortField;
index 864b3054a5bb85dccbabb3b538ecf76bc0b8fb82..bb01f974cbf1d0c6312b57cd8ec40c1f0107edca 100644 (file)
@@ -102,10 +102,10 @@ void XonoticSkinList_getSkins(entity me)
        {
                s = search_getfilename(glob, i);
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, substring(s, 9, strlen(s) - 24)); // the * part
-               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, "<TITLE>");
-               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, "<AUTHOR>");
+               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, _("<TITLE>"));
+               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, _("<AUTHOR>"));
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview"));
-               fh = fopen(s, FILE_READ);
+               fh = fopen(language_filename(s), FILE_READ);
                if(fh < 0)
                {
                        print("Warning: can't open skinvalues.txt file\n");
@@ -160,7 +160,7 @@ void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float i
        draw_Picture(me.columnPreviewOrigin * eX, s, me.columnPreviewSize * eX + eY, '1 1 1', 1);
        
        s = me.skinParameter(me, i, SKINPARM_NAME);
-       s = strcat(s, ": ", me.skinParameter(me, i, SKINPARM_TITLE));
+       s = sprintf(_("%s: %s"), s, me.skinParameter(me, i, SKINPARM_TITLE));
        s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_TITLE, SKINALPHA_TEXT, 0);
 
index 0e4b4e3720e8c0bece5fe57d26cf79620c6428ce..6ee8ca7c4d87d3a0081c27efdda456b82f91d85c 100644 (file)
@@ -47,10 +47,10 @@ void XonoticDecibelsSlider_saveCvars(entity me)
 string XonoticDecibelsSlider_valueToText(entity me, float v)
 {
        if(v < -33)
-               return "OFF";
+               return _("OFF");
        else if(v >= -0.1)
-               return "MAX";
-       return strcat(SUPER(XonoticDecibelsSlider).valueToText(me, v), " dB");
+               return _("MAX");
+       return sprintf(_("%s dB"), SUPER(XonoticDecibelsSlider).valueToText(me, v));
 }
 
 #endif
index 06991f35a1b8f50da04e57aa74402e6b690a3842..d5d013048e9c67b874487f84a7d2f15bacee8192 100644 (file)
@@ -62,7 +62,7 @@ entity makeXonoticResolutionSlider()
 }
 void XonoticResolutionSlider_addResolution(entity me, float w, float h, float pixelheight)
 {
-       me.addValue(me, strzone(strcat(ftos(w), "x", ftos(h))), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
+       me.addValue(me, strzone(sprintf(_("%dx%d"), w, h)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
        // FIXME (in case you ever want to dynamically instantiate this): THIS IS NEVER FREED
 }
 void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me)
index 91572fdf9d3904eccdcbfcb7de8d8f801ef250d2..81b2bff697449f5c186578a0ff8631dfcc0ffb5e 100644 (file)
@@ -11,7 +11,7 @@ float GL_Have_TextureCompression()
 float tooltipdb;
 void loadTooltips()
 {
-       tooltipdb = db_load("tooltips.db");
+       tooltipdb = db_load(language_filename("tooltips.db"));
 }
 void unloadTooltips()
 {
@@ -260,7 +260,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
+               print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id));
        }
 }
 
@@ -270,22 +270,22 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
 
        if(_Nex_ExtResponseSystem_UpdateTo)
        {
-               print("error: UpdateNotification_URI_Get_Callback has been called before\n");
+               dprint("error: UpdateNotification_URI_Get_Callback has been called before\n");
                return;
        }
        if(status != 0)
        {
-               print(sprintf("error receiving update notification: status is %d\n", status));
+               print(sprintf(_("error receiving update notification: status is %d\n"), status));
                return;
        }
        if(substring(data, 0, 1) == "<")
        {
-               print("error: received HTML instead of an update notification\n");
+               print(_("error: received HTML instead of an update notification\n"));
                return;
        }
        if(strstrofs(data, "\r", 0) != -1)
        {
-               print("error: received carriage returns from update notification server\n");
+               print(_("error: received carriage returns from update notification server\n"));
                return;
        }
 
@@ -306,7 +306,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                {
                        // update needed
                        if(n >= 2)
-                               print(sprintf("Update can be downloaded at:\n%s\n", argv(1)));
+                               print(sprintf(_("Update can be downloaded at:\n%s\n"), argv(1)));
                }
 
                _Nex_ExtResponseSystem_UpdateTo = strzone(_Nex_ExtResponseSystem_UpdateTo);
@@ -327,7 +327,7 @@ float preMenuInit()
                draw_reset_cropped();
 
                sz = eX * 0.025 + eY * 0.025 * (draw_scale_x / draw_scale_y);
-               draw_CenterText('0.5 0.5 0' - 1.25 * sz_y * eY, "Autogenerating mapinfo for newly added maps...", sz, '1 1 1', 1, 0);
+               draw_CenterText('0.5 0.5 0' - 1.25 * sz_y * eY, _("Autogenerating mapinfo for newly added maps..."), sz, '1 1 1', 1, 0);
 
                boxA = '0.05 0.5 0' + 0.25 * sz_y * eY;
                boxB = '0.95 0.5 0' + 1.25 * sz_y * eY;
@@ -414,7 +414,7 @@ void preMenuDraw()
                // TODO rather turn this into a dialog
                fs = ((1/draw_scale_x) * eX + (1/draw_scale_y) * eY) * 12;
                line = eY * fs_y;
-               sz_x = draw_TextWidth("  http://www.xonotic.com/  ", 0, fs);
+               sz_x = draw_TextWidth("  http://www.xonotic.org/  ", 0, fs);
                sz_y = 3 * fs_y;
 
                draw_alpha = sin(time * 0.112 - 0.3) * 10;
@@ -499,7 +499,7 @@ float updateCompression()
                cvar_set("gl_texturecompression", "1");
                cvar_set("r_texture_dds_load", "1");
                if(!can_dds)
-                       print("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n");
+                       print(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
                return 0;
        }
        else
@@ -521,22 +521,22 @@ float updateCompression()
 
 // note: include only those that should be in the menu!
 #define GAMETYPES \
-       GAMETYPE(MAPINFO_TYPE_ARENA, "Arena") \
-       GAMETYPE(MAPINFO_TYPE_ASSAULT, "Assault") \
-       GAMETYPE(MAPINFO_TYPE_CTF, "Capture The Flag") \
-       GAMETYPE(MAPINFO_TYPE_CA, "Clan Arena") \
-       GAMETYPE(MAPINFO_TYPE_DEATHMATCH, "Deathmatch") \
-       GAMETYPE(MAPINFO_TYPE_DOMINATION, "Domination") \
-       GAMETYPE(MAPINFO_TYPE_FREEZETAG, "Freeze Tag") \
-       GAMETYPE(MAPINFO_TYPE_KEEPAWAY, "Keepaway") \
-       GAMETYPE(MAPINFO_TYPE_KEYHUNT, "Key Hunt") \
-       GAMETYPE(MAPINFO_TYPE_LMS, "Last Man Standing") \
-       GAMETYPE(MAPINFO_TYPE_NEXBALL, "Nexball") \
-       GAMETYPE(MAPINFO_TYPE_ONSLAUGHT, "Onslaught") \
-       GAMETYPE(MAPINFO_TYPE_RACE, "Race") \
-       GAMETYPE(MAPINFO_TYPE_CTS, "Race CTS") \
-       GAMETYPE(MAPINFO_TYPE_RUNEMATCH, "Runematch") \
-       GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH, "Team Deathmatch") \
+       GAMETYPE(MAPINFO_TYPE_ARENA, _("Arena")) \
+       GAMETYPE(MAPINFO_TYPE_ASSAULT, _("Assault")) \
+       GAMETYPE(MAPINFO_TYPE_CTF, _("Capture The Flag")) \
+       GAMETYPE(MAPINFO_TYPE_CA, _("Clan Arena")) \
+       GAMETYPE(MAPINFO_TYPE_DEATHMATCH, _("Deathmatch")) \
+       GAMETYPE(MAPINFO_TYPE_DOMINATION, _("Domination")) \
+       GAMETYPE(MAPINFO_TYPE_FREEZETAG, _("Freeze Tag")) \
+       GAMETYPE(MAPINFO_TYPE_KEEPAWAY, _("Keepaway")) \
+       GAMETYPE(MAPINFO_TYPE_KEYHUNT, _("Key Hunt")) \
+       GAMETYPE(MAPINFO_TYPE_LMS, _("Last Man Standing")) \
+       GAMETYPE(MAPINFO_TYPE_NEXBALL, _("Nexball")) \
+       GAMETYPE(MAPINFO_TYPE_ONSLAUGHT, _("Onslaught")) \
+       GAMETYPE(MAPINFO_TYPE_RACE, _("Race")) \
+       GAMETYPE(MAPINFO_TYPE_CTS, _("Race CTS")) \
+       GAMETYPE(MAPINFO_TYPE_RUNEMATCH, _("Runematch")) \
+       GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH, _("Team Deathmatch")) \
        /* nothing */
 
 float GameType_GetID(float cnt)
@@ -555,7 +555,7 @@ string GameType_GetName(float cnt)
 #define GAMETYPE(id,name) if(i++ == cnt) return name;
        GAMETYPES
 #undef GAMETYPE
-       return "@!#%'n Tuba Throwing";
+       return _("@!#%'n Tuba Throwing");
 }
 float GameType_GetCount()
 {
@@ -567,3 +567,77 @@ float GameType_GetCount()
        return i;
 }
 
+string language_filename(string s)
+{
+       string fn;
+       float fh;
+       fn = cvar_string("prvm_language");
+       if(fn == "" || fn == "dump")
+               return s;
+       fn = strcat(s, ".", fn);
+       if((fh = fopen(fn, FILE_READ)) >= 0)
+       {
+               fclose(fh);
+               return fn;
+       }
+       return s;
+}
+
+void dialog_hudpanel_common_notoggle(entity me, string panelname)
+{
+       float i;
+       entity e;
+
+       me.TR(me);
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
+                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
+                               e.addValue(e, _("Default"), "");
+                               e.addValue(e, _("Disable"), "0");
+                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
+               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
+                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), _("Use default")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Border size:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
+                               e.addValue(e, _("Default"), "");
+                               e.addValue(e, _("Disable"), "0");
+                               for(i = 1; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
+                               e.addValue(e, _("Default"), "");
+                               for(i = 1; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team Color:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
+                               e.addValue(e, _("Default"), "");
+                               e.addValue(e, _("Disable"), "0");
+                               for(i = 1; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.4);
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", _("Test the team color in HUD configure mode")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Padding:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
+                               e.addValue(e, _("Default"), "");
+                               for(i = 0; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
+                               e.configureXonoticTextSliderValues(e);
+}
index 99ede2a9b83167f187847f6a3880c11f986f2657..2cdfe87c7924b167dc92899b7beb41901a11a2ea 100644 (file)
@@ -40,3 +40,13 @@ void URI_Get_Callback(float id, float status, string data);
 float GameType_GetID(float cnt);
 string GameType_GetName(float cnt);
 float GameType_GetCount();
+
+void dialog_hudpanel_common_notoggle(entity me, string panelname);
+#define DIALOG_HUDPANEL_COMMON_NOTOGGLE() \
+       dialog_hudpanel_common_notoggle(me, panelname)
+#define DIALOG_HUDPANEL_COMMON() \
+       me.TR(me); \
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE()
+
+string language_filename(string s);