Exemplo n.º 1
0
        private void copyDialogset(CStorySceneSection storysection)
        {
            // see if it has a change dialog set property
            var dlgset = storysection.GetVariableByName("dialogsetChangeTo") as CName;

            if (dlgset != null)
            {
                // see if we already have a dialog set with this name
                var destdlgset = findDialogset(DestinationFile, dlgset.Value);
                if (destdlgset == null)
                {
                    // we dont so find the one in the source and copy it.
                    var srcdlgset = findDialogset(SourceFile, dlgset.Value);
                    if (srcdlgset != null)
                    {
                        var CStoryScene        = DestinationFile.GetChunkByType("CStoryScene");
                        var dialogsetInstances = (CArray)CStoryScene.GetVariableByName("dialogsetInstances");

                        var copieddialogset = srcdlgset.Copy(this);
                        DestinationFile.CreatePtr(dialogsetInstances, copieddialogset);
                        var placementTag = (CTagList)copieddialogset.GetVariableByName("placementTag");
                        placementTag.tags.Clear();
                        placementTag.tags.Add((CName)DestinationFile.CreateVariable("CName").SetValue("PLAYER"));
                    }
                }
            }
        }
Exemplo n.º 2
0
        private CR2WExportWrapper CopyChunk(CR2WExportWrapper chunk)
        {
            if (ExcludeChunks != null &&
                ExcludeChunks.Contains(chunk.Type))
            {
                return(null);
            }

            var chunkcopy = chunk.Copy(this);

            if (chunkcopy != null)
            {
                if (chunkcopy.data is CStorySceneSection)
                {
                    OnCopyStorySceneSection(chunkcopy);
                }

                var CStoryScene = DestinationFile.GetChunkByType("CStoryScene");
                if (CStoryScene != null)
                {
                    var controlParts = CStoryScene.GetVariableByName("controlParts") as CArray;
                    // Add this chunk to the controlParts
                    if (controlParts != null)
                    {
                        switch (chunkcopy.Type)
                        {
                        case "CStorySceneInput":

                        case "CStorySceneScript":
                        case "CStorySceneFlowCondition":

                        case "CStorySceneSection":
                        case "CStorySceneCutsceneSection":
                        case "CStorySceneVideoSection":
                        case "CStorySceneRandomizer":
                        case "CStorySceneOutput":
                        case "CStorySceneCutscenePlayer":

                            DestinationFile.CreatePtr(controlParts, chunkcopy);
                            break;

                        default:
                            break;
                        }
                    }

                    var sections = CStoryScene.GetVariableByName("sections") as CArray;
                    // Add this chunk to the sections
                    if (sections != null)
                    {
                        switch (chunkcopy.Type)
                        {
                        case "CStorySceneSection":
                        case "CStorySceneCutsceneSection":
                        case "CStorySceneVideoSection":

                            DestinationFile.CreatePtr(sections, chunkcopy);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }

            return(chunkcopy);
        }