Docked HUDs OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2963
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Docked HUDs OXP

Post by Wildeblood »

Check my logic, please, someone/anyone: will this actually select all of these six HUD files:-

docked-market-screens-hud.plist <--- new.
docked-need-fuel-hud.plist
docked-need-missiles-hud.plist
docked-full-missiles-hud.plist <--- the old docked-need-nothing-hud.plist renamed.
docked-extra-missiles-hud.plist <--- new, variant for more than 12 missiles.
docked-clock-only-hud.plist <--- new, big_gui compatible.

- at the intended times?

Code: Select all

    this._selectDockedHUD = function () {
        var self = player.ship;

     // 1. Are we on the market screens?

        if (guiScreen === "GUI_SCREEN_MARKET" || guiScreen === "GUI_SCREEN_MARKETINFO") {
            if (self.equipmentStatus("EQ_AI_TRADING_ASSISTANT") === "EQUIPMENT_OK") {
                return;
            } else {
                self.hud = "docked-market-screens-hud.plist";
                return;
            }

     // 2. Do we need fuel?

        } else if (self.fuel < 7) {
            self.hud = "docked-need-fuel-hud.plist";
            return;

     // 3. Do we need missiles?
     //    OR
     // 4. Are we on the equipment screen?

        } else if (self.missileCapacity > self.missiles.length ||
            guiScreen === "GUI_SCREEN_EQUIP_SHIP") {

            if (self.missileCapacity > 12) {
                self.hud = "docked-extra-missiles-hud.plist";
                return;
            } else if (self.missileCapacity > self.missiles.length) {
                self.hud = "docked-need-missiles-hud.plist";
                return;
            } else if (guiScreen === "GUI_SCREEN_EQUIP_SHIP") {
                self.hud = "docked-full-missiles-hud.plist";
                return;
            }
            return;

     // 5. If we reach here, then allow_big_gui

        } else {
            self.hud = "docked-clock-only-hud.plist";
            return;
        }
    }
I hate the mess on the equipment screen, where things get checked twice.
R.I.P. John Lodge, 1943-2025.
User avatar
Krager
---- E L I T E ----
---- E L I T E ----
Posts: 297
Joined: Wed Dec 11, 2024 9:44 pm
Location: Russian

Re: Docked HUDs OXP

Post by Krager »

Я в коде не разбираюсь, могу только готовый продукт попробовать)
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5676
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Docked HUDs OXP

Post by phkb »

Wildeblood wrote: Sat Mar 21, 2026 8:05 am
Check my logic, please

Code: Select all

        } else if (self.missileCapacity > self.missiles.length || guiScreen === "GUI_SCREEN_EQUIP_SHIP") {

            if (self.missileCapacity > 12) {
                self.hud = "docked-extra-missiles-hud.plist";
                return;
            } else if (self.missileCapacity > self.missiles.length) {
                self.hud = "docked-need-missiles-hud.plist";
                return;
            } else if (guiScreen === "GUI_SCREEN_EQUIP_SHIP") {
                self.hud = "docked-full-missiles-hud.plist";
                return;
            }
            return;
I think the final check of guiScreen is unnecessary, and I think the missile checking could be streamlined, like this:

Code: Select all

        } else if (self.missileCapacity > self.missiles.length || guiScreen === "GUI_SCREEN_EQUIP_SHIP") {

            if (self.missileCapacity > self.missiles.length) {
                if (self.missileCapacity > 12) {
                    self.hud = "docked-extra-missiles-hud.plist";
                } else {
                    self.hud = "docked-need-missiles-hud.plist";
                }
            } else {
                self.hud = "docked-full-missiles-hud.plist";
            }
            return;
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5676
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Docked HUDs OXP

Post by phkb »

And a small suggestion: You don't really need all those "return;" statements. As there's no code after the "if" statements, the code will naturally return without being told specifically. So you could make it just:

Code: Select all

    this._selectDockedHUD = function () {
        var self = player.ship;

     // 1. Are we on the market screens?

        if (guiScreen === "GUI_SCREEN_MARKET" || guiScreen === "GUI_SCREEN_MARKETINFO") {
            if (self.equipmentStatus("EQ_AI_TRADING_ASSISTANT") !== "EQUIPMENT_OK") {
                self.hud = "docked-market-screens-hud.plist";
            }

     // 2. Do we need fuel?

        } else if (self.fuel < 7) {
            self.hud = "docked-need-fuel-hud.plist";

     // 3. Do we need missiles?
     //    OR
     // 4. Are we on the equipment screen?

        } else if (self.missileCapacity > self.missiles.length ||
            guiScreen === "GUI_SCREEN_EQUIP_SHIP") {

            if (self.missileCapacity > self.missiles.length) {
                if (self.missileCapacity > 12) {
                    self.hud = "docked-extra-missiles-hud.plist";
                } else {
                    self.hud = "docked-need-missiles-hud.plist";
                }
            } else {
                self.hud = "docked-full-missiles-hud.plist";
            }

     // 5. If we reach here, then allow_big_gui

        } else {
            self.hud = "docked-clock-only-hud.plist";
        }
    }
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2963
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Krager!!!

Post by Wildeblood »

Does anyone have any opinions regarding a colour scheme? Back when I first created this we had a choice of green, so it was easy to choose (I chose green, by the way). But if there's an argument for another colour, now would be a good time to proffer it.
R.I.P. John Lodge, 1943-2025.
User avatar
Krager
---- E L I T E ----
---- E L I T E ----
Posts: 297
Joined: Wed Dec 11, 2024 9:44 pm
Location: Russian

Re: Krager!!!

Post by Krager »

Wildeblood wrote: Mon Mar 23, 2026 12:36 pm
Does anyone have any opinions regarding a colour scheme? Back when I first created this we had a choice of green, so it was easy to choose (I chose green, by the way). But if there's an argument for another colour, now would be a good time to proffer it.
Вообще никаких возражений, цвет подобран хорошо. Мне зелёный нравится) Мягкий, приятный, на глаза не давит. Предлагаю цвет оставить зелёный.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2963
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Krager!!!

Post by Wildeblood »

Krager wrote: Thu Mar 26, 2026 6:37 am
Вообще никаких возражений, цвет подобран хорошо. Мне зелёный нравится) Мягкий, приятный, на глаза не давит. Предлагаю цвет оставить зелёный.
Righto, try this:

Docked_HUDs_1.4_P1.oxp.zip
(56.37 KiB) Downloaded 3 times
R.I.P. John Lodge, 1943-2025.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2963
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Docked HUDs OXP

Post by Wildeblood »

Back on November 2nd, 2015, at 1:25 am, I suggested:
Wildeblood wrote: Sun Nov 01, 2015 5:25 pm
I suggest a nifty, little OXP project for anyone wanting a nifty, little OXP project would be a HUD component that used shipWillLaunchFromStation to display this:-

Image

- on the HUD then shipLaunchedFromStation to remove it again, while displaying the console message, "Remember to fasten your seatbelt."
Finally realised in Docked HUDs 1.4 preview 1. Better late than never, I suppose.
R.I.P. John Lodge, 1943-2025.
User avatar
Krager
---- E L I T E ----
---- E L I T E ----
Posts: 297
Joined: Wed Dec 11, 2024 9:44 pm
Location: Russian

Re: Docked HUDs OXP

Post by Krager »

Пробовал, увидел при вылете со станции значёк. Других изменений не заметил.

Так же забивает XenonUI.
Буфер обмена_03-26-2026_02.jpg
Причём если делать опрос, надо учитывать не наличие самого hud (у меня стоят XenonUI и BGS одновременно) а надо опрашивать какой в данный момент активен.

Текст так же выводиться на весь экран.

Ракетная рамочка так же в виде коробочки.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2963
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Docked HUDs OXP

Post by Wildeblood »

This one is completely untested, but should work.

Docked_HUDs_1.4_P2.oxp.zip
(64.56 KiB) Downloaded 4 times

It should check for XenonUI at game start. (It won't re-check again, just the once.) And, it should select HUD files without the text on the left, and it should skip the "Welcome aboard" sequence, if XenonUI is used.

I need you to tell me whether the missile display still spills out of the box when you have 16 missiles.

There is text you will need to translate or delete for your version, in:-

docked-market-screens-hud.plist
nodials-docked-market-screens-hud.plist


Also, the console message displays are not set yet, they will make a mess on the trading screens.
R.I.P. John Lodge, 1943-2025.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2963
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Docked HUDs OXP

Post by Wildeblood »

Krager wrote: Thu Mar 26, 2026 7:12 pm
Пробовал, увидел при вылете со станции значёк.
Try this with it, also: https://wiki.alioth.net/index.php/File: ... ipName.oxz

Look for text in the top-left corner of the screen as you launch.

Addendum: I broke docked-launch-sequence-hud.plist while I was inserting that change. FIX LIKE THIS:-

Code: Select all

{
	allow_big_gui = no;
	// crosshairs = { OTHER = (); };

	dials		= //these are drawn, in order, after the legends
	(
		// Ship's name, top left corner
		{
			alpha = 0.2;
			data_source = "playerShipName"; 
			selector = "drawCustomText:";
			x = 32; y = -40; y_origin = 1; x_origin = -1; height = 20; width = 12;
		},
		{
			alpha = 0.2;
			data_source = "playerShipClass"; 
			selector = "drawCustomText:";
			x = 38; // Change this number to centre the small text under the name.
			y = -44; y_origin = 1; x_origin = -1; height = 8; width = 8;
			
		}, // <<================== RIGHT THERE, THAT COMMA, CAN YOU SEE IT?
		
		{	// Welcome aboard message...
			data_source = "hudControl"; 
			selector = "drawCustomText:";
			x		= -98;
			y 		= 50; 
			y_origin	= -1;
			height		= 16;
			width		= 16;
			alpha		= 1.0; 
		},
R.I.P. John Lodge, 1943-2025.
Post Reply