otta8634 [Sat, 25 Jan 2025 15:05:01 +0000 (23:05 +0800)]
Make filtering work for gamemodes and mutators
Did this by applying the same workaround as the COLORED_NAME macros, using .message if it exists, otherwise .m_name.
In future ideally .message would be renamed to .m_name on Mutators and Gametypes.
See https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/181#note_2291392189 for more.
otta8634 [Sat, 11 Jan 2025 12:39:06 +0000 (20:39 +0800)]
Improve Jump buff, Vortex, Mayhem descriptions
I discovered the Jump buff added note while looking at the code recently that it also negates any DEATH_FALL damage.
This wasn't documented on the wiki so I missed it initially.
otta8634 [Fri, 10 Jan 2025 15:51:30 +0000 (23:51 +0800)]
Almost fix filtering in the guide
Still has an issue: doesn't work properly for Gametypes and Mutators.
- Method used was filtering based on .m_name, however Gametypes and Mutators don't use .m_name (yet), they use .message.
- This can easily be fixed by just changing the macro to use .message for those two, but a better approach should be used, so I'm intentionally pushing slightly-buggy code in hopes a better approach will be found.
Needed a bit of reworking of some functions in menu/guide/entries.qc so that MENUQC would stop crashing, added comments to help clarify code.
One example bug introduced is team-based gamemodes being no longer team-based, and some scoreboard funkiness found by @terencehill.
Gametypes also use mutators, seems that this commit (specifically changing .m_name -> .mutatorname) didn't properly account for that somehow.
I couldn't find the .m_name access that needed to be changed, so instead I reverted that change and added .message to Mutator.
In future for consistency's sake .m_name should be renamed to .mutatorname in Mutator, and .message to .m_name in Gametype and Mutator.
otta8634 [Wed, 8 Jan 2025 16:19:56 +0000 (00:19 +0800)]
Add Mutators to the guide
Descriptions were based on https://gitlab.com/xonotic/xonotic/-/wikis/home for those which had an entry there.
There are some "mutators" which would be nice to include in the guide like weaponarena and weaponstay, except they aren't actually implemented as Mutators in the code.
Descriptions were added in mutatorname.qc under MENUQC, with the MENUQC-Mutator added in mutatorname.qh.
It may be worthwhile considering renaming the MENUQC-Mutator to menu_mutatorname for clarity's sake, like how there's cl_mutatorname sometimes.
The only refactoring included was in common/mutators/mutator/new_toys, relocating nt_IsNewToy from sv_new_toys.qc to new_toys.qc.
otta8634 [Wed, 8 Jan 2025 16:18:36 +0000 (00:18 +0800)]
Remove mutators constructor
This allows for classes to inherit Mutator without having to copy paste the CONSTRUCTOR, since CONSTRUCTOR inheritance doesn't work currently for some reason.
This can be reverted easily in future when CONSTRUCTOR inheritance is fixed.
otta8634 [Wed, 8 Jan 2025 10:13:39 +0000 (18:13 +0800)]
Slightly refactor mutators code
These changes allow mutators to be properly shown in the guide.
Renamed .m_name to .mutatorname, and added (new) .m_name which would be displayed in the guide.
Allowed use of classes other than Mutator in the Mutators registry, so that m_name, m_icon, and m_color can be stored in such class and then displayed in the guide.
Also removed itemstime and waypointsprites mutators from the guide.
otta8634 [Tue, 7 Jan 2025 17:07:11 +0000 (01:07 +0800)]
Relocate the guide to Singleplayer
Added a button for it alongside the 'Instant action' button.
Converted it to a XonoticDialog from a XonoticTab, renamed the class to XonoticGuideDialog.
Renamed the Singleplayer menu to Singleplayer / Guide.
Slightly changed some Singleplayer menu strings.
otta8634 [Tue, 7 Jan 2025 11:51:53 +0000 (19:51 +0800)]
Allow use of ctrl+F and ctrl+U in guide filter
The filtering still doesn't work yet.
Also cleaned up guide tab fill function, and some other code.
Made the guide XonoticEntryList not have to refer to XonoticMapList.
otta8634 [Mon, 6 Jan 2025 16:51:34 +0000 (00:51 +0800)]
Add Gametypes to the guide
Descriptions were based on https://gitlab.com/xonotic/xonotic/-/wikis/home, although some gamemodes don't have a description there.
Added back .gametype_description (now called .m_description) so that the shorter gamemode descriptions can still be used.
Added .m_name to the gamemode class, copied with the initial value of .message, so that the COLORED_NAME macros can be used. Ideally .message wouldn't be necessary since it's not very descriptive, I just didn't bother going through all instances of .message being used to make sure nothing would break.
terencehill [Sat, 4 Jan 2025 14:04:08 +0000 (15:04 +0100)]
Refactor code to remove WEP_FLAG_SPECIALATTACK checks if WEP_FLAG_HIDDEN is already checked.
This refactoring is now possible thanks to the changes of !1344, where all WEP_FLAG_SPECIALATTACK checks have been paired with WEP_FLAG_HIDDEN checks
To make sure WEP_FLAG_HIDDEN is always set on special attacks, weapon initialization code triggers a fatal error if WEP_FLAG_SPECIALATTACK is set but WEP_FLAG_HIDDEN is not.
Rudolf Polzer [Thu, 2 Jan 2025 23:58:19 +0000 (18:58 -0500)]
Fix case of trails not being drawn on CSQC models with unset alpha.
That bug was found by Mario in
https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/1410#note_2279399941
and was actually pre-existing even before the change, as it was passing
0 to both alpha and count modifiers.
otta8634 [Wed, 1 Jan 2025 05:41:56 +0000 (13:41 +0800)]
Add turrets to the guide
Descriptions were somewhat based on scripts/entities.ent from xonotic/xonotic-maps.pk3dir.
Also renamed .turret_name -> .m_name, so the COLORED_NAME macros could work on turrets.
otta8634 [Sun, 22 Dec 2024 17:08:07 +0000 (01:08 +0800)]
Separate powerups from items in the guide
Since both the Powerups and Items sections use the ITEM registry, the REGISTRY_SOURCE macro had to be updated, so some minor refactoring is included.
Choose to use the ka icon for Buffs since it's more circular (like the buffs simpleitems), and dom for Powerups since it's more triangular (like most powerups simpleitems).
otta8634 [Sun, 22 Dec 2024 16:58:25 +0000 (00:58 +0800)]
Relocate descriptions of powerups from statuseffects to items
Due to 89ad1fa8 the descriptions need to be shifted to the ITEM_ powerup not the STATUSEFFECT_ powerup.
Also made the distinction between the two clear for the main 4 powerups.
otta8634 [Sun, 22 Dec 2024 10:19:07 +0000 (18:19 +0800)]
Add some documentation showing the location of guide descriptions
This will hopefully make them a bit easier to find if someone inexperienced with the codebase wants to try to edit the guide. I think still they're require someone to point them in the right place though, but this is better than nothing.
otta8634 [Fri, 20 Dec 2024 11:35:22 +0000 (19:35 +0800)]
Colorize guide
Added colors to mostly all m_names shown currently except monsters since the plural versions don't have a standalone transifex string (yet).
Some colors are currently white (like for all ammo items and vehicles) but can easily be changed in future.
otta8634 [Fri, 20 Dec 2024 09:00:47 +0000 (17:00 +0800)]
Use m_name for vehicles and monsters
Previously monster_name and vehicle_name were used, which were obviously used nowhere else.
Renamed them both to m_name, mostly so that the COLORED_NAME macro can work on them, and also so that there's less unnecessary entity fields.
otta8634 [Fri, 20 Dec 2024 08:28:53 +0000 (16:28 +0800)]
Use the translatable strings for some default classes
The "Monster", "Buff", and "Vehicle" transifex strings already existed but weren't used here for some reason.
This is unrelated to the guide but I saw it as a good opportunity to fix this.
otta8634 [Fri, 20 Dec 2024 08:26:17 +0000 (16:26 +0800)]
Move attributes for items and nades into their classes
This makes it more consistent with weapons, buffers, some powerups, monsters, and vehicles.
Also this makes it possible to use the COLORED_NAME macro on them in the guide.
This could be done for the rest of the powerups too, but they're a bit of a mess currently.
otta8634 [Thu, 19 Dec 2024 18:18:16 +0000 (02:18 +0800)]
Relocate m_color constants to common/colors.qh
This allows for the colors to be used in guide descriptions in future, without causing duplicate code.
This will also make editing multiple colors at once easier.
Also renamed wpcolor attrib (waypointsprite color) used by weapons to m_color, as with all other item-things.
otta8634 [Thu, 19 Dec 2024 15:22:28 +0000 (23:22 +0800)]
Move descriptions to MENUQC
Added ifdef MENUQC checks around describe methods for the currently added: items, monsters, vehicles, weapons, buffs/powerups, and nades.
Skipped gamemodes since they're used elsewhere (I think?), and skipped the free-text guide since that's in qcsrc/menu/.
This change prevents the csprogs from increasing in size unnecessarily, with minimal readability cost.
otta8634 [Thu, 19 Dec 2024 08:45:08 +0000 (16:45 +0800)]
Add buffs, powerups, and items to the guide
Descriptions of buffs/powerups were somewhat based on https://gitlab.com/xonotic/xonotic/-/wikis/Buffs and https://gitlab.com/xonotic/xonotic/-/wikis/Powerups.
otta8634 [Thu, 19 Dec 2024 07:29:57 +0000 (15:29 +0800)]
Add weapons to the guide
Descriptions were somewhat based on https://gitlab.com/xonotic/xonotic/-/wikis/Weapons but since that's in a format not really suitable for a guide, I took some creative liberty.