From 42908149f966edf06be766aec029cb0c42bf4e9d Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 6 Dec 2018 07:13:37 +0000 Subject: [PATCH] Dir command should allow wavs/oggs to be clicked too. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5360 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/keys.c | 6 ++++++ engine/common/fs.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/engine/client/keys.c b/engine/client/keys.c index 68724d8b4..2d63966a9 100644 --- a/engine/client/keys.c +++ b/engine/client/keys.c @@ -1043,6 +1043,12 @@ void Key_DefaultLinkClicked(console_t *con, char *text, char *info) return; } #endif + c = Info_ValueForKey(info, "playaudio"); + if (*c && !strchr(c, ';') && !strchr(c, '\n')) + { + Cbuf_AddText(va("\nplay \"%s\"\n", c), RESTRICT_LOCAL); + return; + } c = Info_ValueForKey(info, "desc"); if (*c) { diff --git a/engine/common/fs.c b/engine/common/fs.c index 7ffcdfffd..0831aa102 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -827,6 +827,8 @@ static int QDECL COM_Dir_List(const char *name, qofs_t size, time_t mtime, void } else if (!Q_strcasecmp(link, "roq") || !Q_strcasecmp(link, "cin") || !Q_strcasecmp(link, "avi") || !Q_strcasecmp(link, "mp4") || !Q_strcasecmp(link, "mkv")) Q_snprintfz(link, sizeof(link), "\\tip\\Play Film\\film\\%s", name); + else if (!Q_strcasecmp(link, "wav") || !Q_strcasecmp(link, "ogg") || !Q_strcasecmp(link, "mp3") || !Q_strcasecmp(link, "opus") || !Q_strcasecmp(link, "flac")) + Q_snprintfz(link, sizeof(link), "\\tip\\Play Audio\\playaudio\\%s", name); else { colour = "^3"; //nothing