Effects follow offset, add ini option to disable offset for effect#663
Merged
Effects follow offset, add ini option to disable offset for effect#663
Conversation
This is pretty hacky, but the offset data is necessary to move the effect layer in relation to the character.
Crystalwarrior
suggested changes
Feb 19, 2022
Contributor
Crystalwarrior
left a comment
There was a problem hiding this comment.
Need to make ignore_offsets work lol
+ Some comments
oldmud0
approved these changes
Feb 21, 2022
| ui_vp_player_char->move(ui_viewport->width() * self_offset / 100, ui_viewport->height() * self_offset_v / 100); | ||
|
|
||
| //If an effect is ignoring the users offset, we force it to the default position of the viewport. | ||
| if (ao_app->get_effect_property(play_effect[0], current_char, "ignore_offset") == "true") { |
Member
There was a problem hiding this comment.
Very good, thank you. Let's document this.
EDIT: Let's pretend I didn't see that global variable there
| switch(m_chatmessage[DESK_MOD].toInt()) { | ||
| case 4: | ||
| set_self_offset(m_chatmessage[SELF_OFFSET]); | ||
| set_self_offset(m_chatmessage[SELF_OFFSET], QString("||")); |
Member
There was a problem hiding this comment.
QString("||") is not necessary. You may either use "||" or QStringLiteral("||") (some also prefer QLatin1String for efficiency, but the performance benefit is negligible)
| } | ||
|
|
||
| void Courtroom::set_self_offset(QString p_list) { | ||
| void Courtroom::set_self_offset(QString p_list, QString p_effect) { |
Member
There was a problem hiding this comment.
I am not sure why this method takes in a QString when it should really take in a QStringList.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is pretty hacky and ugly, but the offset data is necessary to move the effect layer in relation to the character.
closes #639