Skip to content
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

Change 4 more inputs to support variables in Variable action #1231

Merged
merged 3 commits into from
Oct 12, 2024

Conversation

Destroy666x
Copy link
Contributor

@Destroy666x Destroy666x commented Oct 8, 2024

I mainly needed the substring regex index one to set random number generated earlier there, but why not all 4

Also renamed a setter to indeed be named like a setter, as for some reason it randoml wasn't as the only thing

@Destroy666x Destroy666x force-pushed the MoreVarInputsInVarAction branch from 64efbb9 to c5ef9c1 Compare October 8, 2024 23:53
_segmentIdx->SetValue(_entryData->GetSegmentIndexValue() + 1);
_segmentIdx->SetMacro(_entryData->GetMacro());
_segmentIdx->SetType(
_entryData->_type ==
MacroActionVariable::Type::SET_CONDITION_VALUE
? MacroSegmentSelection::Type::CONDITION
: MacroSegmentSelection::Type::ACTION);
_subStringStart->setValue(_entryData->_subStringStart + 1);
_subStringSize->setValue(_entryData->_subStringSize);
_subStringStart->SetFixedValue(_entryData->_subStringStart + 1);
Copy link
Owner

Choose a reason for hiding this comment

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

SetValue() needs to be used here if you want the variable selection to respected as well.
Otherwise the selection will always switch back to the non-variable selection.

Copy link
Contributor Author

@Destroy666x Destroy666x Oct 9, 2024

Choose a reason for hiding this comment

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

Ah. There were some issues with implicit conversion here, but I'll recheck. I guess the whole index logic needs to switch to, well, be in proper function logic then? But that will break compatibility, no?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, correct.
To maintain forwards compatibility the settings need to be converted to the new format in the Load() function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know why it was done so weirdly in the 1st place, but should be fine now

@Destroy666x Destroy666x force-pushed the MoreVarInputsInVarAction branch from c5ef9c1 to 91c4c98 Compare October 9, 2024 11:55
@@ -105,16 +105,20 @@ MacroActionVariable::~MacroActionVariable()
void MacroActionVariable::HandleIndexSubString(Variable *var)
Copy link
Owner

Choose a reason for hiding this comment

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

I think there might still be some issues with your proposed changes.
This example action will not behave as it did previously:

Previously the variable would remain unchanged.
Now the first character of the current value is removed.

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 decreased wrong var by accident, should be fine now

@Destroy666x Destroy666x force-pushed the MoreVarInputsInVarAction branch from 91c4c98 to 6dba8be Compare October 10, 2024 18:28
@WarmUpTill WarmUpTill force-pushed the MoreVarInputsInVarAction branch from 6dba8be to e24c171 Compare October 11, 2024 17:30
@WarmUpTill WarmUpTill merged commit dfaa704 into WarmUpTill:master Oct 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants