From 5f6f1176338117eb3661c19e2e75461edaff8631 Mon Sep 17 00:00:00 2001 From: mattn Date: Sat, 5 Jul 2008 08:53:43 +0000 Subject: [PATCH] * reactivated some old quake2 code * more translateable strings git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@296 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- plugins/image/image.cpp | 46 ++++++++--------- radiant.pot | 79 +++++++++++++++++++++++++++- radiant/groupdialog.cpp | 111 ++++++++++++++++++++-------------------- radiant/groupdialog.h | 6 +-- radiant/preferences.cpp | 2 +- 5 files changed, 159 insertions(+), 85 deletions(-) diff --git a/plugins/image/image.cpp b/plugins/image/image.cpp index 34dd6709..f7822db4 100644 --- a/plugins/image/image.cpp +++ b/plugins/image/image.cpp @@ -2,30 +2,30 @@ Copyright (c) 2001, Loki software, inc. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of Loki software nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior -written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // @@ -50,8 +50,8 @@ _QERFileSystemTable g_FileSystemTable; CSynapseServer* g_pSynapseServer = NULL; CSynapseClientImage g_SynapseClient; -static const XMLConfigEntry_t entries[] = - { +static const XMLConfigEntry_t entries[] = + { { VFS_MAJOR, SYN_REQUIRE, sizeof(g_FileSystemTable), &g_FileSystemTable }, { NULL, SYN_UNKNOWN, 0, NULL } }; @@ -73,26 +73,26 @@ extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const g_SynapseClient.AddAPI(IMAGE_MAJOR, "jpg", sizeof(_QERPlugImageTable)); g_SynapseClient.AddAPI(IMAGE_MAJOR, "tga", sizeof(_QERPlugImageTable)); - // NOTE: these two are for md2 support + // NOTE: these two are for md2 support - check b_isQuake2 here? // instead of requesting them systematically, we could request them per-config before enabling Q2 support g_SynapseClient.AddAPI(IMAGE_MAJOR, "pcx", sizeof(_QERPlugImageTable)); g_SynapseClient.AddAPI(IMAGE_MAJOR, "bmp", sizeof(_QERPlugImageTable)); g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); - + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { return NULL; } - + return &g_SynapseClient; } bool CSynapseClientImage::RequestAPI(APIDescriptor_t *pAPI) { if (!strcmp(pAPI->major_name, "image")) - { + { _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable); if (!strcmp(pAPI->minor_name, "jpg")) - { + { pTable->m_pfnLoadImage = &LoadJPG; return true; } diff --git a/radiant.pot b/radiant.pot index d43b3813..414a650a 100644 --- a/radiant.pot +++ b/radiant.pot @@ -2166,6 +2166,7 @@ msgid "Mapped Commands" msgstr "" #: radiant/gtkdlgs.cpp:2824 radiant/gtkdlgs.cpp:1707 radiant/gtkdlgs.cpp:2823 +#: radiant/groupdialog.cpp:1475 msgid "Key" msgstr "" @@ -2333,7 +2334,7 @@ msgstr "" msgid "Count" msgstr "" -#: radiant/gtkdlgs.cpp:1713 +#: radiant/gtkdlgs.cpp:1713 radiant/groupdialog.cpp:1466 msgid "Value" msgstr "" @@ -2671,3 +2672,79 @@ msgstr "" #: radiant/surfacedialog.cpp:892 msgid "Test" msgstr "" + +#: radiant/groupdialog.cpp:1344 +msgid "!Easy" +msgstr "" + +#: radiant/groupdialog.cpp:1352 +msgid "!Medium" +msgstr "" + +#: radiant/groupdialog.cpp:1360 +msgid "!Hard" +msgstr "" + +#: radiant/groupdialog.cpp:1368 +msgid "!DeathMatch" +msgstr "" + +#: radiant/groupdialog.cpp:1495 +msgid "360" +msgstr "" + +#: radiant/groupdialog.cpp:1504 +msgid "45" +msgstr "" + +#: radiant/groupdialog.cpp:1513 +msgid "90" +msgstr "" + +#: radiant/groupdialog.cpp:1523 +msgid "135" +msgstr "" + +#: radiant/groupdialog.cpp:1532 +msgid "180" +msgstr "" + +#: radiant/groupdialog.cpp:1541 +msgid "225" +msgstr "" + +#: radiant/groupdialog.cpp:1550 +msgid "270" +msgstr "" + +#: radiant/groupdialog.cpp:1559 +msgid "315" +msgstr "" + +#: radiant/groupdialog.cpp:1574 +msgid "Reset" +msgstr "" + +#: radiant/groupdialog.cpp:1581 +msgid "Up" +msgstr "" + +#: radiant/groupdialog.cpp:1588 +msgid "Dn" +msgstr "" + +#: radiant/groupdialog.cpp:1601 +msgid "Del Key/Pair" +msgstr "" + +#: radiant/groupdialog.cpp:1608 +msgid "Sound..." +msgstr "" + +#: radiant/groupdialog.cpp:1615 +msgid "Model..." +msgstr "" + +#: radiant/groupdialog.cpp:1644 +msgid "Console" +msgstr "" diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 2c72a8cb..acfca286 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -1340,40 +1340,39 @@ void GroupDlg::Create () EntWidgets[EntCheck1+i] = check; } - //++timo cleanme: these flags where Q2 stuff - /* - check = gtk_check_button_new_with_label ("!Easy"); - gtk_widget_show (check); - gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); - gtk_table_attach (GTK_TABLE (table), check, 2, 3, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - EntWidgets[EntCheck17] = check; - - check = gtk_check_button_new_with_label ("!Medium"); - gtk_widget_show (check); - gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); - gtk_table_attach (GTK_TABLE (table), check, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - EntWidgets[EntCheck18] = check; - - check = gtk_check_button_new_with_label ("!Hard"); - gtk_widget_show (check); - gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); - gtk_table_attach (GTK_TABLE (table), check, 2, 3, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - EntWidgets[EntCheck19] = check; - - check = gtk_check_button_new_with_label ("!DeathMatch"); - gtk_widget_show (check); - gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); - gtk_table_attach (GTK_TABLE (table), check, 2, 3, 3, 4, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - EntWidgets[EntCheck20] = check; - */ + if (g_pGameDescription->quake2 || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" )) { + GtkWidget *check = gtk_check_button_new_with_label (_("!Easy")); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); +/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/ + EntWidgets[EntCheck17] = check; + + check = gtk_check_button_new_with_label (_("!Medium")); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); +/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/ + EntWidgets[EntCheck18] = check; + + check = gtk_check_button_new_with_label (_("!Hard")); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); +/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/ + EntWidgets[EntCheck19] = check; + + check = gtk_check_button_new_with_label (_("!DeathMatch")); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); +/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/ + EntWidgets[EntCheck20] = check; + } } { @@ -1464,7 +1463,7 @@ void GroupDlg::Create () } { - GtkWidget* label = gtk_label_new ("Value"); + GtkWidget* label = gtk_label_new (_("Value")); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), @@ -1473,7 +1472,7 @@ void GroupDlg::Create () } { - GtkWidget* label = gtk_label_new ("Key"); + GtkWidget* label = gtk_label_new (_("Key")); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), @@ -1493,7 +1492,7 @@ void GroupDlg::Create () gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, TRUE, 0); { - GtkWidget* button = gtk_button_new_with_label ("360"); + GtkWidget* button = gtk_button_new_with_label (_("360")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"360"); gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, @@ -1502,7 +1501,7 @@ void GroupDlg::Create () } { - GtkWidget* button = gtk_button_new_with_label ("45"); + GtkWidget* button = gtk_button_new_with_label (_("45")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"45"); gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, @@ -1511,7 +1510,7 @@ void GroupDlg::Create () } { - GtkWidget* button = gtk_button_new_with_label ("90"); + GtkWidget* button = gtk_button_new_with_label (_("90")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"90"); gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, @@ -1521,7 +1520,7 @@ void GroupDlg::Create () { - GtkWidget* button = gtk_button_new_with_label ("135"); + GtkWidget* button = gtk_button_new_with_label (_("135")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"135"); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, @@ -1530,7 +1529,7 @@ void GroupDlg::Create () } { - GtkWidget* button = gtk_button_new_with_label ("180"); + GtkWidget* button = gtk_button_new_with_label (_("180")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"180"); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, @@ -1539,7 +1538,7 @@ void GroupDlg::Create () } { - GtkWidget* button = gtk_button_new_with_label ("225"); + GtkWidget* button = gtk_button_new_with_label (_("225")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"225"); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 2, 3, @@ -1548,7 +1547,7 @@ void GroupDlg::Create () } { - GtkWidget* button = gtk_button_new_with_label ("270"); + GtkWidget* button = gtk_button_new_with_label (_("270")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"270"); gtk_table_attach (GTK_TABLE (table), button, 1, 2, 2, 3, @@ -1557,7 +1556,7 @@ void GroupDlg::Create () } { - GtkWidget* button = gtk_button_new_with_label ("315"); + GtkWidget* button = gtk_button_new_with_label (_("315")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"315"); gtk_table_attach (GTK_TABLE (table), button, 2, 3, 2, 3, @@ -1572,21 +1571,21 @@ void GroupDlg::Create () gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0); { - GtkWidget* button = gtk_button_new_with_label ("Reset"); + GtkWidget* button = gtk_button_new_with_label (_("Reset")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (ResetEntity), NULL); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); } { - GtkWidget* button = gtk_button_new_with_label ("Up"); + GtkWidget* button = gtk_button_new_with_label (_("Up")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"-1"); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); } { - GtkWidget* button = gtk_button_new_with_label ("Dn"); + GtkWidget* button = gtk_button_new_with_label (_("Dn")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"-2"); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); @@ -1599,21 +1598,21 @@ void GroupDlg::Create () gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0); { - GtkWidget* button = gtk_button_new_with_label ("Del Key/Pair"); + GtkWidget* button = gtk_button_new_with_label (_("Del Key/Pair")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (DelProp), NULL); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); } { - GtkWidget* button = gtk_button_new_with_label ("Sound..."); + GtkWidget* button = gtk_button_new_with_label (_("Sound...")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (AssignSound), NULL); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); } { - GtkWidget* button = gtk_button_new_with_label ("Model..."); + GtkWidget* button = gtk_button_new_with_label (_("Model...")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (AssignModel), NULL); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); @@ -1642,7 +1641,7 @@ void GroupDlg::Create () } { - GtkWidget* label = gtk_label_new ("Console"); + GtkWidget* label = gtk_label_new (_("Console")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), scr, label); } @@ -1672,28 +1671,28 @@ void GroupDlg::Create () gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); - button = gtk_button_new_with_label ("Add..."); + button = gtk_button_new_with_label (_("Add...")); gtk_widget_show (button); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (groupdlg_add), NULL); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 60, -2); - button = gtk_button_new_with_label ("Edit..."); + button = gtk_button_new_with_label (_("Edit...")); gtk_widget_show (button); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 60, -2); - button = gtk_button_new_with_label ("Delete"); + button = gtk_button_new_with_label (_("Delete")); gtk_widget_show (button); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 60, -2); - label = gtk_label_new ("Groups"); + label = gtk_label_new (_("Groups")); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); */ inspector_mode = W_ENTITY; - // gtk_window_set_title (GTK_WINDOW (dlg), "Entities"); + // gtk_window_set_title (GTK_WINDOW (dlg), _("Entities")); m_pWidget = dlg; /* load_pixmap ("grouptree1.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[0], &tree_masks[0]); diff --git a/radiant/groupdialog.h b/radiant/groupdialog.h index 33e3640c..aa0184be 100644 --- a/radiant/groupdialog.h +++ b/radiant/groupdialog.h @@ -49,12 +49,11 @@ enum EntCheck15, EntCheck16, -/* EntCheck17, EntCheck18, EntCheck19, EntCheck20, -*/ + EntProps, EntDir0, EntDir45, @@ -79,13 +78,12 @@ enum EntLast, }; -// 17..20 where used for spawnflags (!Easy !Medium !Hard etc.), empty now.. extern GtkWidget* EntWidgets[EntLast]; //extern int rgIds[EntLast]; -class GroupDlg +class GroupDlg { public: GroupDlg (); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 09d6b0f2..d4d0bced 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -2884,7 +2884,7 @@ void PrefsDlg::LoadPrefs () // Texture subset on by default (HL specific really, because of halflife.wad's size) mLocalPrefs.GetPref(TEXTURE_KEY, &m_bTextureWindow, TRUE); } - else if ( ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ) ) + else if (g_pGameDescription->quake2 || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" )) { // BSP monitoring is implemented in Quake2 and Heretic2 tools mLocalPrefs.GetPref(WATCHBSP_KEY, &m_bWatchBSP, TRUE); -- 2.39.2