mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-22 20:02:42 +00:00
- Changed ETB tag toolbar to a notebook with tag/texture pages (Shaderman)
- Added a context menu (add/delete/rename tag) to the ETB tag tree view (Shaderman) - Added new win32 installer HOWTO (Shaderman/Topsun) git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@110 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
495d93b083
commit
04dca548d1
4 changed files with 371 additions and 302 deletions
6
CHANGES
6
CHANGES
|
@ -1,6 +1,12 @@
|
|||
This is the changelog for developers, != changelog for the end user
|
||||
that we distribute with the binaries. (see changelog)
|
||||
|
||||
03/10/2006
|
||||
namespace
|
||||
- Changed ETB tag toolbar to a notebook with tag/texture pages (Shaderman)
|
||||
- Added a context menu (add/delete/rename tag) to the ETB tag tree view (Shaderman)
|
||||
- Added new win32 installer HOWTO (Shaderman/Topsun)
|
||||
|
||||
01/10/2006
|
||||
namespace
|
||||
- Added missing xml files for win32 installer
|
||||
|
|
|
@ -231,6 +231,8 @@ public:
|
|||
GtkWidget* m_available_tree;
|
||||
GtkWidget* m_scr_win_tree;
|
||||
GtkWidget* m_scr_win_tags;
|
||||
GtkWidget* m_tag_notebook;
|
||||
GtkWidget* m_search_button;
|
||||
GtkWidget* m_shader_info_item;
|
||||
|
||||
std::set<CopiedString> m_all_tags;
|
||||
|
@ -265,7 +267,6 @@ public:
|
|||
bool m_rmbSelected;
|
||||
bool m_searchedTags;
|
||||
bool m_tags;
|
||||
bool m_showTags;
|
||||
|
||||
TextureBrowser() :
|
||||
m_texture_scroll(0),
|
||||
|
@ -284,8 +285,7 @@ public:
|
|||
m_hideUnused(false),
|
||||
m_rmbSelected(false),
|
||||
m_searchedTags(false),
|
||||
m_tags(false),
|
||||
m_showTags(false)
|
||||
m_tags(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -1530,11 +1530,60 @@ void TextureBrowser_createTreeViewTree()
|
|||
TextureBrowser_constructTreeStore();
|
||||
}
|
||||
|
||||
void TextureBrowser_addTag();
|
||||
void TextureBrowser_renameTag();
|
||||
void TextureBrowser_deleteTag();
|
||||
|
||||
void TextureBrowser_createContextMenu(GtkWidget *treeview, GdkEventButton *event)
|
||||
{
|
||||
GtkWidget* menu = gtk_menu_new();
|
||||
|
||||
GtkWidget* menuitem = gtk_menu_item_new_with_label("Add tag");
|
||||
g_signal_connect(menuitem, "activate", (GCallback)TextureBrowser_addTag, treeview);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label("Rename tag");
|
||||
g_signal_connect(menuitem, "activate", (GCallback)TextureBrowser_renameTag, treeview);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label("Delete tag");
|
||||
g_signal_connect(menuitem, "activate", (GCallback)TextureBrowser_deleteTag, treeview);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
|
||||
gtk_widget_show_all(menu);
|
||||
|
||||
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
|
||||
(event != NULL) ? event->button : 0,
|
||||
gdk_event_get_time((GdkEvent*)event));
|
||||
}
|
||||
|
||||
gboolean TreeViewTags_onButtonPressed(GtkWidget *treeview, GdkEventButton *event)
|
||||
{
|
||||
if (event->type == GDK_BUTTON_PRESS && event->button == 3)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
|
||||
|
||||
if(gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview), event->x, event->y, &path, NULL, NULL, NULL))
|
||||
{
|
||||
gtk_tree_selection_unselect_all(selection);
|
||||
gtk_tree_selection_select_path(selection, path);
|
||||
gtk_tree_path_free(path);
|
||||
}
|
||||
|
||||
TextureBrowser_createContextMenu(treeview, event);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TextureBrowser_createTreeViewTags()
|
||||
{
|
||||
GtkCellRenderer* renderer;
|
||||
g_TextureBrowser.m_treeViewTags = GTK_WIDGET(gtk_tree_view_new());
|
||||
|
||||
g_signal_connect(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), "button-press-event", (GCallback)TreeViewTags_onButtonPressed, NULL);
|
||||
|
||||
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), FALSE);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
|
@ -1730,19 +1779,6 @@ void TextureBrowser_buildTagList()
|
|||
}
|
||||
}
|
||||
|
||||
void toggle_tags_textures()
|
||||
{
|
||||
if(g_TextureBrowser.m_showTags)
|
||||
{
|
||||
gtk_widget_hide(GTK_WIDGET(g_TextureBrowser.m_scr_win_tags));
|
||||
gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_scr_win_tree));
|
||||
} else {
|
||||
gtk_widget_hide(GTK_WIDGET(g_TextureBrowser.m_scr_win_tree));
|
||||
gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_scr_win_tags));
|
||||
}
|
||||
g_TextureBrowser.m_showTags ^= 1;
|
||||
}
|
||||
|
||||
void TextureBrowser_searchTags()
|
||||
{
|
||||
GSList* selected = NULL;
|
||||
|
@ -1820,29 +1856,42 @@ void TextureBrowser_searchTags()
|
|||
g_slist_free(selected);
|
||||
}
|
||||
|
||||
GtkWidget* TextureBrowser_constructTagToolbar()
|
||||
void TextureBrowser_toggleSearchButton()
|
||||
{
|
||||
GtkWidget* toolbar = gtk_toolbar_new();
|
||||
GtkTooltips* toolbar_tips = gtk_tooltips_new();
|
||||
gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook));
|
||||
|
||||
GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
GtkWidget* button = gtk_button_new();
|
||||
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(TextureBrowser_searchTags), NULL);
|
||||
gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), button, "Search with selected tags", "Search with selected tags");
|
||||
gtk_container_add(GTK_CONTAINER(button), image);
|
||||
gtk_container_add(GTK_CONTAINER(toolbar), button);
|
||||
gtk_widget_show_all(button);
|
||||
|
||||
image = gtk_image_new_from_stock(GTK_STOCK_INDEX, GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
button = gtk_toggle_button_new();
|
||||
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_tags_textures), NULL);
|
||||
gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), button, "Toggle tag/texture view", "Toggle tag/texture view");
|
||||
gtk_container_add(GTK_CONTAINER(button), image);
|
||||
gtk_container_add(GTK_CONTAINER(toolbar), button);
|
||||
gtk_widget_show_all(button);
|
||||
return toolbar;
|
||||
if(page == 0) // tag page
|
||||
{
|
||||
gtk_widget_show_all(g_TextureBrowser.m_search_button);
|
||||
} else {
|
||||
gtk_widget_hide_all(g_TextureBrowser.m_search_button);
|
||||
}
|
||||
}
|
||||
|
||||
void TextureBrowser_constructTagNotebook()
|
||||
{
|
||||
g_TextureBrowser.m_tag_notebook = gtk_notebook_new();
|
||||
GtkWidget* labelTags = gtk_label_new("Tags");
|
||||
GtkWidget* labelTextures = gtk_label_new("Textures");
|
||||
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook), g_TextureBrowser.m_scr_win_tree, labelTextures);
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook), g_TextureBrowser.m_scr_win_tags, labelTags);
|
||||
|
||||
g_signal_connect(G_OBJECT(g_TextureBrowser.m_tag_notebook), "switch-page", G_CALLBACK(TextureBrowser_toggleSearchButton), NULL);
|
||||
|
||||
gtk_widget_show_all(g_TextureBrowser.m_tag_notebook);
|
||||
}
|
||||
|
||||
void TextureBrowser_constructSearchButton()
|
||||
{
|
||||
GtkTooltips* tooltips = gtk_tooltips_new();
|
||||
|
||||
GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
g_TextureBrowser.m_search_button = gtk_button_new();
|
||||
g_signal_connect(G_OBJECT(g_TextureBrowser.m_search_button), "clicked", G_CALLBACK(TextureBrowser_searchTags), NULL);
|
||||
gtk_tooltips_set_tip(GTK_TOOLTIPS(tooltips), g_TextureBrowser.m_search_button, "Search with selected tags", "Search with selected tags");
|
||||
gtk_container_add(GTK_CONTAINER(g_TextureBrowser.m_search_button), image);
|
||||
}
|
||||
|
||||
void TextureBrowser_checkTagFile()
|
||||
{
|
||||
|
@ -1896,16 +1945,6 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
|
||||
TextureBrowser_checkTagFile();
|
||||
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
g_TextureBrowser.m_all_tags_list = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING);
|
||||
GtkTreeSortable* sortable = GTK_TREE_SORTABLE(g_TextureBrowser.m_all_tags_list);
|
||||
gtk_tree_sortable_set_sort_column_id(sortable, TAG_COLUMN, GTK_SORT_ASCENDING);
|
||||
|
||||
TagBuilder.GetAllTags(g_TextureBrowser.m_all_tags);
|
||||
TextureBrowser_buildTagList();
|
||||
}
|
||||
|
||||
GlobalShaderSystem().setActiveShadersChangedNotify(ReferenceCaller<TextureBrowser, TextureBrowser_activeShadersChanged>(g_TextureBrowser));
|
||||
|
||||
g_TextureBrowser.m_parent = toplevel;
|
||||
|
@ -1916,8 +1955,10 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
gtk_table_attach(GTK_TABLE(table), vbox, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
GtkWidget* menu_bar;
|
||||
|
||||
{ // menu bar
|
||||
GtkWidget* menu_bar = gtk_menu_bar_new();
|
||||
menu_bar = gtk_menu_bar_new();
|
||||
GtkWidget* menu_view = gtk_menu_new();
|
||||
GtkWidget* view_item = (GtkWidget*)TextureBrowser_constructViewMenu(GTK_MENU(menu_view));
|
||||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(view_item), menu_view);
|
||||
|
@ -1928,25 +1969,22 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(tools_item), menu_tools);
|
||||
gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), tools_item);
|
||||
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
GtkWidget* menu_tags = gtk_menu_new();
|
||||
GtkWidget* tags_item = (GtkWidget*)TextureBrowser_constructTagsMenu(GTK_MENU(menu_tags));
|
||||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(tags_item), menu_tags);
|
||||
gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), tags_item);
|
||||
}
|
||||
|
||||
gtk_table_attach(GTK_TABLE (table), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show(menu_bar);
|
||||
}
|
||||
{ // tag tool bar
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
GtkWidget* toolbar = TextureBrowser_constructTagToolbar();
|
||||
{ // Texture TreeView
|
||||
g_TextureBrowser.m_scr_win_tree = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(g_TextureBrowser.m_scr_win_tree), 0);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
|
||||
gtk_widget_show(toolbar);
|
||||
}
|
||||
// vertical only scrolling for treeview
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tree), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
gtk_widget_show(g_TextureBrowser.m_scr_win_tree);
|
||||
|
||||
TextureBrowser_createTreeViewTree();
|
||||
|
||||
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tree), GTK_WIDGET(g_TextureBrowser.m_treeViewTree));
|
||||
gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_treeViewTree));
|
||||
}
|
||||
{ // gl_widget scrollbar
|
||||
GtkWidget* w = gtk_vscrollbar_new(GTK_ADJUSTMENT(gtk_adjustment_new (0,0,0,1,1,1)));
|
||||
|
@ -1959,41 +1997,6 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
|
||||
widget_set_visible(g_TextureBrowser.m_texture_scroll, g_TextureBrowser.m_showTextureScrollbar);
|
||||
}
|
||||
{ // TreeView
|
||||
g_TextureBrowser.m_scr_win_tree = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(g_TextureBrowser.m_scr_win_tree), 0);
|
||||
|
||||
// vertical only scrolling for treeview
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tree), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
gtk_box_pack_end(GTK_BOX(vbox), g_TextureBrowser.m_scr_win_tree, TRUE, TRUE, 0);
|
||||
gtk_widget_show(g_TextureBrowser.m_scr_win_tree);
|
||||
|
||||
TextureBrowser_createTreeViewTree();
|
||||
|
||||
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tree), GTK_WIDGET(g_TextureBrowser.m_treeViewTree));
|
||||
gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_treeViewTree));
|
||||
}
|
||||
{ // TreeView for tags
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
g_TextureBrowser.m_scr_win_tags = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(g_TextureBrowser.m_scr_win_tags), 0);
|
||||
|
||||
// vertical only scrolling for treeview
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tags), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
gtk_box_pack_end(GTK_BOX(vbox), g_TextureBrowser.m_scr_win_tags, TRUE, TRUE, 0);
|
||||
|
||||
TextureBrowser_createTreeViewTags();
|
||||
|
||||
GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags));
|
||||
gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
|
||||
|
||||
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW (g_TextureBrowser.m_scr_win_tags), GTK_WIDGET (g_TextureBrowser.m_treeViewTags));
|
||||
gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_treeViewTags));
|
||||
}
|
||||
}
|
||||
{ // gl_widget
|
||||
g_TextureBrowser.m_gl_widget = glwidget_new(FALSE);
|
||||
gtk_widget_ref(g_TextureBrowser.m_gl_widget);
|
||||
|
@ -2012,9 +2015,48 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "motion_notify_event", G_CALLBACK(TextureBrowser_motion), &g_TextureBrowser);
|
||||
g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "scroll_event", G_CALLBACK(TextureBrowser_scroll), &g_TextureBrowser);
|
||||
}
|
||||
{ // tag frame
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
|
||||
// tag stuff
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
{ // fill tag GtkListStore
|
||||
g_TextureBrowser.m_all_tags_list = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING);
|
||||
GtkTreeSortable* sortable = GTK_TREE_SORTABLE(g_TextureBrowser.m_all_tags_list);
|
||||
gtk_tree_sortable_set_sort_column_id(sortable, TAG_COLUMN, GTK_SORT_ASCENDING);
|
||||
|
||||
TagBuilder.GetAllTags(g_TextureBrowser.m_all_tags);
|
||||
TextureBrowser_buildTagList();
|
||||
}
|
||||
{ // tag menu bar
|
||||
GtkWidget* menu_tags = gtk_menu_new();
|
||||
GtkWidget* tags_item = (GtkWidget*)TextureBrowser_constructTagsMenu(GTK_MENU(menu_tags));
|
||||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(tags_item), menu_tags);
|
||||
gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), tags_item);
|
||||
}
|
||||
{ // Tag TreeView
|
||||
g_TextureBrowser.m_scr_win_tags = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(g_TextureBrowser.m_scr_win_tags), 0);
|
||||
|
||||
// vertical only scrolling for treeview
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tags), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
TextureBrowser_createTreeViewTags();
|
||||
|
||||
GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags));
|
||||
gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
|
||||
|
||||
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW (g_TextureBrowser.m_scr_win_tags), GTK_WIDGET (g_TextureBrowser.m_treeViewTags));
|
||||
gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_treeViewTags));
|
||||
}
|
||||
{ // Texture/Tag notebook
|
||||
TextureBrowser_constructTagNotebook();
|
||||
gtk_box_pack_start(GTK_BOX(vbox), g_TextureBrowser.m_tag_notebook, TRUE, TRUE, 0);
|
||||
}
|
||||
{ // Tag search button
|
||||
TextureBrowser_constructSearchButton();
|
||||
gtk_box_pack_end(GTK_BOX(vbox), g_TextureBrowser.m_search_button, FALSE, FALSE, 0);
|
||||
}
|
||||
{ // Tag frame
|
||||
frame_table = gtk_table_new(3, 3, FALSE);
|
||||
|
||||
g_TextureBrowser.m_tag_frame = gtk_frame_new("Tag assignment");
|
||||
|
@ -2023,15 +2065,11 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
|
||||
gtk_table_attach(GTK_TABLE(table), g_TextureBrowser.m_tag_frame, 1, 3, 2, 3, GTK_FILL, GTK_SHRINK, 0, 0);
|
||||
|
||||
// set the size of the tag frame
|
||||
gtk_widget_show(frame_table);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER(g_TextureBrowser.m_tag_frame), frame_table);
|
||||
}
|
||||
}
|
||||
{ // assigned tag list
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
}
|
||||
{ // assigned tag list
|
||||
GtkWidget* scrolled_win = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_container_set_border_width(GTK_CONTAINER (scrolled_win), 0);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
@ -2060,10 +2098,7 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
|
||||
gtk_table_attach(GTK_TABLE(frame_table), scrolled_win, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0);
|
||||
}
|
||||
}
|
||||
{ // available tag list
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
{ // available tag list
|
||||
GtkWidget* scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
@ -2091,10 +2126,7 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
|
||||
gtk_table_attach (GTK_TABLE (frame_table), scrolled_win, 2, 3, 1, 3, GTK_FILL, GTK_FILL, 0, 0);
|
||||
}
|
||||
}
|
||||
{ // arrow buttons
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
{ // tag arrow buttons
|
||||
GtkWidget* m_btn_left = gtk_button_new();
|
||||
GtkWidget* m_btn_right = gtk_button_new();
|
||||
GtkWidget* m_arrow_left = gtk_arrow_new(GTK_ARROW_LEFT, GTK_SHADOW_OUT);
|
||||
|
@ -2117,10 +2149,7 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
gtk_widget_show(m_arrow_left);
|
||||
gtk_widget_show(m_arrow_right);
|
||||
}
|
||||
}
|
||||
{ // tag frame labels
|
||||
if(g_TextureBrowser.m_tags)
|
||||
{
|
||||
{ // tag fram labels
|
||||
GtkWidget* m_lbl_assigned = gtk_label_new ("Assigned");
|
||||
GtkWidget* m_lbl_unassigned = gtk_label_new ("Available");
|
||||
|
||||
|
@ -2130,6 +2159,8 @@ GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel)
|
|||
gtk_widget_show (m_lbl_assigned);
|
||||
gtk_widget_show (m_lbl_unassigned);
|
||||
}
|
||||
} else { // no tag support, show the texture tree only
|
||||
gtk_box_pack_start(GTK_BOX(vbox), g_TextureBrowser.m_scr_win_tree, TRUE, TRUE, 0);
|
||||
}
|
||||
|
||||
// TODO do we need this?
|
||||
|
|
|
@ -1,195 +1,32 @@
|
|||
Howto add new game packs to the InstallShield setup
|
||||
---------------------------------------------------
|
||||
msi installer HOWTO for Radiant 1.5
|
||||
-----------------------------------
|
||||
|
||||
Background Info
|
||||
---------------
|
||||
The files that IS uses are pretty much all text files, in the template/ directory
|
||||
we have a special copy of these files that make up the IS project.
|
||||
Requirements:
|
||||
|
||||
The copy in the template/ directory has files which contain string like
|
||||
<<GTK_DIR>> which are replaced with actual values whenever the setup.pl script
|
||||
is used.
|
||||
- all game packs from https://zerowing.idsoftware.com/svn/radiant.gamepacks/*Pack/trunk/ must be present in the ./games/ folder
|
||||
- the Radiant manual from https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Rad_Manual/trunk/ in ./docs/manual/
|
||||
- msitools from http://zerowing.idsoftware.com/files/radiant/developer/1.5/msitools.zip.
|
||||
|
||||
|
||||
TTimo
|
||||
8/5/2002
|
||||
Building a new installer .msi file:
|
||||
|
||||
Disclaimer: I'm writing that as I am building the RTCW game pack. It is possible
|
||||
that it is fairly outdated when you read it, but my guess is it can be a useful
|
||||
reference document.
|
||||
Update: using this for JKII support, made sure everything is still valid
|
||||
|
||||
Hydra
|
||||
5/6/2002
|
||||
- Updating for Halflife build, added a bit more info in places.
|
||||
|
||||
NOTE: you need cygwin installed (http://www.cygwin.com) to run setup.pl tools
|
||||
(Base installation + perl)
|
||||
|
||||
You also need UUIDGEN.exe in your path. It's normally in the
|
||||
"Visual Studio .NET\Common7\Tools" directory
|
||||
|
||||
Some experience with IS and our particular way of handling it is expected.
|
||||
The following information is DENSE, read everything
|
||||
|
||||
- select a base name for the pack (which we will use in various variables):
|
||||
WOLF
|
||||
- make a RELEASE build of GtkRadiant.
|
||||
- run setup.pl to generate the IS directories
|
||||
e.g. ./setup.pl 'c:\\my documents\\Source\\GtkRadiant' q3.cf
|
||||
(the directory contains GtkRadiant, Src, etc..)
|
||||
- start WorkDir/GtkRadiant.ipr, this is an half-templated setup we can
|
||||
easily work on to add new stuff
|
||||
|
||||
- go to file groups and start adding new groups:
|
||||
Wolf Executable Files
|
||||
will hold the editor modules and binaries (map compiler, bspc)
|
||||
Wolf Media Files
|
||||
will hold sample files and editor files:
|
||||
maps, models, additional textures, shader scripts, entities.def, project template
|
||||
set the destination directory for those files:
|
||||
Wolf Executable Files
|
||||
goes in the game pack directory: DIR_GAMETOOLS_WOLF
|
||||
Wolf Media Files
|
||||
goes straight into the Wolf path: DIR_GAME_WOLF
|
||||
|
||||
- start feeding stuff in those file groups
|
||||
make sure all those files start from the prefix we are working with
|
||||
(C:\home\Id in my case)
|
||||
|
||||
- add a component:
|
||||
Wolf (Wolf Executable Files)
|
||||
-- Wolf editing media (Wolf Media Files)
|
||||
NOTE: make sure that you put the file groups in those components you created!
|
||||
|
||||
- go to add the pack to setup.rul:
|
||||
add new globals
|
||||
// Wolf
|
||||
NUMBER DO_GAME_WOLF_BOOL;
|
||||
STRING szDIR_GAME_WOLF, szDIR_GAMETOOLS_WOLF;
|
||||
|
||||
- in OnFirstUIBefore
|
||||
define any strings you use, e.g. szJKII and DEFAULTJKIIDIR;
|
||||
add template for wolf pack inclusion
|
||||
DO_GAME_WOLF_BOOL = <<DO_GAME_WOLF_BOOL>>;
|
||||
|
||||
- copy 'game pack #1' code and paste is as a 'game pack #2'
|
||||
start renaming the code and updating it
|
||||
(use the registry key for default path lookup if possible)
|
||||
Wolf setup doesn't leave an install path, we will hardcode to
|
||||
C:\\Program Files\\Return To Castle Wolfenstein
|
||||
and look for the binary
|
||||
(note, this is by far the part with the most things to do,
|
||||
read carefully the game pack code, replace everywhere it's needed,
|
||||
put the right 'BACK' code etc.)
|
||||
|
||||
NOTE: the 'if (nResult = BACK) then' code gets more complicated as new packs are added
|
||||
sadly, it's not possible to store labels into variables for jumps
|
||||
the next 'nResult = BACK' in non-gamepack code needs to be updated too
|
||||
|
||||
- in Dlg_SdStartCopy, add summary for Wolf operations
|
||||
if (DO_GAME_WOLF_BOOL == 1) then
|
||||
ListAddString(listStartCopy,"Return To Castle Wolfenstein folder:",AFTER);
|
||||
ListAddString(listStartCopy," " + szDIR_GAME_WOLF,AFTER);
|
||||
ListAddString(listStartCopy,"Return To Castle Wolfenstein mapping package folder:",AFTER);
|
||||
ListAddString(listStartCopy," " + szDIR_GAMETOOLS_WOLF,AFTER);
|
||||
endif;
|
||||
|
||||
- in OnMoved, add generation of the game file for Wolf
|
||||
if (DO_GAME_WOLF_BOOL == 1) then
|
||||
if (CreateDir(TARGETDIR ^ "games")< 0) then
|
||||
// Report the error; then abort.
|
||||
MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
|
||||
abort;
|
||||
endif;
|
||||
if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "wolf.game")< 0) then
|
||||
// Report the error.
|
||||
MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\wolf.game failed.", SEVERE);
|
||||
abort;
|
||||
endif;
|
||||
WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
|
||||
WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
|
||||
WriteLine(nvFileHandle, "<game name=\"Return To Castle Wolfenstein\" gametools=\"" + szDIR_GAMETOOLS_WOLF + "/\"/>");
|
||||
WriteLine(nvFileHandle, " gamename=\"wolf\"");
|
||||
WriteLine(nvFileHandle, " enginename=\"quake3\"");
|
||||
CloseFile(nvFileHandle);
|
||||
endif;
|
||||
|
||||
- configure the setup so that the new components are installed by default:
|
||||
in 'Setup Types' tab, check the new components
|
||||
NOTE: do that in BOTH types, specially Custom
|
||||
|
||||
- once all those changes are done, we are gonna validate the update..
|
||||
save and exit IS
|
||||
make a backup copy of setup/win32/WorkDir ($ cp -R WorkDir/ WorkDir-backup)
|
||||
|
||||
- templatize WorkDir/ with the setup.pl
|
||||
$ ./setup.pl 'c:\\home\\Id' -template template-gen
|
||||
Configured for base GtkRadiant directory: 'C:\\home\\Id'
|
||||
Building a template version of WorkDir into template-gen/
|
||||
Copy files...
|
||||
Templating UUID...
|
||||
Processing 'C:\\home\\Id' into '<<GTKRAD_DIR>>'
|
||||
|
||||
- check with a recursive diff that it's all good (Araxis Merge!)
|
||||
Files template/Component Definitions/Default.cdf and template-gen/Component Definitions/Default.cdf differ
|
||||
Files template/Component Definitions/Default.fgl and template-gen/Component Definitions/Default.fgl differ
|
||||
Files template/File Groups/Default.fdf and template-gen/File Groups/Default.fdf differ
|
||||
Files template/Script Files/Setup.rul and template-gen/Script Files/Setup.rul differ
|
||||
Files template/Text Substitutions/Setup.tsb and template-gen/Text Substitutions/Setup.tsb differ
|
||||
|
||||
newly added, the file groups files
|
||||
|
||||
- copy over template-gen/ into template/
|
||||
$ cp -R template-gen/* template/
|
||||
|
||||
- cvs update in the template dir, add new files etc.
|
||||
- Unzip msitools.zip to ./setup/win32/ and run MsiVal2.Msi (it automatically installes to C:\Program files\MsiVal2).
|
||||
- Copy all files from C:\Program files\MsiVal2 to the ./setup/win32/ folder.
|
||||
- You might have to edit the .xml files in ./setup/win32/components/
|
||||
- Create a file "aboutmsg.default" in ./include containing a single line:
|
||||
Official qeradiant.com build by <insert your name here>
|
||||
- Open a command-prompt in ./ and run "makeversion.py"
|
||||
- Build the GtkRadiant solution in 'Release' configuration.
|
||||
- If you want to create a .msi installer for GtkRadiant, go on with the next step. To create a game pack
|
||||
.msi installer you have to modify the file "build.py".
|
||||
- Open a command-prompt in ./setup/win32/ and run "build.py". This will create the installer
|
||||
file GtkRadiant-1.5.0-[YYYY]-[MM]-[DD].msi
|
||||
|
||||
|
||||
Additional information:
|
||||
|
||||
- edit template/Component Definitions/Default.cdf in a text editor to configure the 'include in build' templates
|
||||
search for [Wolf] and change the line:
|
||||
INCLUDEINBUILD=NO
|
||||
to:
|
||||
INCLUDEINBUILD=<<DO_GAME_WOLF_BOOL_YESNO>>
|
||||
|
||||
search for [Wolf\Wolf Editing Media] and change the line:
|
||||
INCLUDEINBUILD=NO
|
||||
to:
|
||||
INCLUDEINBUILD=<<DO_GAME_WOLF_BOOL_FULL_YESNO>>
|
||||
|
||||
that is, main is always installed, and the editing media only in full
|
||||
NOTE: IS 6.0 has the nasty habit of changing order in Default.cdf on each save .. makes things harder
|
||||
|
||||
- edit 'sub configure_tree' in setup/win32/setup.pl:
|
||||
copy from an existing game pack code and adapt
|
||||
there's a general boolean, and a full setup boolean
|
||||
(search and replace affects Setup.rul and Default.cdf)
|
||||
|
||||
add the corresponding items to
|
||||
# set default config
|
||||
|
||||
add a corresponding output string under
|
||||
print " DO_CORE : $DO_CORE\n";
|
||||
|
||||
- search for '# set default config' and add the new default entry (default to 0)
|
||||
as well as the verbosity below
|
||||
|
||||
- create a new .cf file
|
||||
|
||||
# ET setup
|
||||
|
||||
# output dir name
|
||||
$SETUP_DIR = 'Setup-ET';
|
||||
|
||||
$DO_CORE = 1;
|
||||
$DO_GAME_ET = 1;
|
||||
If you want to build the msi-Installer wiht Python 2.4 you have to modify msiquery.vcproj ('Release' configuration)
|
||||
located in ./setup/win32/msi/ (include paths and linker libraries) and rebuild it
|
||||
|
||||
|
||||
- build a new setup using a .cf file.
|
||||
|
||||
e.g.
|
||||
|
||||
./setup.pl 'C:\\home\\Id' wolf.cf
|
||||
|
||||
- load up Setup-Wolf/GtkRadiant.ipl into IS and build it!
|
||||
Written by Shaderman and Topsun in Sept 2006
|
195
setup/win32/HOWTO_outdated
Normal file
195
setup/win32/HOWTO_outdated
Normal file
|
@ -0,0 +1,195 @@
|
|||
Howto add new game packs to the InstallShield setup
|
||||
---------------------------------------------------
|
||||
|
||||
Background Info
|
||||
---------------
|
||||
The files that IS uses are pretty much all text files, in the template/ directory
|
||||
we have a special copy of these files that make up the IS project.
|
||||
|
||||
The copy in the template/ directory has files which contain string like
|
||||
<<GTK_DIR>> which are replaced with actual values whenever the setup.pl script
|
||||
is used.
|
||||
|
||||
|
||||
TTimo
|
||||
8/5/2002
|
||||
|
||||
Disclaimer: I'm writing that as I am building the RTCW game pack. It is possible
|
||||
that it is fairly outdated when you read it, but my guess is it can be a useful
|
||||
reference document.
|
||||
Update: using this for JKII support, made sure everything is still valid
|
||||
|
||||
Hydra
|
||||
5/6/2002
|
||||
- Updating for Halflife build, added a bit more info in places.
|
||||
|
||||
NOTE: you need cygwin installed (http://www.cygwin.com) to run setup.pl tools
|
||||
(Base installation + perl)
|
||||
|
||||
You also need UUIDGEN.exe in your path. It's normally in the
|
||||
"Visual Studio .NET\Common7\Tools" directory
|
||||
|
||||
Some experience with IS and our particular way of handling it is expected.
|
||||
The following information is DENSE, read everything
|
||||
|
||||
- select a base name for the pack (which we will use in various variables):
|
||||
WOLF
|
||||
- make a RELEASE build of GtkRadiant.
|
||||
- run setup.pl to generate the IS directories
|
||||
e.g. ./setup.pl 'c:\\my documents\\Source\\GtkRadiant' q3.cf
|
||||
(the directory contains GtkRadiant, Src, etc..)
|
||||
- start WorkDir/GtkRadiant.ipr, this is an half-templated setup we can
|
||||
easily work on to add new stuff
|
||||
|
||||
- go to file groups and start adding new groups:
|
||||
Wolf Executable Files
|
||||
will hold the editor modules and binaries (map compiler, bspc)
|
||||
Wolf Media Files
|
||||
will hold sample files and editor files:
|
||||
maps, models, additional textures, shader scripts, entities.def, project template
|
||||
set the destination directory for those files:
|
||||
Wolf Executable Files
|
||||
goes in the game pack directory: DIR_GAMETOOLS_WOLF
|
||||
Wolf Media Files
|
||||
goes straight into the Wolf path: DIR_GAME_WOLF
|
||||
|
||||
- start feeding stuff in those file groups
|
||||
make sure all those files start from the prefix we are working with
|
||||
(C:\home\Id in my case)
|
||||
|
||||
- add a component:
|
||||
Wolf (Wolf Executable Files)
|
||||
-- Wolf editing media (Wolf Media Files)
|
||||
NOTE: make sure that you put the file groups in those components you created!
|
||||
|
||||
- go to add the pack to setup.rul:
|
||||
add new globals
|
||||
// Wolf
|
||||
NUMBER DO_GAME_WOLF_BOOL;
|
||||
STRING szDIR_GAME_WOLF, szDIR_GAMETOOLS_WOLF;
|
||||
|
||||
- in OnFirstUIBefore
|
||||
define any strings you use, e.g. szJKII and DEFAULTJKIIDIR;
|
||||
add template for wolf pack inclusion
|
||||
DO_GAME_WOLF_BOOL = <<DO_GAME_WOLF_BOOL>>;
|
||||
|
||||
- copy 'game pack #1' code and paste is as a 'game pack #2'
|
||||
start renaming the code and updating it
|
||||
(use the registry key for default path lookup if possible)
|
||||
Wolf setup doesn't leave an install path, we will hardcode to
|
||||
C:\\Program Files\\Return To Castle Wolfenstein
|
||||
and look for the binary
|
||||
(note, this is by far the part with the most things to do,
|
||||
read carefully the game pack code, replace everywhere it's needed,
|
||||
put the right 'BACK' code etc.)
|
||||
|
||||
NOTE: the 'if (nResult = BACK) then' code gets more complicated as new packs are added
|
||||
sadly, it's not possible to store labels into variables for jumps
|
||||
the next 'nResult = BACK' in non-gamepack code needs to be updated too
|
||||
|
||||
- in Dlg_SdStartCopy, add summary for Wolf operations
|
||||
if (DO_GAME_WOLF_BOOL == 1) then
|
||||
ListAddString(listStartCopy,"Return To Castle Wolfenstein folder:",AFTER);
|
||||
ListAddString(listStartCopy," " + szDIR_GAME_WOLF,AFTER);
|
||||
ListAddString(listStartCopy,"Return To Castle Wolfenstein mapping package folder:",AFTER);
|
||||
ListAddString(listStartCopy," " + szDIR_GAMETOOLS_WOLF,AFTER);
|
||||
endif;
|
||||
|
||||
- in OnMoved, add generation of the game file for Wolf
|
||||
if (DO_GAME_WOLF_BOOL == 1) then
|
||||
if (CreateDir(TARGETDIR ^ "games")< 0) then
|
||||
// Report the error; then abort.
|
||||
MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
|
||||
abort;
|
||||
endif;
|
||||
if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "wolf.game")< 0) then
|
||||
// Report the error.
|
||||
MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\wolf.game failed.", SEVERE);
|
||||
abort;
|
||||
endif;
|
||||
WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
|
||||
WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
|
||||
WriteLine(nvFileHandle, "<game name=\"Return To Castle Wolfenstein\" gametools=\"" + szDIR_GAMETOOLS_WOLF + "/\"/>");
|
||||
WriteLine(nvFileHandle, " gamename=\"wolf\"");
|
||||
WriteLine(nvFileHandle, " enginename=\"quake3\"");
|
||||
CloseFile(nvFileHandle);
|
||||
endif;
|
||||
|
||||
- configure the setup so that the new components are installed by default:
|
||||
in 'Setup Types' tab, check the new components
|
||||
NOTE: do that in BOTH types, specially Custom
|
||||
|
||||
- once all those changes are done, we are gonna validate the update..
|
||||
save and exit IS
|
||||
make a backup copy of setup/win32/WorkDir ($ cp -R WorkDir/ WorkDir-backup)
|
||||
|
||||
- templatize WorkDir/ with the setup.pl
|
||||
$ ./setup.pl 'c:\\home\\Id' -template template-gen
|
||||
Configured for base GtkRadiant directory: 'C:\\home\\Id'
|
||||
Building a template version of WorkDir into template-gen/
|
||||
Copy files...
|
||||
Templating UUID...
|
||||
Processing 'C:\\home\\Id' into '<<GTKRAD_DIR>>'
|
||||
|
||||
- check with a recursive diff that it's all good (Araxis Merge!)
|
||||
Files template/Component Definitions/Default.cdf and template-gen/Component Definitions/Default.cdf differ
|
||||
Files template/Component Definitions/Default.fgl and template-gen/Component Definitions/Default.fgl differ
|
||||
Files template/File Groups/Default.fdf and template-gen/File Groups/Default.fdf differ
|
||||
Files template/Script Files/Setup.rul and template-gen/Script Files/Setup.rul differ
|
||||
Files template/Text Substitutions/Setup.tsb and template-gen/Text Substitutions/Setup.tsb differ
|
||||
|
||||
newly added, the file groups files
|
||||
|
||||
- copy over template-gen/ into template/
|
||||
$ cp -R template-gen/* template/
|
||||
|
||||
- cvs update in the template dir, add new files etc.
|
||||
|
||||
|
||||
|
||||
- edit template/Component Definitions/Default.cdf in a text editor to configure the 'include in build' templates
|
||||
search for [Wolf] and change the line:
|
||||
INCLUDEINBUILD=NO
|
||||
to:
|
||||
INCLUDEINBUILD=<<DO_GAME_WOLF_BOOL_YESNO>>
|
||||
|
||||
search for [Wolf\Wolf Editing Media] and change the line:
|
||||
INCLUDEINBUILD=NO
|
||||
to:
|
||||
INCLUDEINBUILD=<<DO_GAME_WOLF_BOOL_FULL_YESNO>>
|
||||
|
||||
that is, main is always installed, and the editing media only in full
|
||||
NOTE: IS 6.0 has the nasty habit of changing order in Default.cdf on each save .. makes things harder
|
||||
|
||||
- edit 'sub configure_tree' in setup/win32/setup.pl:
|
||||
copy from an existing game pack code and adapt
|
||||
there's a general boolean, and a full setup boolean
|
||||
(search and replace affects Setup.rul and Default.cdf)
|
||||
|
||||
add the corresponding items to
|
||||
# set default config
|
||||
|
||||
add a corresponding output string under
|
||||
print " DO_CORE : $DO_CORE\n";
|
||||
|
||||
- search for '# set default config' and add the new default entry (default to 0)
|
||||
as well as the verbosity below
|
||||
|
||||
- create a new .cf file
|
||||
|
||||
# ET setup
|
||||
|
||||
# output dir name
|
||||
$SETUP_DIR = 'Setup-ET';
|
||||
|
||||
$DO_CORE = 1;
|
||||
$DO_GAME_ET = 1;
|
||||
|
||||
|
||||
- build a new setup using a .cf file.
|
||||
|
||||
e.g.
|
||||
|
||||
./setup.pl 'C:\\home\\Id' wolf.cf
|
||||
|
||||
- load up Setup-Wolf/GtkRadiant.ipl into IS and build it!
|
Loading…
Reference in a new issue