Skip to content

Usage of compiletime structures in TooltipGenerator resulted in unused data in war3map.j #926

Open
@rolandc85

Description

@rolandc85

@compiletime function createFeedback()
let tgen = new LotsAbilityTooltipGenerator("Burns an opponent's mana on each attack, dealing mana burned as damage to the target.", Targettype.PASSIVE)
new AbilityDefinitionFeedback(FEEDBACK_ABIL_ID)
..registerTooltipGenerator(tgen)
..tooltipStartListen()
..preset("Feedback", Hotkey.E)
..addTooltipProperty("Mana Burned per Hit", (int lvl) -> (MANA_DRAINED_PER_LVL * lvl).toString())
..tooltipStopListen() //endoftooltip

In this case, the "Mana Burned per Hit" is used for tooltip generation. After which, during compile time, it is stored in a

private var propMap = new IterableMap<string, StringLevelClosure>

The tooltip generator was like the one in this thread

https://www.hiveworkshop.com/threads/wurst-ability-tooltip-generator.253389/

I notice that in the war3map.j

The string was initialised like this.

call SaveStr(cS,2,523856396,"Mana Burned per Hit")

However, this string is not required at all. It's only used for generating the tooltip for the ability. Will the -opt flag be able check if 523856396 is not accessed, then exclude it from the compiled script.

Just to add, I have also made attempts to destroy the propMap after using it but to no avail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions