Hero Lab 4e

Herolab D&D 4e Development => Herolab 4e Development => Topic started by: Fox Lee on December 14, 2015, 12:41:24 AM

Title: Skinning - Absolute references to text colours
Post by: Fox Lee on December 14, 2015, 12:41:24 AM
Soo, I've been trying to skin HeroLab 4e for ages, since I hate reading light text on dark background (I have a squished cornea in one eye, so light-on-dark text smears across the screen and gives me headaches). More accurately, I got MOST of the way through re-skinning 4e a couple of years ago, but there were things I could never get working and eventually I put it in a box and got on with things that seemed attainable.

Recently, I got interested in this again, and I've gotten further this time in that I think I've worked out the source of the quirks.

Here's a look at the WIP skin - it's a mix of icons/layout elements grabbed from the Pathfinder skin, and colour tweaked version of the default 4e stuff.
(http://hl4e.cryptoknight.org/index.php?action=dlattach;topic=314.0;attach=35;image)

So, with graphical elements replaced and styles_ui.aug updated to reflect suitable text colours, it looks quite passable. However, there are certain elements that insist on using the old style. The problem areas are:
The first time around I couldn't work this out, because the colours for all these types of text are defined in the style file. I couldn't see why they weren't working.

This time around, I looked a little closer (read: scanned all text-based HL files for the hex values of the offending colours) and it seems to make sense: the .dat files are setting text colours absolutely, rather than obeying styles. Here's a section of code from the Rituals tab:

      <additem><![CDATA[
        ~set the color based on whether the proper number of slots are allocated
        if (hero.tagis[Hero.Monster] = 0) then
          if (field[resLeft].value = 0) then
            @text = "{text a0a0a0}"
          elseif (field[resLeft].value < 0) then
            @text = "{text ff0000}"
            endif
          endif
        @text &= "Add New Ritual"
        ]]></additem>
      </table_dynamic>
    </portal>


Sure looks like the hex values are hard-coded right in there. right Not good design philosophy, and - I suspect - quite possibly the main reason that Lone Wolf always waved off skinning as being too hard to implement. It's even weirder than that, though, because the colour I really want to get rid of is the yellow (ffff00), and that isn't referenced here despite the fact that it's also a conditional effect on this same text. The only reference I can find to that value is in data.hlz - the comp[iled file, right? - so I figure it must be deeper in the system even than that.

For now, I'm not trying to make any further adjustments to files, since I'm getting into "clashes with future updates" territory. But if somebody who's more familiar with the code could help me out by adjusting these things to use styles, not hard values, that would be superb. I'd love to be able to have a finished skin that I could share, cus I know I'm not the only one who has problems with the default ^^;