Animal portraits are not displayed in the unit frame

Summary: When selecting a wild animal, such as rabbit or fox, the animal’s portrait is not displayed in the unit frame.

Steps to reproduce:

  1. Find an animal in the wild
  2. Click on the animal
  3. Observe the unit frame in bottom left corner of screen

Expected Results:
The animal’s portrait to be shown along with its name and description.

Actual Results:
Only the name and description of the animal are shown.

Notes:
It looks like the problem is located in the function _hasPortrait() in the file Stonehearth\mods\stonehearth\ui\game\unit_frame\unit_frame.js

There is no code path which is designed to return true for wild animals:

   _hasPortrait: function() {
      if (this.get('model.stonehearth:job')) {
         return true;
      }
      //Parties have icons too
      if (this.get('model.stonehearth:party')) {
         return true;
      }
      var isPet = this.get('model.stonehearth:pet');

      if (isPet && isPet.is_pet) {
         return true;
      }
      return false;
   }

I hacked the above JS a bit and could get a wild rabbit to show a portrait ^.^

Attachments:

Version Number and Mods in use:
Alpha 20, release-693

System Information:

2 Likes

Radiant needs to get rabbit portraits in the game immediately :stuck_out_tongue:

It’s just a little thing, and they may actually not want it for a reason, but I for one would like to see unit frame portraits of all the widdle aminals :heart_eyes:.