From: spog Date: Tue, 21 Feb 2006 18:42:25 +0000 (+0000) Subject: patch by namespace: lighting-preview toggle command X-Git-Tag: xonotic-v0.7.0~16^2~12^2~275 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=a8a120ed834fb1dead4d51a5e8011bacccdad945 patch by namespace: lighting-preview toggle command git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@19 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- diff --git a/CHANGES b/CHANGES index 77ca4e97..7006261a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ This is the changelog for developers, != changelog for the end user that we distribute with the binaries. (see changelog) +21/02/2006 +namespace +- Added command to toggle lighting/textured modes, shortcut F3. + 20/02/2006 SPoG - Fixed crash when disabling lighting for a second time. diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 057e6aa8..ed8ec13a 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1752,6 +1752,11 @@ void CamWnd_constructToolbar(GtkToolbar* toolbar) void CamWnd_registerShortcuts() { toggle_add_accelerator("ToggleCubicClip"); + + if(g_pGameDescription->mGameType == "doom3") + { + command_connect_accelerator("TogglePreview"); + } } @@ -1781,6 +1786,17 @@ void CamWnd_SetMode(camera_draw_mode mode) } } +void CamWnd_TogglePreview(void) +{ + // gametype must be doom3 for this function to work + // if the gametype is not doom3 something is wrong with the + // global command list or somebody else calls this function. + ASSERT_MESSAGE(g_pGameDescription->mGameType == "doom3", "CamWnd_TogglePreview called although mGameType is not doom3 compatible"); + + // switch between textured and lighting mode + CamWnd_SetMode((CamWnd_GetMode() == cd_lighting) ? cd_texture : cd_lighting); +} + CameraModel* g_camera_model = 0; @@ -1946,6 +1962,11 @@ void CamWnd_Construct() GlobalCommands_insert("LookThroughSelected", FreeCaller()); GlobalCommands_insert("LookThroughCamera", FreeCaller()); + if(g_pGameDescription->mGameType == "doom3") + { + GlobalCommands_insert("TogglePreview", FreeCaller(), Accelerator(GDK_F3)); + } + GlobalShortcuts_insert("CameraForward", Accelerator(GDK_Up)); GlobalShortcuts_insert("CameraBack", Accelerator(GDK_Down)); GlobalShortcuts_insert("CameraLeft", Accelerator(GDK_Left));