Thinned Station Columns Mod

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
ChemODun
Posts: 591
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Thinned Station Columns Mod

Post by ChemODun »

I hope you are achieved what I expect.

And now we need only one thing to make an icons and number visible.

We had

Code: Select all

local L = {
    egoCreatePropertyRow = nil,
}
we had to expand it to

Code: Select all

local L = {
  egoCreateObjectList = nil,
  egoCreatePropertyOwned = nil,
  egoCreatePropertyRow = nil,
}
We had

Code: Select all

local function init()

    menu = Lib.Get_Egosoft_Menu("MapMenu")

    if not menu then
        DebugError("Thin columns - Could not find MapMenu, aborting UI modifications.")
        return
    end

    -- Functions that creates the Property Owned table row
    L.egoCreatePropertyRow = menu.createPropertyRow
    menu.createPropertyRow = L.createPropertyRow

    DebugError("Thin columns - MapMenu modifications applied.")
end
and it should be expanded to

Code: Select all

local function init()

    menu = Lib.Get_Egosoft_Menu("MapMenu")

    if not menu then
        DebugError("Thin columns - Could not find MapMenu, aborting UI modifications.")
        return
    end

    -- Functions that creates the Object List table row
    L.egoCreateObjectList = menu.createObjectList
    menu.createObjectList = L.createObjectList
    -- Functions that creates the Property Owned table
    L.egoCreatePropertyOwned = menu.createPropertyOwned
    menu.createPropertyOwned = L.createPropertyOwned
    -- Functions that creates the Property Owned table row
    L.egoCreatePropertyRow = menu.createPropertyRow
    menu.createPropertyRow = L.createPropertyRow

    DebugError("Thin columns - MapMenu modifications applied.")
end
and respectively we need to copy from map_menu.lua two functions: menu.createObjectList and menu.createPropertyOwned.

Put in our file, and replace inside our file menu with L

I.e. to have

Code: Select all

--
-- place for code from map_menu.lua - begin
--

local config = {
...
}

function L.createObjectList(frame, instance)
...
end

function L.createPropertyOwned(frame, instance)
...
end

function L.createPropertyRow(instance, ftable, component, iteration, commanderlocation, showmodules, hidesubordinates, numdisplayed, sorter)
...
end

--
-- place for code from map_menu.lua - end
--
and last one - to find in both new function a code

Code: Select all

        for i = 1, maxicons do
		ftable:setColWidth(5 + i - 1, infoTableData.shipIconWidth, false)
	end
and update it to
and last one - to find in both new function a code

Code: Select all

        for i = 1, maxicons do
		ftable:setColWidth(5 + i - 1, infoTableData.shipIconWidth * 2, false)
	end
if everything done right - you will gate a view similar to my last screenshot.
Multiply entropy by absolute zero

Freedom in space
RondoX4
Posts: 39
Joined: Thu, 30. Jun 22, 02:31
x4

Re: Thinned Station Columns Mod

Post by RondoX4 »

As for the question of what I see when I mouse over on the right:
Before I start mousing over I see the hull integrity and shield bars.
When I start moving the mouse from left to right a little display box
will pop up showing a ship icon and an integer. Then as I continue slowly left
the box disappears and then another display box appears displaying a ship icon and integer and so on.
I would like to use a url to display screen shots also.
So how do you do it?
Is there help on egosoft forums to show me?
I have looked at your code changes and they look understandable. Thanks
I am going to make a back up copy of the mod and go for it and "unlock" that info.
RondoX4
Posts: 39
Joined: Thu, 30. Jun 22, 02:31
x4

Re: Thinned Station Columns Mod

Post by RondoX4 »

Made the changes per your instructions.
Property list did display.
The Stations displayed without mouse overing.
with the ship icons and quantities displaying perfectly.
Errormessage: [string "extensions/thin_columns/ui/thin_columns.lua"]:757: attempt to index global 'ftable' (a nil value)
which the code
ftable:setColWidth(5 + i - 1, infoTableData.shipIconWidth * 2, false)
in function L.createObjectList(frame, instance)
I opened and closed the property list several times and there was only one error.
The unassigned property was dramatically effected
Ship names were truncated to 27 characters.
On the right side whenever there was a ship status icon like docking, combat or patrol
two blank spaces were added per icon.
I am going to look at the section that displays unassigned ships
User avatar
ChemODun
Posts: 591
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Thinned Station Columns Mod

Post by ChemODun »

So, result is more or less achieved.
So welcome on board and good luck :-)
Multiply entropy by absolute zero

Freedom in space
User avatar
ChemODun
Posts: 591
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Thinned Station Columns Mod

Post by ChemODun »

One more recommendation.

As mostly this part is not significantly changed during version upgrades, I can recommend look inside the JAMUI code, and identify the original approach for the thin rows ...
It looks useful
Multiply entropy by absolute zero

Freedom in space
RondoX4
Posts: 39
Joined: Thu, 30. Jun 22, 02:31
x4

Re: Thinned Station Columns Mod

Post by RondoX4 »

The modification to included the ship stats in station text are perfect
However, it has impacted the unassigned ships list in a negative way.
When I was a AS400 programmer (a long time ago) it frequently occurred that
a change in one place caused a major break in another part of the program.
I have examined JAMUI
In JAMUI createObjectList is:
for i = 1, maxicons do
-- objecttable:setColWidthMinPercent(5 + i - 1, 0)
objecttable:setColWidth(5 + i - 1, menu.infoTableData.shipIconWidth * 2.0, false)
end
And in createPropertyOwned
for i = 1, maxicons do
ftable:setColWidth(5 + i - 1, menu.infoTableData.shipIconWidth + nbWidth, false)
end
No change in base code
The coder who made JAMUI did a fairly good job with comments on changes.
I have looked at all the comments and tried to figure out what the code changes impacted the best I can manage.
Having just the station name to display is all I really was aiming for.
Adding the icons and integers for ship stats in the station text line is just gravy and
would be great for other players who needed it.
So I will revert back to that version.
You are obviously a talented and professional coder
who altruistically helped me to make a change to improve my gaming experience.
I have also learned quite a lot of how to set up mods on X4
and that's all thanks to you.
The question is now is how do you want this mod to progress?
User avatar
ChemODun
Posts: 591
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Thinned Station Columns Mod

Post by ChemODun »

A lot of too good for me words :-)

Regarding mod - I have no plan for it. But in principle it will be good to rewrite it via UIX by kuertee...
Multiply entropy by absolute zero

Freedom in space
RondoX4
Posts: 39
Joined: Thu, 30. Jun 22, 02:31
x4

Re: Thinned Station Columns Mod

Post by RondoX4 »

That is OK if you have no more plans for it.
I am just grateful you were willing to help me get it done.
I know there will be future UI changes in X4 for 2026 version 9.0.
If I am still playing X4 into next year I might be able to update the mod if needed.
Is there any way to get X4 developers to actually listen to practical suggestions?
Do you have Egosofts ear?
I would suggest an option in setup to have one OR two text lines displayed.
Please take care and don't be too modest. Your impact on mods and modders is very significant.

Just curious ... Are you a xml programmer for Egosoft or other game developers?

Enjoy your holiday season no matter what your faith is!
User avatar
ChemODun
Posts: 591
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Thinned Station Columns Mod

Post by ChemODun »

No, I have no contacts in Egosoft and I'm not a developer at all :-)
And there are a lot of modders more skilled than me :-)
Have a nice holidays season too!
Multiply entropy by absolute zero

Freedom in space
RondoX4
Posts: 39
Joined: Thu, 30. Jun 22, 02:31
x4

Re: Thinned Station Columns Mod

Post by RondoX4 »

OK thanks for being honest.
But I think you are alright!
I assume this thred will eventually timeout and become locked.
If you are willing to be contacted in the future what is the best way to that.
Hope 2026 will be good to you.

Return to “X4: Foundations - Scripts and Modding”