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

Configurable item description, native-looking ilvl/alvl display #46

Merged
merged 12 commits into from May 10, 2020

Conversation

youbetterdont
Copy link

@youbetterdont youbetterdont commented Mar 24, 2020

Original

This feature adds a configurable item description that the user can set through BH.cfg. The syntax is as follows:

ItemDisplay[blah]: %NAME%{my description}

The description field can tell players more about items they pick up due to a notification (e.g., in a default config). It can also give relevant cube recipes, possible runewords, etc. The description is only displayed on the item if "Advanced Item Display" is active.

Here's an example that adds description text to a Titan's Revenge.
image

Because much of the code that controls item name display was reused, many of the same features still work. That is, all keywords like colors, etc. are supported. Even the %NAME% directive still has meaning. For example:
image

The above example shows that %CONTINUE% still applies as before. However, when %NAME% is used in the description field, it uses the last set description, not the item name.

If no %CONTINUE% is used, the behavior is as expected:
image

Here's an example showing that the %ILVL% keyword still works in the description field:
image

This PR also adds support for more native looking item level and affix level display. You can see the item level display above. Similarly, affix level is shown for magic, rare, and crafted quality items. Affix level is only shown if it is different than item level. Additionally, the user must set "Advanced Item Display" and "Show iLvl" for these features to be active. Here is the affix level display on some rare gloves:
image

Update 3/25

  • Description rule list is now separate from the main one. This allows for setting descriptions separate from item names, e.g.
ItemDisplay[blah]: %NAME%
ItemDisplay[blah]: {description}
  • Tweak item rules slightly so that more conditions are required to create an ignore rule. Before, an ignore rule would be created in the following situations.
ItemDisplay[blah]: %MAP%
ItemDisplay[blah]: %NAME%

The above previously resulted in a blank item name. The item was not blocked because of the `%MAP% command, but still this is probably not desirable behavior. After this fix, the item name will no longer be blank.

ItemDisplay[blah]: %CONTINUE%
ItemDisplay[blah]: %NAME%

The above would also result in a blank item name. Additionally, the item will be blocked in this case. After the fix, the item name is preserved, and no ignore rule is created. This is kind of a corner case, but I think this is the more desirable behavior.

  • After this fix, an ignore rule is only created when the item name and description are not blank, there is no map action, and there is no %CONTINUE% statement. Essentially only blank lines can create ignore rules now.
  • Blank item names should no longer be generated as a result of the above changes. To warn users that an item they see in game will be blocked by the packet filter, a [blocked] tag is added to the item. For example:
    image
    The blocked tag is only generated when the item has an ignore rule and not a map rule. This change also fixes some other undesirable behavior.
ItemDisplay[blah]: %NAME%%MAP%%CONTINUE%
ItemDisplay[blah]: 

Previously, the above would result in a blank item name, but the item would still spawn in game and ping. After the fix, the item name will no longer be blank. The item will ping as before.

… rules into a separate list. Instead of showing blank item names, flag items that would normally be blocked at the packet level with [blocked]. Tweak rule logic a bit to prevent map and description only commands from setting the name blank, thus creating an ignore rule. The new behavior will only create ignore rules when there is no name, map action, descrption, or continue statement used for a specific ItemDisplay rule.
@youbetterdont
Copy link
Author

Included in #50

@youbetterdont youbetterdont reopened this Apr 14, 2020
@planqi planqi merged commit 012be4f into planqi:master May 10, 2020
@youbetterdont youbetterdont deleted the feature/ilvl-alvl-properties branch August 22, 2020 13:21
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.

None yet

2 participants