#include "missing.h"
#include "gtkmisc.h"
+#ifdef _WIN32
+ // sanity check - some gtk2 win32 runtimes replace sprintf
+ #if defined( sprintf )
+ #error sprintf is a macro. are you sure?
+ #endif
+#endif
+
#ifdef _WIN32
#include <io.h>
#define X_OK 0
#define WIDETOOLBAR_KEY "WideToolBar"
#define PLUGINTOOLBAR_KEY "PluginToolBar"
#define NOCLAMP_KEY "NoClamp"
+#define SNAP_KEY "Snap"
#define PREFAB_KEY "PrefabPath"
#define USERINI_KEY "UserINIPath"
#define ROTATION_KEY "Rotation"
m_bWideToolbar = TRUE;
m_bPluginToolbar = TRUE;
m_bNoClamp = FALSE;
+ m_bSnap = TRUE;
m_strUserPath = "";
m_nRotation = 0;
m_bChaseMouse = FALSE;
gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bNoClamp, DLG_CHECK_BOOL);
+ // Snap to grid
+ check = gtk_check_button_new_with_label (_("Snap to grid"));
+ gtk_widget_show (check);
+ gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
+ AddDialogData (check, &m_bSnap, DLG_CHECK_BOOL);
+
// Select patch by bounding box
check = gtk_check_button_new_with_label (_("Select patches by bounding box"));
gtk_widget_show (check);
m_nShader = m_nLatchedShader;
mLocalPrefs.GetPref(NOCLAMP_KEY, &m_bNoClamp, FALSE);
+ mLocalPrefs.GetPref(SNAP_KEY, &m_bSnap, TRUE);
mLocalPrefs.GetPref(USERINI_KEY, &m_strUserPath, "");
mLocalPrefs.GetPref(ROTATION_KEY, &m_nRotation, 45);
mLocalPrefs.GetPref(CHASEMOUSE_KEY, &m_bChaseMouse, TRUE);
Sys_Printf( "OnBtnBrowseEngine\n" );
CGameInstall* i = static_cast<CGameInstall*>( data );
- char *dir = dir_dialog( widget, _("Select game directory"), NULL );
+ char *dir = dir_dialog( i->m_pWidget, _("Select game directory"), NULL );
i->UpdateData( TRUE );
if ( dir != NULL ) {
i->m_strEngine = dir;
i->UpdateData( FALSE );
- free( dir );
+ g_free( dir );
}
}
case GAME_TREMULOUS:
gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), _("Tremulous") );
break;
+ case GAME_JA:
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), _("Jedi Academy and mods") );
+ break;
}
iGame++;
}
void CGameInstall::Run() {
ScanGames();
+ if ( m_availGames[0] == GAME_NONE ) {
+ return;
+ }
if ( DoModal() == IDCANCEL ) {
Sys_Printf( "game dialog cancelled\n" );
return;
gameFilePath += ".game";
Sys_Printf( "game file: %s\n", gameFilePath.GetBuffer() );
- FILE *fg = fopen( gameFilePath.GetBuffer(), "w" );
+ FILE * fg = fopen( gameFilePath.GetBuffer(), "w" );
if ( fg == NULL ) {
Error( "Failed to open %s for writing\n", gameFilePath.GetBuffer() );
}
fprintf( fg, " basegame=\"base\"\n" );
break;
}
+ case GAME_JA: {
+ fprintf( fg, " "TOOLS_ATTRIBUTE"=\"%sinstalls/JAPack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".ja\"\n" );
+ Str source = g_strAppPath.GetBuffer();
+ source += "installs/";
+ source += JA_PACK;
+ source += "/install/";
+ Str dest = m_strEngine.GetBuffer();
+ CopyTree( source.GetBuffer(), dest.GetBuffer() );
+ fprintf( fg, " basegame=\"base\"\n" );
+ break;
+ }
}
fprintf( fg, "/>\n" );
fclose( fg );
if ( stricmp( dirname, TREMULOUS_PACK ) == 0 ) {
m_availGames[ iGame++ ] = GAME_TREMULOUS;
}
+ if ( stricmp( dirname, JA_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_JA;
+ }
}
+ Sys_Printf("No installable games found in: %s\n",
+ pakPaths.GetBuffer() );
}