Skip to content

Rewrite repeating verbs to use VerbSystem, incl. overrides #2289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

HeyBanditoz
Copy link
Contributor

@HeyBanditoz HeyBanditoz commented May 26, 2025

  • Repeating macros can now run any verb
  • Repeating behavior closely mimicks BYOND, where the last sent repeated key is the one being repeated
  • Verbs now execute its last override on an atom/client

@boring-cyborg boring-cyborg bot added Client Involves the OpenDream client Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels May 26, 2025
@HeyBanditoz HeyBanditoz force-pushed the repeating-verbs-rework branch from f3ac4e6 to 219d4c6 Compare May 26, 2025 01:09
@HeyBanditoz HeyBanditoz marked this pull request as draft June 1, 2025 03:20
@HeyBanditoz HeyBanditoz force-pushed the repeating-verbs-rework branch 3 times, most recently from d27c141 to 3069aa3 Compare June 5, 2025 06:35
@HeyBanditoz HeyBanditoz changed the title Rewrite repeating verbs to use VerbSystem Rewrite repeating verbs to use VerbSystem, incl. overrides Jun 5, 2025
@HeyBanditoz HeyBanditoz force-pushed the repeating-verbs-rework branch from 3069aa3 to 9b3a084 Compare June 5, 2025 06:41
@HeyBanditoz HeyBanditoz marked this pull request as ready for review June 5, 2025 17:28
Copy link

github-actions bot commented Jun 6, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

* Repeating macros can now run any verb
* Repeating behavior closely mimicks BYOND, where the last sent repeated key is the one being repeated
* Verbs now execute its last override on an atom/client
@HeyBanditoz HeyBanditoz force-pushed the repeating-verbs-rework branch from 9b3a084 to 9d0dea5 Compare June 7, 2025 06:46
This removes the need for the server to find the "newest" verb definition every time
I also moved where `AddVerb()` is called on the compiler to fix a compile order issue
return;
public void RunRepeatingVerbs() {
using (Profiler.BeginZone("Repeating Verbs", color: (uint)Color.OrangeRed.ToArgb())) {
foreach (var repeatingVerb in _repeatingVerbs) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should pull out the contents of OnVerbExecuted() into a shared method and use that instead to execute verbs, to ensure behavior is consistent and doesn't copy code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted not to for this, since OnVerbExecuted handles argument checking, of which verbs wouldn't have any, so we can skip that block entirely.
I also wanted to distinct regular verbs and repeating verbs in the name (1st param) of the DreamThread#Run call.

var client = repeatingVerb.Key;
var verbId = repeatingVerb.Value.Last();

var src = _dreamManager.GetFromClientReference(client, ClientObjectReference.Client);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes the verb is always on the client. It needs to use RegisterRepeatVerbEvent's Src instead of ClientObjectReference.Client.

@HeyBanditoz
Copy link
Contributor Author

Superseded by #2365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client Involves the OpenDream client Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants