예제 #1
0
void AudioExtension::ExposeActionsResources(gd::Instruction & action, gd::ArbitraryResourceWorker & worker)
{
    if ( action.GetType() == "PlaySound" || action.GetType() == "PlaySoundCanal" || action.GetType() == "PlayMusic" || action.GetType() == "PlayMusicCanal" )
    {
        gd::String parameter = action.GetParameter(1).GetPlainString();
        worker.ExposeAudio(parameter);
        action.SetParameter(1, parameter);
    }
}
bool EventsParametersLister::DoVisitInstruction(gd::Instruction & instruction, bool isCondition)
{
    const gd::InstructionMetadata & instrInfo = isCondition ?
        MetadataProvider::GetConditionMetadata(project.GetCurrentPlatform(), instruction.GetType()) :
        MetadataProvider::GetActionMetadata(project.GetCurrentPlatform(), instruction.GetType());

    for (int i = 0; i < instruction.GetParametersCount() && i < instrInfo.GetParametersCount(); ++i)
        parameters[instruction.GetParameter(i).GetPlainString()] = instrInfo.GetParameter(i).GetType();

    return false;
}
예제 #3
0
void WindowExtension::ExposeActionsResources(gd::Instruction & action, gd::ArbitraryResourceWorker & worker)
{
    if ( action.GetType() == "EcrireTexte" && !action.GetParameter( 6 ).GetPlainString().empty() )
    {
        std::string parameter = action.GetParameter(6).GetPlainString();
        worker.ExposeFile(parameter);
        action.SetParameter(6, parameter);
    }
    if ( action.GetType() == "SetWindowIcon" && !action.GetParameter( 1 ).GetPlainString().empty() )
    {
        std::string parameter = action.GetParameter(1).GetPlainString();
        worker.ExposeImage(parameter);
        action.SetParameter(1, parameter);
    }
}