Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Quick and dirty feedback buttons hack

AncientCowboyAncientCowboy Member Posts: 199
edited July 2016 in UI Modding

I've re-packaged this mod as a WeiDU UI.MENU patch (not replacement). There's no difference in the behavior other than the tooltip text has been packaged in a module named en_FeedH.lua so non-English versions (appropriately named with the proper language prefix) can be made.

If you're familiar with WeiDU installations, then installing this will be trivial. If not, by following the step-by-steps in the document named 'Installation.txt' found in the 'FeedbackHack' directory you should have no problems. You will need to have a copy of UI.MENU in your game installation override directory. See Installation.txt for details.

I'm 'spoiler-hiding' the remainder of this message as most of it is no longer relevant. Enjoy!

I miss the buttons that allow me to change the height of the feedback messages box. For the way I play the game, the PgUp/PgDown and/or dragging the window weren't convenient.

So, I decided to create a couple of buttons to do the job. I didn't try to duplicate the 1.3 model, I'm not an artist, and I suspect the good folks at Beamdog are going to provide a solution in the near future. So, this is something of a hack - it works, the buttons look okay, but it isn't pretty code. On the chance that someone else might want to do the same thing, I decided to post it.

The code puts two buttons side-by-side immediately to the right of the Action Bar; one button labeled "+" and the other "-". If you left-click the "+" button, the messages box height expands by 20 units or about 1 line. Same as the PgUp key. If you right-click it, the box expands by 200 units or about 10 lines. The "-" button shrinks the box height by the corresponding amounts. Minimum and maximum are automatically enforced by the engine code.

To use the following code, open your UI.menu file and look for a menu named "WORLD_ACTIONBAR". Should be somewhere around line 10180 unless you've done a lot of customization. After some preliminary code, it begins defining a series of buttons. First, the Loot Bar button, and then 12 buttons tagged "actionBar 0" through "actionBar 11". It is after this last button definition but before the closing brace for the menu where we'll insert the following code:


-- New buttons
	button
	{
		area 742 1 43 40
		bam GUIOSW
		sequence 0
		frame 0
		tooltip lua '"Expand Messages"'
		action "dragMessagesY(-20)"
		actionAlt "dragMessagesY(-200)"
	}
	button
	{
		area 783 1 43 40
		bam GUIOSW
		sequence 1
		frame 0
		tooltip lua "'Shrink Messages'"
		action "dragMessagesY(20)"
		actionAlt "dragMessagesY(200)"
	}

A couple of items are worth mentioning. First, the tooltip lines are correct - the strings either begin with an apostrophe-quote and end with a quote-apostrophe sequence or they are delimited by quote-apos/apos-quote sequences. We're embedding the syntax of a Lua string literal within a Lua string literal. It works fine but I wouldn't want to give this kind of hack to a localization team :).

The other item has to do with the x,y,width,height area parameters. A bit of arithmetic will lead you to suspect that I can't add. Actually, the images being used (from GUIOSW.bam) are 45x42 pixel images but they have 2 pixels of transparency (alpha channel if you prefer) around each side of them. So the numbers you see are the result of a little arithmetic and a good bit more squinting in both scaled and un-scaled UI modes to make everything line up.

Enjoy, and don't hesitate to improve, modify, or ignore this. It's time for me to get back to murdering Hobgoblins.

Post edited by AncientCowboy on
mf2112modestvoltaKerozevoklolienGrammarsalad

Comments

  • AncientCowboyAncientCowboy Member Posts: 199
    I've verified this still works with BGEE/SOD 2.1. The menu definition begins around line 10232.

    lolienmf2112
  • AncientCowboyAncientCowboy Member Posts: 199
    I've verified that this continues to work correctly on BGEE/SOD 2.2. Enjoy!

  • AncientCowboyAncientCowboy Member Posts: 199

    Version 2.1 of EEUITweaks features a new implementation of the Feedback Message Box Buttons Hack. It's fully integrated visually with the Action Bar; occupies much less screen space, and the buttons are stacked vertically. The behavior is the same - the top button expands the Feedback Message Box and the bottom button shrinks it. Below is a picture of the buttons (extreme right side of the Action Bar) alongside the re-implemented Permanent Thieving Button.


    Enjoy!

Sign In or Register to comment.