[ioquake3] 03/06: Request confirmation before enabling auto-downloading

Simon McVittie smcv at debian.org
Tue Mar 14 11:15:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 72d35d7cf10709ad7845267a1c08d83104d3d67c
Author: Simon McVittie <smcv at debian.org>
Date:   Tue Mar 14 09:01:05 2017 +0000

    Request confirmation before enabling auto-downloading
---
 debian/changelog                                   |  4 ++
 ...mation-if-a-user-enables-auto-downloading.patch | 72 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 77 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3bc3245..25462f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,10 @@ ioquake3 (1.36+u20161101+dfsg1-2) UNRELEASED; urgency=medium
       command
     - refuse to overwrite files other than *.cfg with the writeconfig
       console command
+  * Add patch adapted from openarena to request confirmation before
+    enabling auto-downloading if the native-code Quake III Arena UI is
+    in use, which it is by default in Debian since
+    ioquake3/1.36+u20150114+dfsg1-1 and quake3/10
 
  -- Simon McVittie <smcv at debian.org>  Tue, 14 Mar 2017 08:32:13 +0000
 
diff --git a/debian/patches/debian/Request-confirmation-if-a-user-enables-auto-downloading.patch b/debian/patches/debian/Request-confirmation-if-a-user-enables-auto-downloading.patch
new file mode 100644
index 0000000..f7df353
--- /dev/null
+++ b/debian/patches/debian/Request-confirmation-if-a-user-enables-auto-downloading.patch
@@ -0,0 +1,72 @@
+From: Simon McVittie <smcv at debian.org>
+Date: Fri, 14 Sep 2012 10:23:06 +0100
+Subject: Request confirmation if a user enables auto-downloading
+
+The Q3 UI toolkit isn't great at large amounts of text, so just point
+to a deb.li link into the Debian wiki.
+
+[Adapted from src:openarena for src:ioquake3]
+
+Origin: vendor, Debian
+Bug-Debian: http://bugs.debian.org/686648
+---
+ code/q3_ui/ui_preferences.c | 38 +++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 37 insertions(+), 1 deletion(-)
+
+diff --git a/code/q3_ui/ui_preferences.c b/code/q3_ui/ui_preferences.c
+index b65728a..58e4c6c 100644
+--- a/code/q3_ui/ui_preferences.c
++++ b/code/q3_ui/ui_preferences.c
+@@ -103,6 +103,39 @@ static void Preferences_SetMenuItems( void ) {
+ 	s_preferences.allowdownload.curvalue	= trap_Cvar_VariableValue( "cl_allowDownload" ) != 0;
+ }
+ 
++static void AutoDownloadAction( qboolean result )
++{
++	if (result) {
++		trap_Cvar_SetValue( "cl_allowDownload", 1 );
++	} else {
++		trap_Cvar_SetValue( "cl_allowDownload", 0 );
++	}
++	s_preferences.allowdownload.curvalue = result;
++}
++
++static void UI_ConfirmAutoDownload_Draw ( void )
++{
++	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 0,
++		"WARNING: This is a security risk.",
++		UI_CENTER|UI_SMALLFONT, color_yellow );
++	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 1,
++		"More information: <http://deb.li/Q3DL>",
++		UI_CENTER|UI_SMALLFONT, color_yellow );
++}
++
++static void UI_ConfirmAutoDownload( void (*action) (qboolean) )
++{
++	if (trap_Cvar_VariableValue( "cl_allowDownload" ) != 0) {
++		/* already set */
++		return;
++	}
++
++	UI_ConfirmMenu_Style(
++		"Auto-download?",
++		UI_CENTER|UI_SMALLFONT,
++		UI_ConfirmAutoDownload_Draw,
++		action);
++}
+ 
+ static void Preferences_Event( void* ptr, int notification ) {
+ 	if( notification != QM_ACTIVATED ) {
+@@ -154,8 +187,11 @@ static void Preferences_Event( void* ptr, int notification ) {
+ 		break;
+ 
+ 	case ID_ALLOWDOWNLOAD:
+-		trap_Cvar_SetValue( "cl_allowDownload", s_preferences.allowdownload.curvalue );
+ 		trap_Cvar_SetValue( "sv_allowDownload", s_preferences.allowdownload.curvalue );
++		if ( s_preferences.allowdownload.curvalue )
++			UI_ConfirmAutoDownload( AutoDownloadAction );
++		else
++			trap_Cvar_SetValue( "cl_allowDownload", 0 );
+ 		break;
+ 
+ 	case ID_BACK:
diff --git a/debian/patches/series b/debian/patches/series
index e442b3b..5be9dd2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ debian/Let-servers-set-sv_fps-too.patch
 debian/Add-a-special-vmMagic-that-causes-equivalent-native-.patch
 debian/Run-in-a-window-by-default-on-new-installations.patch
 debian/ui-reinstate-minimal-code-to-determine-whether-this-.patch
+debian/Request-confirmation-if-a-user-enables-auto-downloading.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list