Beispiel #1
0
        public SWBF2Handle AddLevel(string path, string[] subLVLs)
        {
            CheckValidity();
            if (subLVLs == null)
            {
                subLVLs = new string[0];
            }
            IntPtr[]    ptrs = MemUtils.StringToIntPtrList(subLVLs);
            SWBF2Handle h    = new SWBF2Handle(APIWrapper.Container_AddLevelFiltered(NativeInstance, path, ptrs, (uint)ptrs.Length));

            MemUtils.FreeStrings(ptrs);
            return(h);
        }
    public void Run(string initScript, string initFn = null, string postLoadFn = null)
    {
        Debug.Assert(Stage == EnvStage.Init);
        Loader.ResetAllLoaders();

        InitScriptName       = initScript;
        InitFunctionName     = initFn;
        PostLoadFunctionName = postLoadFn;

        LoadscreenHandle = ScheduleLVLRel(GetLoadscreenPath());
        EnvCon.LoadLevels();

        Stage = EnvStage.LoadingBase;
    }
Beispiel #3
0
        public Level GetLevel(SWBF2Handle handle, bool block = false)
        {
            CheckValidity();
            while (block && (GetStatus(handle) == ELoadStatus.Loading || GetStatus(handle) == ELoadStatus.Uninitialized))
            {
                Thread.Sleep(200);
            }

            IntPtr ptr   = APIWrapper.Container_GetLevel(NativeInstance, handle.GetNativeHandle());
            Level  level = RegisterChild(FromNative <Level>(ptr));

            if (level != null)
            {
                level.bHasOwner = true;
            }
            return(level);
        }
Beispiel #4
0
 public float GetProgress(SWBF2Handle handle)
 {
     CheckValidity();
     return(APIWrapper.Container_GetProgress(NativeInstance, handle.GetNativeHandle()));
 }
Beispiel #5
0
 public ELoadStatus GetStatus(SWBF2Handle handle)
 {
     CheckValidity();
     return((ELoadStatus)APIWrapper.Container_GetStatus(NativeInstance, handle.GetNativeHandle()));
 }
 public float GetProgress(SWBF2Handle handle)
 {
     return(EnvCon.GetProgress(handle));
 }