This commit is contained in:
Christoph Oelckers 2021-09-09 13:58:23 +02:00
commit 43c38a2097
7 changed files with 452 additions and 101 deletions

133
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,133 @@
name: Bug Report
description: File a Bug report
title: '[BUG] '
labels: bug
#assignees: 'anonymous@temp'
body:
- type: markdown
attributes:
value: |
## Please fill out forms as cleanly as possible.
#### Make sure that you have
* properly edited & filled in the title of this bug report
- type: dropdown
id: version
attributes:
label: GZDoom version
description: |
What version are you using?
Run `gzdoom --version`
Make sure to update to latest [release](https://github.com/coelckers/gzdoom/releases) version and test again before continuing.
multiple: false
options:
- 4.6.1
- 4.6.0
- 4.5.0
- 4.4.2
- 4.4.1
- 4.4.0
- Git
- Other
validations:
required: true
- type: dropdown
id: gameid
attributes:
label: Which game are you running with GZDoom?
multiple: false
options:
- Doom
- Doom 2
- Heretic
- Hexen
- Strife
- Other
validations:
required: false
- type: dropdown
id: OS
attributes:
label: What Operating System are you using?
multiple: false
options:
- Windows 11
- Windows 10
- Windows 8
- Windows 7
- Windows Other
- Mac OS
- Linux x86
- Linux x86_64
- Linux ARM (Raspberry Pi)
- Other
validations:
required: false
- type: input
id: other
attributes:
label: If Other OS, please describe
description: Other details
placeholder: "Windows, Mac OSX version, Debian, Ubuntu, Arch, etc."
validations:
required: false
- type: input
id: hardware
attributes:
label: Relevant hardware info
description: Hardware
placeholder: "CPU, GPU, device brand/model: e.g. Intel, AMD, Nvidia, etc"
validations:
required: false
- type: checkboxes
id: checked
attributes:
label: Have you checked that no other similar issue already exists?
description: Searched issues before creating report?
options:
- label: I have searched and not found similar issues.
required: true
- type: textarea
id: description
attributes:
label: A clear and concise description of what the bug is.
description: Describe what happens, what software were you running? _Include screenshot if possible_
placeholder: "How & When does this occur?"
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce the behaviour.
description: How can we reproduce this?
placeholder: "Explain how to reproduce"
value: |
Explain how to reproduce
1.
2.
3.
validations:
required: false
- type: textarea
id: config_file
attributes:
label: Your configuration
description: |
Share the config file(s) you've been using to run the program. (`gzdoom.ini`)
Please avoid pasting the full config, _use attachments or links_ in a [Gist](https://gist.github.com/)
placeholder: "example: cl_autorun=true"
render: ini # syntax highlighting
validations:
required: false
- type: textarea
id: log
attributes:
label: Provide a Log
description: Please avoid pasting the full log, _use attachments or links_ in a [Gist](https://gist.github.com/)
placeholder: "Copy & paste error log section or provide link"
validations:
required: false
- type: markdown
attributes:
value: |
* Make sure you have properly filled in the title of this bug report

View File

@ -0,0 +1,116 @@
name: Feature Request
description: Suggest an idea (a new feature or other improvement) for this project
title: '[Feature] '
labels: enhancement
#assignees: 'anonymous@temp'
body:
- type: markdown
attributes:
value: |
## Please fill out forms as cleanly as possible.
#### Make sure that you have
* properly edited & filled in the title of this bug report
- type: dropdown
id: version
attributes:
label: GZDoom version
description: |
What version are you using?
Run `gzdoom --version`
Make sure to update to latest [release](https://github.com/coelckers/gzdoom/releases) version and test again before continuing.
multiple: false
options:
- 4.6.1
- 4.6.0
- 4.5.0
- 4.4.2
- 4.4.1
- 4.4.0
- Git
- Other
validations:
required: true
- type: dropdown
id: gameid
attributes:
label: Which game are you running with GZDoom?
multiple: false
options:
- Doom
- Doom 2
- Heretic
- Hexen
- Strife
- Other
validations:
required: false
- type: dropdown
id: OS
attributes:
label: What Operating System are you using?
multiple: false
options:
- Windows 11
- Windows 10
- Windows 8
- Windows 7
- Windows Other
- Mac OS
- Linux x86
- Linux x86_64
- Linux ARM (Raspberry Pi)
- Other
validations:
required: false
- type: input
id: other
attributes:
label: If Other OS, please describe
description: Other details
placeholder: "Windows, Mac OSX version, Debian, Ubuntu, Arch, etc."
validations:
required: false
- type: input
id: hardware
attributes:
label: Relevant hardware info
description: Hardware
placeholder: "CPU, GPU, device brand/model: e.g. Intel, AMD, Nvidia, etc"
validations:
required: false
- type: textarea
id: related
attributes:
label: Is your feature request related to a problem? Please describe.
description: Related
placeholder: "Ex. I'm always frustrated when"
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
placeholder: "Ex. How can we make it better?"
validations:
required: false
- type: textarea
id: alternative
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
placeholder: "Similar idea or software"
validations:
required: false
- type: textarea
id: additional
attributes:
label: Add any other context or screenshots about the feature request here.
description: Screenshots or Links?
placeholder: "Ex. Screenshot or Link"
validations:
required: false
- type: markdown
attributes:
value: |
* Make sure you have properly filled in the title of this feature request

View File

@ -810,6 +810,7 @@ set (PCH_SOURCES
ct_chat.cpp
d_iwad.cpp
d_main.cpp
d_defcvars.cpp
d_anonstats.cpp
d_net.cpp
d_netinfo.cpp

155
src/d_defcvars.cpp Normal file
View File

@ -0,0 +1,155 @@
//-----------------------------------------------------------------------------
// Copyright 1993-1996 id Software
// Copyright 1999-2016 Randy Heit
// Copyright 2002-2016 Christoph Oelckers
// Copyright 2019-2021 Rachael Alexanderson
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/
//
//
// DESCRIPTION:
// defcvars loader split from d_main.cpp
//
//-----------------------------------------------------------------------------
// HEADER FILES ------------------------------------------------------------
#include "doomdef.h"
#include "doomstat.h"
#include "gstrings.h"
#include "filesystem.h"
#include "menu.h"
#include "doommenu.h"
#include "c_console.h"
#include "d_main.h"
#include "version.h"
#include "d_defcvars.h"
void D_GrabCVarDefaults()
{
int lump, lastlump = 0;
int lumpversion, gamelastrunversion;
gamelastrunversion = atoi(LASTRUNVERSION);
while ((lump = fileSystem.FindLump("DEFCVARS", &lastlump)) != -1)
{
// don't parse from wads
if (lastlump > fileSystem.GetLastEntry(fileSystem.GetMaxIwadNum()))
{
// would rather put this in a modal of some sort, but this will have to do.
Printf(TEXTCOLOR_RED "Cannot load DEFCVARS from a wadfile!\n");
break;
}
FScanner sc(lump);
sc.MustGetString();
if (!sc.Compare("version"))
sc.ScriptError("Must declare version for defcvars! (currently: %i)", gamelastrunversion);
sc.MustGetNumber();
lumpversion = sc.Number;
if (lumpversion > gamelastrunversion)
sc.ScriptError("Unsupported version %i (%i supported)", lumpversion, gamelastrunversion);
if (lumpversion < 219)
sc.ScriptError("Version must be at least 219 (current version %i)", gamelastrunversion);
FBaseCVar* var;
FString CurrentFindCVar;
while (sc.GetString())
{
if (sc.Compare("set"))
{
sc.MustGetString();
}
CurrentFindCVar = sc.String;
if (lumpversion < 220)
{
CurrentFindCVar.ToLower();
// these two got renamed
if (strcmp(CurrentFindCVar, "gamma") == 0)
{
CurrentFindCVar = "vid_gamma";
}
if (strcmp(CurrentFindCVar, "fullscreen") == 0)
{
CurrentFindCVar = "vid_fullscreen";
}
// this was removed
if (strcmp(CurrentFindCVar, "cd_drive") == 0)
break;
}
if (lumpversion < 221)
{
// removed cvar
// this one doesn't matter as much, since it depended on platform-specific values,
// and is something the user should change anyhow, so, let's just throw this value
// out.
if (strcmp(CurrentFindCVar, "mouse_sensitivity") == 0)
break;
if (strcmp(CurrentFindCVar, "m_noprescale") == 0)
break;
}
bool blacklisted = false;
SHOULD_BLACKLIST(disablecrashlog)
SHOULD_BLACKLIST(gl_control_tear)
SHOULD_BLACKLIST(in_mouse)
SHOULD_BLACKLIST(joy_dinput)
SHOULD_BLACKLIST(joy_ps2raw)
SHOULD_BLACKLIST(joy_xinput)
SHOULD_BLACKLIST(k_allowfullscreentoggle)
SHOULD_BLACKLIST(k_mergekeys)
SHOULD_BLACKLIST(m_swapbuttons)
SHOULD_BLACKLIST(queryiwad_key)
SHOULD_BLACKLIST(vid_gpuswitch)
SHOULD_BLACKLIST(vr_enable_quadbuffered)
var = FindCVar(CurrentFindCVar, NULL);
if (blacklisted)
{
sc.ScriptMessage("Cannot set cvar default for blacklisted cvar '%s'", sc.String);
sc.MustGetString(); // to ignore the value of the cvar
}
else if (var != NULL)
{
if (var->GetFlags() & CVAR_ARCHIVE)
{
UCVarValue val;
sc.MustGetString();
val.String = const_cast<char*>(sc.String);
var->SetGenericRepDefault(val, CVAR_String);
}
else
{
sc.ScriptMessage("Cannot set cvar default for non-config cvar '%s'", sc.String);
sc.MustGetString(); // to ignore the value of the cvar
}
}
else
{
sc.ScriptMessage("Unknown cvar '%s' in defcvars", sc.String);
sc.MustGetString(); // to ignore the value of the cvar
}
}
}
}

27
src/d_defcvars.h Normal file
View File

@ -0,0 +1,27 @@
//-----------------------------------------------------------------------------
// Copyright 2021 Rachael Alexanderson
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/
//
//
// DESCRIPTION:
// defcvars loader split from d_main.cpp
//
//-----------------------------------------------------------------------------
#define SHOULD_BLACKLIST(name) \
if (#name[0]==CurrentFindCVar[0]) \
if (strcmp(CurrentFindCVar, #name) == 0) \
blacklisted = true;

View File

@ -169,6 +169,7 @@ void D_Cleanup();
void FreeSBarInfoScript();
void I_UpdateWindowTitle();
void S_ParseMusInfo();
void D_GrabCVarDefaults();
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
@ -331,99 +332,6 @@ static int pagetic;
// CODE --------------------------------------------------------------------
void D_GrabCVarDefaults()
{
int lump, lastlump = 0;
int lumpversion, gamelastrunversion;
gamelastrunversion = atoi(LASTRUNVERSION);
while ((lump = fileSystem.FindLump("DEFCVARS", &lastlump)) != -1)
{
// don't parse from wads
if (lastlump > fileSystem.GetLastEntry(fileSystem.GetMaxIwadNum()))
{
// would rather put this in a modal of some sort, but this will have to do.
Printf(TEXTCOLOR_RED "Cannot load DEFCVARS from a wadfile!\n");
break;
}
FScanner sc(lump);
sc.MustGetString();
if (!sc.Compare("version"))
sc.ScriptError("Must declare version for defcvars! (currently: %i)", gamelastrunversion);
sc.MustGetNumber();
lumpversion = sc.Number;
if (lumpversion > gamelastrunversion)
sc.ScriptError("Unsupported version %i (%i supported)", lumpversion, gamelastrunversion);
if (lumpversion < 219)
sc.ScriptError("Version must be at least 219 (current version %i)", gamelastrunversion);
FBaseCVar* var;
FString CurrentFindCVar;
while (sc.GetString())
{
if (sc.Compare("set"))
{
sc.MustGetString();
}
CurrentFindCVar = sc.String;
if (lumpversion < 220)
{
CurrentFindCVar.ToLower();
// these two got renamed
if (strcmp(CurrentFindCVar, "gamma") == 0)
{
CurrentFindCVar = "vid_gamma";
}
if (strcmp(CurrentFindCVar, "fullscreen") == 0)
{
CurrentFindCVar = "vid_fullscreen";
}
// this was removed
if (strcmp(CurrentFindCVar, "cd_drive") == 0)
break;
}
if (lumpversion < 221)
{
// removed cvar
// this one doesn't matter as much, since it depended on platform-specific values,
// and is something the user should change anyhow, so, let's just throw this value
// out.
if (strcmp(CurrentFindCVar, "mouse_sensitivity") == 0)
break;
if (strcmp(CurrentFindCVar, "m_noprescale") == 0)
break;
}
var = FindCVar(CurrentFindCVar, NULL);
if (var != NULL)
{
if (var->GetFlags() & CVAR_ARCHIVE)
{
UCVarValue val;
sc.MustGetString();
val.String = const_cast<char*>(sc.String);
var->SetGenericRepDefault(val, CVAR_String);
}
else
{
sc.ScriptError("Cannot set cvar default for non-config cvar '%s'", sc.String);
}
}
else
{
sc.ScriptError("Unknown cvar '%s'", sc.String);
}
}
}
}
//==========================================================================
//
// D_ToggleHud

View File

@ -31,7 +31,8 @@ class os_Menu : OptionMenu
addSearchField(text);
bool found = listOptions(mDesc, "MainMenu", query, "", isAnyTermMatches);
Dictionary searchedMenus = Dictionary.Create();
bool found = listOptions(mDesc, "MainMenu", query, "", isAnyTermMatches, searchedMenus);
if (!found) { addNoResultsItem(mDesc); }
@ -54,21 +55,29 @@ class os_Menu : OptionMenu
string menuName,
os_Query query,
string path,
bool isAnyTermMatches)
bool isAnyTermMatches,
Dictionary searchedMenus)
{
if (searchedMenus.At(menuName).length() > 0)
{
return false;
}
searchedMenus.Insert(menuName, "1");
let desc = MenuDescriptor.GetDescriptor(menuName);
let listMenuDesc = ListMenuDescriptor(desc);
if (listMenuDesc)
{
return listOptionsListMenu(listMenuDesc, targetDesc, query, path, isAnyTermMatches);
return listOptionsListMenu(listMenuDesc, targetDesc, query, path, isAnyTermMatches, searchedMenus);
}
let optionMenuDesc = OptionMenuDescriptor(desc);
if (optionMenuDesc)
{
return listOptionsOptionMenu(optionMenuDesc, targetDesc, query, path, isAnyTermMatches);
return listOptionsOptionMenu(optionMenuDesc, targetDesc, query, path, isAnyTermMatches, searchedMenus);
}
return false;
@ -78,7 +87,8 @@ class os_Menu : OptionMenu
OptionMenuDescriptor targetDesc,
os_Query query,
string path,
bool isAnyTermMatches)
bool isAnyTermMatches,
Dictionary searchedMenus)
{
int nItems = sourceDesc.mItems.size();
bool found = false;
@ -92,7 +102,7 @@ class os_Menu : OptionMenu
? makePath(path, StringTable.Localize(textItem.mText))
: path;
found |= listOptions(targetDesc, actionN, query, newPath, isAnyTermMatches);
found |= listOptions(targetDesc, actionN, query, newPath, isAnyTermMatches, searchedMenus);
}
return found;
@ -102,7 +112,8 @@ class os_Menu : OptionMenu
OptionMenuDescriptor targetDesc,
os_Query query,
string path,
bool isAnyTermMatches)
bool isAnyTermMatches,
Dictionary searchedMenus)
{
if (sourceDesc == targetDesc) { return false; }
@ -152,7 +163,7 @@ class os_Menu : OptionMenu
{
string newPath = makePath(path, label);
found |= listOptions(targetDesc, item.GetAction(), query, newPath, isAnyTermMatches);
found |= listOptions(targetDesc, item.GetAction(), query, newPath, isAnyTermMatches, searchedMenus);
}
}