OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: krautbernd on November 22, 2018, 10:21:56 pm

Title: [DONE][Suggestion] Override default placement of elements in ufopedia item articles
Post by: krautbernd on November 22, 2018, 10:21:56 pm
This is an extremely minor gripe, but the rectangle in the background image for ufopedia articles (items/weapons) used to display the BIGOB image is 2 pixels wider than the actual BIGOB image. This is fine for vanilla xcom, but some mods (x-com files for example) use it to display NPCs or other items that don't fit into that space especially well. They aren't centered or appear cut off.

While some of this is fixable by modifying the background image (see attached images), this leads to the weight indicator being drawn over the rectangle.

Would it be possible to either define a seperate background image to be used per entry and/or override the default placement of elements in ufopedia entries? Case in point, this probably concerns

_txtWeight = new Text(88, 8, 104, 55);
_image = new Surface(32, 48, 157, 5);
_game->getMod()->getSurface("BACK08.SCR")->blit(_bg);

in ArticleStateItem.cpp

Would it be possible to implement a *.rul based override for these?

(https://abload.de/thumb/screen016oefp4.jpg) (https://abload.de/image.php?img=screen016oefp4.jpg)(https://abload.de/thumb/screen015v7d2h.jpg) (https://abload.de/image.php?img=screen015v7d2h.jpg)(https://abload.de/thumb/screen0173mco7.jpg) (https://abload.de/image.php?img=screen0173mco7.jpg)(https://abload.de/thumb/screen018h3c6q.jpg) (https://abload.de/image.php?img=screen018h3c6q.jpg)
Title: Re: [SUGGESTION] Override default placement of elements in ufopedia articles
Post by: krautbernd on January 02, 2019, 11:41:04 pm
On a related note, would it be possible to scale in-game windows (or the size/type of fonts) according to the number of entries they have? Case in point, the commendations mod adds a new section to the UFOpedia, so the window title now overlaps the frame.

(https://abload.de/thumb/screen0070gdwc.png) (https://abload.de/image.php?img=screen0070gdwc.png)
Title: Re: [SUGGESTION] Override default placement of elements in ufopedia articles
Post by: Meridian on January 02, 2019, 11:49:42 pm
On a related note, would it be possible to scale in-game windows (or the size/type of fonts) according to the number of entries they have?

Yes, but it's not easy.

Case in point, the commendations mod adds a new section to the UFOpedia, so the window title now overlaps the frame.

If you upgrade your OXC or OXCE, both now have scrolling of pedia sections... it won't overlap anymore.
Title: Re: [Suggestion] Override default placement of elements in ufopedia item articles
Post by: Meridian on February 14, 2023, 09:58:24 am
Would it be possible to either define a separate background image to be used per entry and/or override the default placement of elements in ufopedia entries? Case in point, this probably concerns

_txtWeight = new Text(88, 8, 104, 55);
_image = new Surface(32, 48, 157, 5);

The latter, via interfaces.rul.
Todolisted.
Title: Re: [DONE][Suggestion] Override default placement of elements in ufopedia item articles
Post by: Meridian on December 30, 2023, 04:55:23 pm
Done.

Sample ruleset:

Code: [Select]
interfaces:
  - type: articleItem
    elements:
      - id: image
        pos: [100, 140] # default = [157,  5]
      - id: weightText
        pos: [200, 160] # default = [104, 55]

https://github.com/MeridianOXC/OpenXcom/commit/fd8ebf1f745ec4a9e64627f1fac0d6e57b2c2af4