Module:NavboxGenerator/doc

From Deadlock Wiki
Jump to navigation Jump to search

This is the documentation page for Module:NavboxGenerator

Not finished.

Overview[edit source]

Create's a navbox from a json file for input where keys are a title div container, and value "Display" is the display text. Each title div container gets smaller and smaller the further it is in the json.

Parameters[edit source]

Within each level of the json:

  • <key> - Title to display in the div/container/box. Can wrap it in <span style="mystyle">key</span> for styling it.
  • Style - Style for the div
  • Display - Text to display below the div
  • <Any other value> - Recursively calls for the contained layer, with <Any other value> as the new <key>

Examples[edit source]

For understanding the input syntax, it is recommended to view the Simple Example first.

Simple Example[edit source]

The input can be seen at Data:ItemNavboxSample.json

{{#invoke:NavboxGenerator|createNavbox|Data:ItemNavboxSample.json}}

Outputs

Items
Vitality
500
Souls500
Extra Health
Souls500
Extra Regen
Souls500
Extra Stamina
Souls500
ACTIVE
Healing Rite
Souls500
Sprint Boots
1250
Souls1,250
Bullet Armor
Souls1,250
Bullet Lifesteal
Souls1,250
Combat Barrier
Souls1,250
Debuff Reducer
Souls1,250
ACTIVE
Divine Barrier
Souls1,750

Enduring Speed
Souls1,250
Healbane
Souls1,250
Healing Booster
Souls1,750
ACTIVE

Healing Nova
Souls1,250
Reactive Barrier
Souls1,250
ACTIVE
Restorative Locket
Souls1,250
ACTIVE
Return Fire
Souls1,250
Spirit Armor
Souls1,250
Spirit Lifesteal
Weapon
500
Souls500
Rapid Rounds
1250
Souls1,250
Active Reload
Souls1,250
Berserker
Souls1,250
ACTIVE
Fleetfoot
Souls1,250
Kinetic Dash
Souls1,250
Long Range
Souls1,250
Melee Charge
Souls1,250
Mystic Shot
Souls1,250
Slowing Bullets
Souls1,250
Swift Striker

Styled Example[edit source]

The input can be seen at Data:ItemNavbox.json

{{#invoke:NavboxGenerator|createNavbox|Data:ItemNavbox.json}}

Outputs

Items
Vitality
Souls1250
Souls1,250
Bullet Armor
Souls1,250
Bullet Lifesteal
Souls1,250
Combat Barrier
Souls1,250
Debuff Reducer
Souls1,250
ACTIVE
Divine Barrier
Souls1,750

Enduring Speed
Souls1,250
Healbane
Souls1,250
Healing Booster
Souls1,750
ACTIVE

Healing Nova
Souls1,250
Reactive Barrier
Souls1,250
ACTIVE
Restorative Locket
Souls1,250
ACTIVE
Return Fire
Souls1,250
Spirit Armor
Souls1,250
Spirit Lifesteal
Souls500
Souls500
Extra Health
Souls500
Extra Regen
Souls500
Extra Stamina
Souls500
ACTIVE
Healing Rite
Souls500
Sprint Boots
Weapon
Souls1250
Souls1,250
Active Reload
Souls1,250
Berserker
Souls1,250
ACTIVE
Fleetfoot
Souls1,250
Kinetic Dash
Souls1,250
Long Range
Souls1,250
Melee Charge
Souls1,250
Mystic Shot
Souls1,250
Slowing Bullets
Souls1,250
Swift Striker
Souls500
Souls500
Rapid Rounds


Needed changes[edit source]

1. Style/Formatting made prettier 2. A way to have the json iterated in order; for some reason mw.loadJsonData doesn't load the keys in order they appear.


This is not used on any pages currently.