my code stock.com

Andreas Spegel

Cancel Cinematic / Movies
by Andreas Spegel

Dieses Script cancelt Movies / Cinematics / Cutscenes.
Es gibt auch Movies / Cinematics / Cutscenes welche nicht gecancelt werden können, da wartet er dann einfach solange bis es vorbei ist.

Das ganze kann per DoWhen benutzt werden oder per normalen RunCode aufruf.

Snippet options

Download: Download snippet as cancel-cinematic-movies.cpp.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

        <!-- Cancel Cinematic / Movies -->
            <CustomBehavior File="RunCode" Type="Definition"><![CDATA[ 
                async Task skipCutscene()
                {
                    Func <bool> isCutscene = () => (new Frame("MovieFrame").IsVisible || new Frame("CinematicFrame").IsVisible);
                    if (isCutscene())
                    {
                        Logging.Write(System.Windows.Media.Colors.Yellow, "[Profile]: Try to cancel Cutscene!");                         
                        Lua.DoString("if MovieFrame and MovieFrame:IsVisible() then MovieFrame:StopMovie() end if CinematicFrame and CinematicFrame:IsVisible() then CinematicFrame_CancelCinematic() end");
                        await Coroutine.Sleep(1000);
                    }
                    if (!isCutscene()) return;
                    Logging.Write(System.Windows.Media.Colors.Yellow, "[Profile]: Waiting for Cutscene to End!"); 
                    await Coroutine.Wait(100000, ()=> !isCutscene());
                }                 
            ]]></CustomBehavior> 
            
            <CustomBehavior File="Hooks\DoWhen" ActivityName="Skip Movie / Cinematic" 
                                                UseWhen="new Frame(&quot;MovieFrame&quot;).IsVisible || new Frame(&quot;CinematicFrame&quot;).IsVisible" 
                                                AllowUseDuringCombat="true" AllowUseWhileMounted="true" AllowUseWhileFlying="true" AllowUseInVehicle="true">
                <CustomBehavior File="RunCode" Code="await skipCutscene()" />                
            </CustomBehavior>                                                            
        <!-- Cancel Cinematic / Movies -->
        
        
        <CustomBehavior File="RunCode" Code="await skipCutscene()" />
        
        
        <!-- Cancel Movie / Cinematic -->
            <CustomBehavior File="Hooks\DoWhen" ActivityName="Skip Movie / Cinematic" Command="Remove" />
        <!-- Cancel Movie / Cinematic -->

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.