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.
terencehill [Mon, 20 Jan 2025 23:16:58 +0000 (00:16 +0100)]
Improve some Weapons panel dialog settings:
* Rename "Show weapon ID as:" to "Show label:" (weapon is implicit)
* Turn "Show label:" into a checkbox so to get rid of the "None" option
* Add "Name" checkbox as "Show label:" option
* Rename "Weapon ID scale:" to "Scale:" (weapon label is implicit)
* Fix a few wrong dependencies introduced by xonotic/xonotic-data.pk3dir!1414
otta8634 [Sat, 18 Jan 2025 07:52:46 +0000 (15:52 +0800)]
Undo physics changes related to hash change of 0e542a1e
This commit altered how physics code works, changing the hash.
This is a regression.
The rest of the changes in 0e542a1e didn't update the hash, and logically speaking shouldn't alter how physics works.
Undid changes which led to the hash change, at the tiny cost of some lost regained performance.
bones_was_here [Tue, 14 Jan 2025 15:30:41 +0000 (01:30 +1000)]
Prevent hidden weapons being revealed with waypoints and centreprints
Normally this issue isn't noticeable, but with
g_balance_blaster_weaponstart 0 the secret tubas were revealed by the
weapon_group_1 bind.
If all weapons in a group are HIDDEN, nothing is displayed when the
group bind is pressed. This seems better than the alternatives:
- "AOL CD Thrower is not available"
- "@!#%'n Tuba is not available" even though it's in the secret room
- "No weapon in the group is available" but it's a lie
bones_was_here [Tue, 14 Jan 2025 12:21:12 +0000 (22:21 +1000)]
Implement weapon availability warnings for custom weapon groups
Fixes "AOL CD Thrower is not available" (see previous commit and #2380)
when using a cl_weaponpriorityN custom weapon group and none of its
weapons are on the map.
Refactors and somewhat documents the `have_other` checking for
compatibility, performance and clarity.
The delay was frustrating when getting a bckill in midair but being
unable to pick up the ball despite having travelled through it.
We still need to prevent instant pickup by the previous owner so the
ball can be dropped manually. Sharing a field from KH for this with the
same 0.5s delay as used when throwing a weapon.
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.
terencehill [Fri, 10 Jan 2025 22:46:59 +0000 (23:46 +0100)]
Code cleanup
* rename Superweapons class to Superweapon because class names should always be singular
* rename StatusEffects class to StatusEffect because class names should always be singular
* rename StatusEffect registry to StatusEffects because registry names should always be plural
* rename Powerup class child of StatusEffect to PowerupStatusEffect so to remove ambiguity
with Powerup child of Pickup
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 14:45:32 +0000 (22:45 +0800)]
Rename .turret_name to .m_name
Turrets don't also use .m_name so this shouldn't introduce any regressions.
Makes it more consistent and removes one unnecessary entity field.
Mostly copied from b416d03c68.
otta8634 [Fri, 20 Dec 2024 09:00:47 +0000 (17:00 +0800)]
Use m_name for vehicles and monsters (cherry-pick 2e32f2e7d3)
Previously monster_name and vehicle_name were used, which were obviously used nowhere else.
Renamed them both to m_name so that there's less unnecessary entity fields, and for consistency's sake.
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 (cherry-pick 4192f3a1af)
This makes it more consistent with weapons, buff, some powerups, monsters, and vehicles.
Also fixed issue where REGISTER_NADE had no second parameter, yet one was passed anyway.
otta8634 [Tue, 7 Jan 2025 13:49:34 +0000 (21:49 +0800)]
Rename .wpcolor to .m_color
Weapons didn't simultaneously use .m_color so this shouldn't introduce any regressions.
Removes an unnecessary entity field, and helps make the coloring of things more standardized.
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.