Add support for extended tip image #21
Open
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.
Adds support for additional keywords in weapons' TipImage.
e.g
New supported keywords:
(This PR was made very quickly, so this is not a complete list of keywords that the vanilla game don't support. Feel free to mention other missing keywords)
To have multiple features with the same key, the keyword can be suffixed with numbers.
TipImage Callbacks
This feature allows the optional definiton of a
TipImageCallbackstable for a weapon, which associates specific elements in the weapon'sTipImagetable to callback functions inTipImageCallbacks.Example:
This example shows a
TipImageCallbackstable with two custom callbacks that can be referenced by the weapon'sTipImage; either by the same name or the name with a numbered suffix.Example Weapon:
In this example, the weapon "MySkill" has a
TipImagetable with aStuctureSmallatPoint(2,1). When the tipimage is displayed in-game, theTipImageCallbacks.StuctureSmallfunction will be called for theTipImage.StuctureSmallelement, causing a building with 2/2 health to be created atPoint(1,3)on the game board.It also has a pair of
StructureDamagedentries. When the tipimage is displayed in-game, theTipImageCallbacks.BuildingDamagedfunction will be called for bothTipImage.StructureDamagedandTipImage.StructureDamaged2, causing a building with 1/2 health to be created atPoint(2,2)andPoint(2,3)on the game board.