User blog:Akhime/Updating and Customizing Touken Ranbu Helper

I was playing around with the helper's code because I was bored and my fingers where aching to do some coding, so I thought I'd make some sort of tutorial to help anyone who wants to do the same thing. I might expand this when I explore the coding a bit.

Used Touken Ranbu Helper ver. 0.2.5 (Kiwame Update)

Introduction
You might have stumbled upon this because:
 * You want to update your helper without reinstalling and losing your progress
 * You don't know how to code basic JavaScript/CSS.
 * You might know basic JavaScript/CSS, you just don't know what to do.
 * You're just here to read... just for kicks idk.

Basically this is just a tutorial on how to tweak your Touken Ranbu Helper to your preferences such as:
 * Updating the helper for every new sword added.
 * Adding new swords to drop notifications.
 * Customizing the look on your helper interface.

What you need:
 * A text editing software like Notepad++ or anything similar.
 * Notepad works just as fine as well, but I will mention line numbers in codes which might be hard to find if you're just using Notepad.
 * A photo editing software like Photoshop, GIMP, Paint.Net or anything similar (should support transparency).

''NOTE: I cannot be held responsible for any accident/damage that occurs in the event that the instructions have been executed incorrectly. I highly recommend making a copy of the plugin folder before proceeding to avoid any incidents.''

Manually Updating Sword Roster
Newer versions of TKRB Helper will work with newly added swords. However, the book number will only be displayed and the crest file will not display properly.

Blank: "[book number]": { "name": "[name]", "id": [book number], "rarity": [1, 2, 3, 4, 5], "type": [sword type], "group": [sword school], "equip": [number of troop slots], "area": [attack range], "upgrade": [toku rank up level], "kiwame": 0 }, Sample (DO NOT COPY THIS): "34": {     "name": "Atsushi [K]", "id": 34, "rarity": 2, "type": 7, "group": 9, "equip": 2, "area": 1, "upgrade": 20, "kiwame": 1 },
 * 1) Open up "define.js" located in "devtools > panel > app" into your text editing software.
 * 2) Inside "exports.tohken.define.tohkens", copy the blank field below and paste according to book number. Define the attributes (you can go to the sword's character page to find out the info you need).
 * 3) Save file.
 * 4) To get the crests to work, go to Sword Crests and find the crest of the sword you want (if the crest file is not there yet, you can always go back and check another time). Resize the image file to 100 x 100 px (you may need to crop the crests a bit to make the width and height the same before resizing). The file name of the crest should be the sword's book number. Paste them into the "assets > sword" folder.
 * 5) *For Kiwame swords and swords with multiple Toku forms, you can copy the existing crest and rename the file.
 * 6) Load TKRB Helper to see if it works. If you have it open before editing, close the helper and refresh.

Attributes are found in lines 8-37 as "exports.tohken.define.xxxx" where xxxx is the name of the attribute itself.

Some attributes are pretty self-explanatory but here's an overview on them anyway:


 * name - Sword name.
 * To avoid overlapping text, it is recommended to use the sword's 'first' name (e.g. Ichigo Hitofuri>Ichigo). To differentiate Kiwame swords from their regular counterparts, it's best to add [K] at the end of the name (e.g. Gokotai [K]).
 * id - Sword book number
 * rarity - Petal rarity
 * type - Sword type: Oodachi (1), Tachi (2), Naginata (3), Wakizashi (4), Uchigatana (5), Yari (6), Tantou (7)
 * group - Sword/smith school.
 * equip - Number of troop slots a sword can hold.
 * area - Attack range (short, wide, horizontal, vertical)
 * upgrade - Toku rank-up level
 * For Kiwame, you can leave that part the same as the regular one.
 * kiwame - If the specified sword is a Kiwame upgrade of a regular sword. 0 = no, 1 = yes

Updating Drop Notifications
Current versions of TKRB Helper only have drop notifications on older swords. Newer swords and possible event/special map drops are not often detected by the helper because they are not defined. For those who like hoarding a specific sword, you can also use the same method if you want... just throwing it out there :^) Optional:
 * 1) Open parse.js located in devtools > panel > app into your text editor
 * 2) Go to lines 256 and 257. You'll notice a set named "asia" and "europe". Asia is defined as the Rare swords, Europe as the Super Rare swords.
 * 3) To add a sword into the drop list, add their sword book number into the sets (make sure they're in numerical order). For Rare swords, add them to "asia". For Super Rare, add to "asia" and "europe".
 * 4) Save file and load TKRB Helper to see if it works. If you have it open before editing, close the helper and refresh.
 * 1) Open index.html located in devtools > panel in the text editor.
 * 2) Go to line 203 and place the names of the super rare swords you added.
 * 3) Save and open the html file on your browser (no need to load helper), if you had it open before saving, refresh the page.

Customizing Helper Interface (Optional)
TBA (I haven't seen the helper's CSS yet orz)

Crests: You can change the crests into something else. Just make sure the dimensions are 100 x 100 px and the file name is the sword number.