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: 2961
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: 2961
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: 2961
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: 2961
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 одновременно) а надо опрашивать какой в данный момент активен.

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

Ракетная рамочка так же в виде коробочки.
Post Reply