#include <unistd.h>
#endif
#include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
#include "stdafx.h"
#include "groupdialog.h"
GtkListStore* g_entprops_store;
int inspector_mode; // W_TEXTURE, W_ENTITY, or W_CONSOLE
qboolean multiple_entities;
-// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=17
qboolean disable_spawn_get = false;
entity_t *edit_entity;
/*
GtkTreeIter iter;
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, e->name, 1, e, -1);
- }
+ }
}
// SetKeyValuePairs
//
-// Reset the key/value (aka property) listbox and fill it with the
+// Reset the key/value (aka property) listbox and fill it with the
// k/v pairs from the entity being edited.
//
}
// SetSpawnFlags
-//
+//
// Update the checkboxes to reflect the flag state of the entity
//
void SetSpawnFlags(void)
}
// GetSpawnFlags
-//
+//
// Update the entity flags to reflect the state of the checkboxes
//
// NOTE: this function had a tendency to add "spawnflags" "0" on most entities
if (multiple_entities)
{
brush_t *b;
-
+
for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
DeleteKey (b->owner, "spawnflags");
}
DeleteKey (edit_entity, "spawnflags");
}
else
- {
- sprintf (sz, "%i", f);
+ {
+ sprintf (sz, "%i", f);
if (multiple_entities)
{
brush_t *b;
-
+
for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
SetKeyValue(b->owner, "spawnflags", sz);
}
int i, next_state;
brush_t *b;
- // syndrom of crappy code, we may get into stack overflowing crap with this function and Gtk
+ // syndrom of crappy code, we may get into stack overflowing crap with this function and Gtk
// if we play with the list of entity classes
// using a static flag to prevent recursion
static bool bBlockUpdate = false;
SetKeyValue(edit_entity, key, value);
// refresh the prop listbox
- SetKeyValuePairs();
+ SetKeyValuePairs();
#ifdef USEPLUGINENTITIES
strcat (buffer, "/");
}
- const char *filename = file_dialog (g_pGroupDlg->m_pWidget, TRUE, "Open Wav File", buffer, "sound");
+ const char *filename = file_dialog (g_pGroupDlg->m_pWidget, TRUE, _("Open Wav File"), buffer, "sound");
if (filename != NULL)
{
gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), "noise");
str = filename;
}
- gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), str.GetBuffer());
+ gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), str.GetBuffer());
AddProp();
}
}
strcat (buffer, "/");
}
- const char *filename = file_dialog (g_pGroupDlg->m_pWidget, TRUE, "Open Model", buffer, MODEL_MAJOR);
+ const char *filename = file_dialog (g_pGroupDlg->m_pWidget, TRUE, _("Open Model"), buffer, MODEL_MAJOR);
if (filename != NULL)
{
gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), "model");
str = filename;
}
- gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), str.GetBuffer());
+ gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), str.GetBuffer());
AddProp();
edit_entity->brushes.onext->bModelFailed = false;
}
iType = W_GROUP;
else
iType = W_ENTITY;
- }
+ }
switch(iType)
{
}
const char *pName = NULL;
// const char *pNamed = Brush_GetKeyValue(b, "name");
-
+
if (!b->owner || (b->owner == world_entity))
{
- if (b->patchBrush)
+ if (b->patchBrush)
{
pName = "Generic Patch";
nImage = IMG_PATCH;
- }
- else
+ }
+ else
{
pName = "Generic Brush";
nImage = IMG_BRUSH;
}
- }
- else
+ }
+ else
{
pName = b->owner->eclass->name;
- if (b->owner->eclass->fixedsize)
+ if (b->owner->eclass->fixedsize)
{
nImage = IMG_ENTITY;
- }
- else
+ }
+ else
{
nImage = IMG_ENTITYGROUP;
}
GtkTreeModel* model;
GtkTreeIter selected;
// no world entity, we are not ready yet
- // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=917
if( !world_entity ) {
- return;
+ return;
}
if(gtk_tree_selection_get_selected(selection, &model, &selected))
{
if (name != NULL)
{
- // create a new group node
+ // create a new group node
GtkCTreeNode *item;
item = gtk_ctree_insert_node (GTK_CTREE (g_wndGroup.m_pTree), g_pGroupDlg->m_hWorld, NULL, &name, 0,
tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP],
else
inspector_mode = W_GROUP;
}
-
+
if (inspector_mode == W_ENTITY)
gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
else
GtkWidget* split1 = gtk_vpaned_new ();
gtk_box_pack_start (GTK_BOX (vbox), split1, TRUE, TRUE, 0);
gtk_widget_show (split1);
-
+
{
GtkWidget* split2 = gtk_vpaned_new ();
gtk_paned_add1 (GTK_PANED (split1), split2);
gtk_widget_show(view);
gtk_container_add(GTK_CONTAINER (scr), view);
-
+
g_object_unref(G_OBJECT(store));
EntWidgets[EntList] = view;
g_entlist_store = store;
{
// Spawnflags (4 colums wide max, or window gets too wide.)
- GtkWidget* table = LayoutTable = gtk_table_new (4, 4, FALSE);
+ LayoutTable = gtk_table_new (4, 4, FALSE);
gtk_box_pack_start (GTK_BOX (vbox2), LayoutTable, FALSE, TRUE, 0);
gtk_widget_show(LayoutTable);
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) {
+ 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;
+ }
}
{
gtk_widget_show(view);
gtk_container_add(GTK_CONTAINER (scr), view);
-
+
g_object_unref(G_OBJECT(store));
EntWidgets[EntProps] = view;
}
{
- 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),
}
{
- 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),
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,
}
{
- 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,
}
{
- 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,
{
- 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,
}
{
- 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,
}
{
- 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,
}
{
- 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,
}
{
- 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,
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);
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);
}
{
- 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);
}
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]);