예제 #1
0
        private void tvScenes_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Tag is ROMHandler.ROMHandler)
                ResetCurrentData();
            if (e.Node.Tag is ISceneTableEntry)
            {
                if (currentScene != (e.Node.Tag as ISceneTableEntry))
                {
                    currentScene = (e.Node.Tag as ISceneTableEntry);
                    currentScene.SetCurrentSceneHeader(currentScene.GetSceneHeaders()[0]);
                    currentEnvSettings = currentScene.GetActiveEnvSettings().EnvSettingList.First();
                }
                currentRoom = null;
                currentRoomTriangle = null;
                currentRoomVertex = null;
            }
            else if (e.Node.Tag is HeaderLoader.HeaderPair)
            {
                HeaderLoader.HeaderPair hp = (e.Node.Tag as HeaderLoader.HeaderPair);

                if (hp.SceneHeader.Parent != currentScene) currentScene = (hp.SceneHeader.Parent as ISceneTableEntry);
                currentScene.SetCurrentSceneHeader(hp.SceneHeader);
                currentEnvSettings = currentScene.GetActiveEnvSettings().EnvSettingList.First();

                currentRoom = null;
                currentRoomTriangle = null;
                currentRoomVertex = null;
            }
            else if (e.Node.Tag is HeaderCommands.Rooms.RoomInfoClass)
            {
                HeaderLoader.HeaderPair hp = (e.Node.Parent.Tag as HeaderLoader.HeaderPair);

                if (hp.SceneHeader.Parent != currentScene) currentScene = (hp.SceneHeader.Parent as ISceneTableEntry);
                currentScene.SetCurrentSceneHeader(hp.SceneHeader);
                currentEnvSettings = currentScene.GetActiveEnvSettings().EnvSettingList.First();

                currentRoom = (e.Node.Tag as HeaderCommands.Rooms.RoomInfoClass);
                if (hp.SceneHeader.Number < currentRoom.Headers.Count)
                    currentRoom.CurrentRoomHeader = currentRoom.Headers[hp.SceneHeader.Number];

                currentRoomTriangle = null;
                currentRoomVertex = null;
            }

            RefreshCurrentData();
        }
예제 #2
0
        private void ResetCurrentData(bool norefresh = false)
        {
            currentScene = null;
            currentRoom = null;
            currentRoomTriangle = null;
            currentRoomVertex = null;
            currentEnvSettings = null;

            if (!norefresh) RefreshCurrentData();
        }