예제 #1
0
        public MainForm1()
        {
            InitializeComponent();

            mEditorName = GodzUtil.GetHashCode("Editor");

            //We want for the form to display before attempting to connect to SQL. This way if we hit a timeout
            //or something, at least the user has the form to stare at
            connectToDB();

            Editor.initEditor();

            // Grab all the Hash strings and push them into the HStringTable. This way streaming files will work properly.
            // Without this step, loading in package depends will fail...
            Editor.ExportStrings(false, false);

            //make full screen
            Rectangle box = Screen.PrimaryScreen.Bounds;

            //hack so we can see status bar at bottom of the form. Cant set TopMost to true really since that
            //bugs out the form (make debug hard + dialogs not have focus)
            box.Height -= 50;
            SetBounds(0, 0, box.Width, box.Height);
            CenterToScreen();

            //directx-godzengine needs a dummy HWND.....
            GodzUtil.AddViewport(dummyPictureForDirectX.Handle);

            // Make single thread calls to renderer. As of visual studio 2012, running the renderer
            // asynchronously can lead to massive stalls in the Editor. So we have to perform
            // all of our draws in single threaded mode.
            GodzUtil.StartRenderThread(true, false);

            PackageFuture future = GodzUtil.StreamPackage("Editor");

            mFutures.Add(future);

            myTimer       = new Timer();
            myTimer.Tick += new EventHandler(MainForm1_Timer);

            //Set to real low for per frame ticks. Run at 60 fps = 0.016
            myTimer.Interval = 1;
            myTimer.Start();

            //Now download all the Class Descriptions, etc
            GodzClassDescriptionRegistry.init();

            this.Focus();
            this.KeyPreview = true;
        }
        private void classPickComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //user selected a class...
            uint classhash = GodzUtil.GetHashCode((string)classPickComboBox.SelectedItem);

            activeClass = null;

            foreach (ClassBase tempClass in classes)
            {
                if (tempClass.getObjectName() == classhash)
                {
                    activeClass = tempClass;
                    break;
                }
            }

            //grab all the properties....
            props.Clear();
            activeClass.getPropertiesNonRecurse(props);

            propertyListBox1.Items.Clear();
            foreach (ClassPropertyInfo cp in props)
            {
                propertyListBox1.Items.Add(cp.mName);
            }

            //grab the documentation for this class from the database...
            classInfo = (GodzClassInfo)GodzClassDescriptionRegistry.get(activeClass.getObjectName());

            if (classInfo == null)
            {
                classInfo = new GodzClassInfo();
                GodzClassDescriptionRegistry.put(activeClass.getObjectName(), classInfo);
            }

            dbProperties = classInfo.cpList;
        }