Changeset 232

Show
Ignore:
Timestamp:
03/24/08 05:47:55 (3 months ago)
Author:
mattn
Message:

* modified ufoai surface plugin to read the surface and content flag names from the game project file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant/plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp

    r219 r232  
    269269        gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 1); 
    270270} 
    271  
    272 // FIXME: This should be in the ufoai.game 
    273 static const char *surfaceFlags[] = { 
    274         "light", 
    275         "slick", 
    276         "", 
    277         "warp", 
    278         "trans33", 
    279         "trans66", 
    280         "flow", 
    281         "nodraw", 
    282         "hint", 
    283         "skip", 
    284         "phong", 
    285         "", 
    286         "", 
    287         "", 
    288         "", 
    289         "", 
    290         "", 
    291         "", 
    292         "", 
    293         "", 
    294         "", 
    295         "", 
    296         "", 
    297         "", 
    298         "", 
    299         "alphatest", 
    300         "", 
    301         "", 
    302         "", 
    303         "", 
    304         "", 
    305         "" 
    306 }; 
    307  
    308 static const char *contentFlags[] = { 
    309         "solid", 
    310         "window", 
    311         "", 
    312         "fireaffected", 
    313         "", 
    314         "water", 
    315         "", 
    316         "", 
    317         "level1", 
    318         "level2", 
    319         "level3", 
    320         "level4", 
    321         "level5", 
    322         "level6", 
    323         "level7", 
    324         "level8", 
    325         "actorclip", 
    326         "passable", 
    327         "footstep", 
    328         "", 
    329         "", 
    330         "", 
    331         "", 
    332         "", 
    333         "origin", 
    334         "weaponclip", 
    335         "", 
    336         "detail", 
    337         "", 
    338         "", 
    339         "stepon", 
    340         "" 
    341 }; 
    342271 
    343272#define UFOAI_FLAG_BUTTON_BORDER 3 
     
    359288        GtkWidget *label6; 
    360289        int i, x, y; 
     290        const char *buttonLabel; 
     291        char buffer[8]; 
    361292 
    362293        frame1 = gtk_frame_new ("Flags"); 
     
    387318                        y++; 
    388319                x = i % 4; 
    389                 surface_buttons[i] = gtk_toggle_button_new_with_label (surfaceFlags[i]); 
     320                snprintf(buffer, sizeof(buffer) - 1, "surf%i", i + 1); 
     321                buttonLabel = g_FuncTable.m_pfnReadProjectKey(buffer); 
     322                Sys_Printf("%s: %s\n", buffer, buttonLabel); 
     323                surface_buttons[i] = gtk_toggle_button_new_with_label (buttonLabel); 
    390324                gtk_signal_connect(GTK_OBJECT (surface_buttons[i]), "toggled", GTK_SIGNAL_FUNC(on_surface_button_toggled), GINT_TO_POINTER(1 << i)); 
    391325                gtk_widget_show(surface_buttons[i]); 
     
    445379                        y++; 
    446380                x = i % 4; 
    447                 content_buttons[i] = gtk_toggle_button_new_with_label(contentFlags[i]); 
     381                snprintf(buffer, sizeof(buffer) - 1, "cont%i", i + 1); 
     382                buttonLabel = g_FuncTable.m_pfnReadProjectKey(buffer); 
     383                content_buttons[i] = gtk_toggle_button_new_with_label(buttonLabel); 
    448384                gtk_signal_connect(GTK_OBJECT (content_buttons[i]), "toggled", GTK_SIGNAL_FUNC (on_content_button_toggled), GINT_TO_POINTER(1 << i)); 
    449385                gtk_widget_show(content_buttons[i]);