# Wait For Portrait To Load

Grammar — Wait for portrait to finish loading
FlagsNative | Action

Waits until the specified portrait is finished loading. This may be necessary before some operations may be applied to the portrait.

# Arguments

  • int<portrait> — Portrait

Returns — void

native void PortraitWaitForLoad(int p);

Category: Portrait / Advanced

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:13540

    PortraitSetBackgroundVisible(PortraitLastCreated(), false);
    PortraitSetBorderVisible(PortraitLastCreated(), false);
    PortraitWaitForLoad(PortraitLastCreated());
    PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, true);
    gf_GoToRoom(ge_RoomID_RoomVoid, false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:26539

    gv_bridgeCommunicatorPortraitValerian = PortraitLastCreated();
    PortraitSetOffscreen(gv_bridgeCommunicatorPortraitValerian, true);
    PortraitWaitForLoad(gv_bridgeCommunicatorPortraitValerian);
    PortraitSetVisible(gv_bridgeCommunicatorPortraitValerian, PlayerGroupAll(), true, true);
    PortraitSetChannel(gv_bridgeCommunicatorPortraitValerian, 1);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:29970

    gf_ResetActorToLocation(ge_ActorID_ActorHorner, PointFromId(678));
    gf_ResetActorToLocation(ge_ActorID_ActorRaynor, PointFromId(680));
    PortraitWaitForLoad(lv_portaitMiddlePlanet);
    ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimPlay Default Stand PlayForever");
    ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimSetTimeScale Default 5.000000");

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tzeratul02.sc2map/MapScript.galaxy:7132

    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul2_Planet", "", "", false, false);
    gv_victoryCinematicPortrait = PortraitLastCreated();
    PortraitWaitForLoad(PortraitLastCreated());
    PortraitSetFullscreen(PortraitLastCreated(), true);
    PortraitSetLight(PortraitLastCreated(), "VC_Zeratul2_Planet");

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:13540

    PortraitSetBackgroundVisible(PortraitLastCreated(), false);
    PortraitSetBorderVisible(PortraitLastCreated(), false);
    PortraitWaitForLoad(PortraitLastCreated());
    PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, true);
    gf_GoToRoom(ge_RoomID_RoomVoid, false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:26539

    gv_bridgeCommunicatorPortraitValerian = PortraitLastCreated();
    PortraitSetOffscreen(gv_bridgeCommunicatorPortraitValerian, true);
    PortraitWaitForLoad(gv_bridgeCommunicatorPortraitValerian);
    PortraitSetVisible(gv_bridgeCommunicatorPortraitValerian, PlayerGroupAll(), true, true);
    PortraitSetChannel(gv_bridgeCommunicatorPortraitValerian, 1);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:29970

    gf_ResetActorToLocation(ge_ActorID_ActorHorner, PointFromId(678));
    gf_ResetActorToLocation(ge_ActorID_ActorRaynor, PointFromId(680));
    PortraitWaitForLoad(lv_portaitMiddlePlanet);
    ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimPlay Default Stand PlayForever");
    ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimSetTimeScale Default 5.000000");

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tzeratul02.sc2mapMapScript.galaxy:7132

    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul2_Planet", "", "", false, false);
    gv_victoryCinematicPortrait = PortraitLastCreated();
    PortraitWaitForLoad(PortraitLastCreated());
    PortraitSetFullscreen(PortraitLastCreated(), true);
    PortraitSetLight(PortraitLastCreated(), "VC_Zeratul2_Planet");

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:1507

        PortraitSetBorderVisible(libSwaC_gv_zS_PlanetPortrait, false);
        PortraitUseTransition(PortraitLastCreated(), false);
        PortraitWaitForLoad(libSwaC_gv_zS_PlanetPortrait);
    }
    else {

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1389

    }
    if ((lib281DEC45_gv_zSS_UITravelBGPortrait != c_invalidDialogControlId) && (lib281DEC45_gv_zSS_UITravelSelectedPlanet != 0) && (DialogControlIsVisible(lib281DEC45_gv_zSS_UITravelBGPortrait, 1) == true)) {
        PortraitWaitForLoad(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelBGPortrait));
    }
    else {

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1394

    }
    if ((lib281DEC45_gv_zSS_UITravelSelectedPlanet != 0) && (DialogControlIsVisible(lib281DEC45_gv_zSS_UITravelContactPortrait, 1) == true)) {
        PortraitWaitForLoad(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelContactPortrait));
    }
    else {

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1686

    // Implementation
    PortraitSetModel(PortraitGetTriggerControl(lib281DEC45_gv_zSS_MissionContactPortrait), (lib281DEC45_gf_ZSS_UIMissionProperty("ContactModelLink")), true);
    PortraitWaitForLoad(PortraitGetTriggerControl(lib281DEC45_gv_zSS_MissionContactPortrait));
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:2013

        PortraitSetBorderVisible(libVCMI_gv_pM_PlanetPortrait, false);
        PortraitUseTransition(PortraitLastCreated(), false);
        PortraitWaitForLoad(libVCMI_gv_pM_PlanetPortrait);
    }
    else {

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:2693

        PortraitSetBorderVisible(libNCMI_gv_NM_PlanetPortrait, false);
        PortraitUseTransition(PortraitLastCreated(), false);
        PortraitWaitForLoad(libNCMI_gv_NM_PlanetPortrait);
    }
    else {

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:1193

        PortraitSetBorderVisible(libA3DDD02B_gv_pP_PlanetPortrait, false);
        PortraitUseTransition(PortraitLastCreated(), false);
        PortraitWaitForLoad(libA3DDD02B_gv_pP_PlanetPortrait);
    }
    else {