User blog:Taldin/Tinker's Blog Part 2: Diving into Code

In Part 1, I brought my local codebase up to date. Now it's time to start doing some actual code work.

I've taken on the challenge of adding party health as an easier access function, because otherwise Healers have to click on each individual Party member directly. After some debate on how to do this, the simplest way seems to be to put it next to their name on the Party page.



My technique for finding where to make changes is to us the Github Search bar to look for useful code strings, because the Habitica programmers named variables useful things most of the time. It's a bit brute force of a method, but I eventually got where I wanted to go. Before I do ANY changes, however, it's a best practice to make a new branch, instead of working directly on habitrpg-develop, because that's the main branch. It may take awhile for any changes I make to get accepted, so making a branch keeps it separate until it can be merged in.
 * 1) Searched on "Members"  -- too ambiguous.
 * 2) Searched on "Party" -- also too ambiguous.
 * 3) Searched on "Invite Friends" -- and got a bunch of translation pages, but also the label 'inviteFriends'.
 * 4) Searched on "inviteFriends" and landed in habitrpg / website / views / options / social / group.jade.



I opened up the file in my local installation and found the lines that print out the party listing. It's here:



What I want is to get a party member's health; I wound up using the Swagger UI to poke through my character information for the 'user.stats.hp' item. Since we're loading that into a 'member' list, it's an educated guess that what I want is 'member.stats.hp'. Recoding gives me this:



Next, I fill out the Commit box (subject and description) and commit to save it to my local branch.



Then I click the Pull Request button on the upper right, and now I have a proposed update to Habitica waiting for approval.