Character Info Toolbox

Ummm... no. Not the problem. The entire mini-table is occupying a single cell (it is bracketed in with <td>...</td>). I was using the empty cell in the middle at width:100% to push the meat and adventure values to either side. See what I mean by kludgy?
 
Maybe td align=left on the left and td align=right on the right, so that the text on the left cell bounds the left wall, and the right cell bounds the right wall?
 
Here is what I came up with to get rid of the empty <td> and <table>.

Code:
	result.append('<tr>');
	result.append('<td title="Meat" style="text-align:left" class="resource">' + formatInt(my_meat()) + ' <img src="/images/itemimages/meat.gif"></td>');
	result.append('<td title="Adventures remaining" style="text-align:right" class="resource">' + my_adventures() + ' <img src="/images/itemimages/hourglass.gif"></td>');

The css block with
PHP:
table.chit_brick td {
	border: 0px;
	text-align:center;
	vertical-align:middle;
}
was forcing them to be centered (and would override align=left/right), so now that is overridden by style=text-align. In the css file, I changed
PHP:
table.resource img
to
PHP:
td.resource img
to account for the removal of the extraneous table.
 
Nice try. I'll tell you at least one thing I don't like about that solution. By putting adventures into the same column as level (when you have a lot of adventures) you are stretching that column wider than I like, crowding the middle column. That's why I put meat and adventures into the same cell, stretched across those two columns.

Still, you did just teach me something valuable about priorities and how to work with them.
 
I must have changed something in my version that makes the issue not apparent. Probably the part where I replaced the substats to next level progress bar with "X needed" text.
 
I'm having a problem with the newest version. The stats window gets even more messed up when the last location has a long name, see the attached screenshot. u1.png
 
I'm trying, but failing to duplicate that bug. I checked it in Firefox, IE and Opera. Perhaps that is because my current version is different. I'm attaching my current version of charpane.ash and chit.css so please put those in your relay directory and then tell me if you are still getting the bug. If you are, then what browser are you using? Is that chrome? (I haven't bothered to install chrome.)
 
Last edited:
Is there a better way to space out meat and remaining adventures to the far ends of the row? The method I found works, but I feel it is a little kludgy to stick an empty cell between meat and adventures.
I can suggest a different way, maybe you like it more:
Code:
	result.append('<td colspan="2"><div class="resource">');
	result.append('<div title="Meat" style="float:left"><span>' + formatInt(my_meat()) + '</span><img src="/images/itemimages/meat.gif"></div>');
	result.append('<div title="Adventures remaining" style="float:right"><span>' + my_adventures() + '</span><img src="/images/itemimages/hourglass.gif"></div>');
	result.append('</div><div style="clear:both"></div></td>');
Code:
.resource {
	color:darkred;
	font-weight:bold;
	background-color:#F8F8F8;
	padding: 0px 2px;
}
.resource div span, .resource div img {
	vertical-align: middle;
}
.resource div img {
	max-width:12px;
	max-height:12px;
	padding-left:3px;
}

Another thing I noticed, was an error in calling a non-existent javascript function updateSafetyText(). It's probably KoLmafia's problem it can be "fixed" by using the following line:
Code:
result = result.replace_string('<body onload="updateSafetyText();"', '\n<script type="text/javascript" src="chit.js"></script>\n<body');
 
Another thing I noticed, was an error in calling a non-existent javascript function updateSafetyText(). It's probably KoLmafia's problem it can be "fixed" by using the following line:
Code:
result = result.replace_string('<body onload="updateSafetyText();"', '\n<script type="text/javascript" src="chit.js"></script>\n<body');

Something is seriously strange there. Vanilla KoL (without mafia) does not have that function! It only appears in KoLmafia. Maybe that is actually a Mafia bug?! If so it should be reported.

Hmmm... CharPaneDecorator.java contains the line StringUtilities.singleStringReplace( buffer, "<body", "<body onload=\"updateSafetyText();\"" );

Can you tell me what sort of error calling a non-existent javascript function produces?

Your other suggestion looks real nice. I might use it.
 
Last edited:
It's not a serious error, Chrome just says "Uncaught ReferenceError: updateSafetyText is not defined" in the console. Shouldn't really affect the rest of the frame.

You're right, updateSafetyText() is only used in CharPaneDecorator.java. I could've been less lazy and checked :p. I think it's just an oversight and basics.js can be included in that frame to remedy the missing function. Maybe one of the svn commiters can add it in?
 
I'm trying, but failing to duplicate that bug. I checked it in Firefox, IE and Opera. Perhaps that is because my current version is different. I'm attaching my current version of charpane.ash and chit.css so please put those in your relay directory and then tell me if you are still getting the bug. If you are, then what browser are you using? Is that chrome? (I haven't bothered to install chrome.)

That didn't do anything. It is chrome but I get the same bug in IE as well.
 
You're right, updateSafetyText() is only used in CharPaneDecorator.java. I could've been less lazy and checked :p. I think it's just an oversight and basics.js can be included in that frame to remedy the missing function. Maybe one of the svn commiters can add it in?

You lost me. Sorry. What is it that you are suggesting?


That didn't do anything. It is chrome but I get the same bug in IE as well.

I don't get that bug in IE 8. I also don't get it with Firefox 11.0 or Opera 11.62. Maybe someone else will have a clue why that is happening, but I cannot even replicate it on Windows XP and I don't know css to take a good guess without experimentation.
 
Last edited:
@Bale Sorry, I just meant that the error comes from KoLmafia itself, and that one of the developers can fix it by adding a reference to the "basic.js" file they have in the relay folder.

@rlbond86 Could you out type zlib chit into the CLI and post the output? Maybe I can try reproduce the error.
 
eegee, I think I really like the way you fixed the resource display. I've got two questions about how it actually works.

First, what is the purpose of <div style="clear:both"></div>?

Second, why isn't vertical-align: middle; included in .resource instead of .resource div span and img?

Thanks for the help. Please continue to make any other suggestions you like.


@Bale Sorry, I just meant that the error comes from KoLmafia itself, and that one of the developers can fix it by adding a reference to the "basic.js" file they have in the relay folder.

Thanks. I made a bug report HERE. Add any additional commentary there. If I missed mentioning something relevant please post it there.
 
Thanks for posting the bug report :D

..what is the purpose of <div style="clear:both"></div>?

Second, why isn't vertical-align: middle; included in .resource instead of .resource div span and img?..
For style="clear:both" : is a good practice to place that in an empty div or span after using a combination of floats (or clear:left / clear:right respectively) so that the subsequent html elements are not accidentally affected.

For vertical-align: middle : it involved a bit of hacking and I haven't yet verified why it has to be applied to each child element, instead of just the parent div. I suspect that it has something to do with the flexible functionality of vertical-align with block vs. inline elements.
 
@rlbond86 Could you out type zlib chit into the CLI and post the output? Maybe I can try reproduce the error.

Code:
> zlib chit

Running ZLib version: r35 (current)
Copy/paste/modify/enter any of the following lines in the CLI to edit settings:

zlib chit.character.avatar = true
zlib chit.character.title = true
zlib chit.checkversion = true
zlib chit.effects.classicons = none
zlib chit.effects.layout = intrinsics,songs,buffs
zlib chit.effects.showicons = true
zlib chit.effects.usermap = false
zlib chit.familiar.hats = spangly sombrero,sugar chapeau
zlib chit.familiar.pants = spangly mariachi pants,double-ice britches,BRICKO pants,pin-stripe slacks,Studded leather boxer shorts,Monster pants,Sugar shorts
zlib chit.familiar.protect = false
zlib chit.familiar.weapons = time sword
zlib chit.floor.layout = update
zlib chit.helpers.dancecard = true
zlib chit.helpers.semirare = false
zlib chit.helpers.wormwood = stats,reward
zlib chit.quests.hide = false
zlib chit.roof.layout = character,stats,familiar,modifiers
zlib chit.stats.layout = hp,mp,axel|muscle,myst,moxie|stomach,liver,spleen|mcd|trail
zlib chit.stats.showbars = true
zlib chit.toolbar.layout = elements,update,quests,trail,helpers
zlib chit.toolbar.moods = true
zlib chit.walls.layout = effects
(If no values were shown, no settings or values matched your input text. Type "zlib vars" to see all.)
 
Tell me why you think that is wrong and I'll try to help. Personally I have it in chit.toolbar.layout so it doesn't look quite like that for me. Your picture is why too cropped for me to figure out where you put it so I'm really lacking helpful details.

I suppose the thing for you to note is that this script is very configurable as to what your charpane can look like.
 
I'm having a problem with the newest version. The stats window gets even more messed up when the last location has a long name, see the attached screenshot.
Ok, I've looked at your settings and it seems that Character Info Toolbox might not have intended for the last adventure to be added to the stats pane. I could be mistaken though.

I have a suggestion for two of your settings that will prevent the stats window from being distorted. Type the following into your CLI and let me know what you think:
Code:
zlib chit.roof.layout = character,stats,trail,familiar,modifiers
zlib chit.stats.layout = hp,mp,axel|muscle,myst,moxie|stomach,liver,spleen|mcd
 
Back
Top