• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Set officertype picture in officertypes instead of hardcoded in interface

Levis

Find(Rum) = false;
Staff member
Administrator
Creative Support
Programmer
Storm Modder
Reminder for self mostly.
Now the officertype pictures are handled in the interface file like this:
Code:
if ( IsCompanion(xi_refCharacter) ) SetNewPicture("TYPEPICT", "interfaces\blank_ship.tga");            // changed after build 11 by KAM
    if ( IsOfficer(xi_refCharacter) ) //SetNewPicture("TYPEPICT", "interfaces\kam_isofficer.tga");                // changed after build 11 by KAM
    {
        if(CheckAttribute(xi_refCharacter,"quest.officertype"))
        {
            switch (xi_refCharacter.quest.officertype)
            {
                // KK -->
                case OFFIC_TYPE_BOATSWAIN: SetNewPicture("TYPEPICT", "interfaces\order.tga"); break;
                case OFFIC_TYPE_ABORDAGE: SetNewPicture("TYPEPICT", "interfaces\fighter.tga"); break;
                case OFFIC_TYPE_RANDCHAR: SetNewPicture("TYPEPICT", "interfaces\fighter.tga"); break;
                case OFFIC_TYPE_CANNONEER: SetNewPicture("TYPEPICT", "interfaces\gunner.tga"); break;
                case OFFIC_TYPE_QMASTER: SetNewPicture("TYPEPICT", "interfaces\quartermaster.tga"); break;
                case OFFIC_TYPE_NAVIGATOR: SetNewPicture("TYPEPICT", "interfaces\navigator.tga"); break;
                case OFFIC_TYPE_FIRSTMATE: SetNewPicture("TYPEPICT", "interfaces\officer.tga"); break;
                case OFFIC_TYPE_CARPENTER: SetNewPicture("TYPEPICT", "interfaces\carpenter.tga"); break;
                case OFFIC_TYPE_DOCTOR: SetNewPicture("TYPEPICT", "interfaces\doctor.tga"); break;
                // <-- KK
            }
        }
    }
    if ( IsOfficerCompanion(xi_refCharacter) ) SetNewPicture("TYPEPICT", "interfaces\kam_isofficercompanion.tga");        // changed after build 11 by KAM
    if ( IsOnShoreLeave(xi_refCharacter) ) SetNewPicture("TYPEPICT", "interfaces\kam_isonshoreleave.tga");            // added after build 11 by KAM
    if ( IsOfficerOnShoreLeave(xi_refCharacter) ) SetNewPicture("TYPEPICT", "interfaces\kam_isofficeronshoreleave.tga");    // added after build 11 by KAM
    if ( IsPrisoner(xi_refCharacter) ) // KK
    {
        SetNewPicture("TYPEPICT", "interfaces\isprisoned.tga");  // added by MAXIMUS
        if(CheckAttribute(xi_refCharacter,"quest.officertype"))  // added by MAXIMUS
        {
            switch (xi_refCharacter.quest.officertype)
            {
// KK -->
                case OFFIC_TYPE_BOATSWAIN: SetNewPicture("TYPEPICT1", "interfaces\order.tga"); break;
                case OFFIC_TYPE_ABORDAGE: SetNewPicture("TYPEPICT1", "interfaces\fighter.tga"); break;
                case OFFIC_TYPE_RANDCHAR: SetNewPicture("TYPEPICT1", "interfaces\fighter.tga"); break;
                case OFFIC_TYPE_CANNONEER: SetNewPicture("TYPEPICT1", "interfaces\gunner.tga"); break;
                case OFFIC_TYPE_QMASTER: SetNewPicture("TYPEPICT1", "interfaces\quartermaster.tga"); break;
                case OFFIC_TYPE_NAVIGATOR: SetNewPicture("TYPEPICT1", "interfaces\navigator.tga"); break;
                case OFFIC_TYPE_FIRSTMATE: SetNewPicture("TYPEPICT1", "interfaces\officer.tga"); break;
                case OFFIC_TYPE_CARPENTER: SetNewPicture("TYPEPICT1", "interfaces\carpenter.tga"); break;
                case OFFIC_TYPE_DOCTOR: SetNewPicture("TYPEPICT1", "interfaces\doctor.tga"); break;
                case OFFIC_TYPE_TRADER: SetNewPicture("TYPEPICT1", "interfaces\trader.tga"); break;
// <-- KK
            }
        }
    }

These pictures can be added to the officertypes object which there now is and can be read in the interface. This way its also a lot easier to add other officertypes etc.

Edit: also I think the prisoned picture doesn't work at the moment if I look at the code...
 
That does sound like a clean solution.

Alternatively, perhaps it's easier to at least make a single shared function out of it instead of having the same code in many different spots?
 
Back
Top