示例#1
0
        // This is the method to run when the timer is raised.
        private void MainForm1_Timer(Object myObject, EventArgs myEventArgs)
        {
            //tick the game logic so events are dispersed
            //float elapsedTime = GodzUtil.RunMainPass();
            //Console.WriteLine("Elapsed Time " + elapsedTime);
            GodzUtil.RunMainPass();

            TabPanelData currTab = getTabPanel();

            if (currTab != null)
            {
                currTab.mListener.OnTick();
            }

            foreach (GodzGlue.PackageFuture pf in mFutures)
            {
                if (pf.isReady())
                {
                    GodzGlue.Package p = pf.getPackage();
                    packages.Add(p);

                    //iterate through all the trees and update...
                    int len = mTabs.Count;
                    for (int i = 0; i < len; i++)
                    {
                        TabPage      tab  = mTabs[i];
                        TabPanelData data = (TabPanelData)mTabMap[tab];
                        data.mListener.PackageLoaded(p);
                    }

                    //see if its the editor package
                    if (p.GetName() == mEditorName)
                    {
                        //now assign the editor icon to all Entity objects
                        uint      entityName = GodzUtil.GetHashCode("WEntity");
                        ClassBase classBase  = ClassBase.findClass(entityName);
                        if (classBase != null)
                        {
                            uint matName = GodzUtil.GetHashCode("icon");
                            mDefaultEntityMaterial = p.FindObject(matName) as Material;
                            if (mDefaultEntityMaterial != null)
                            {
                                classBase.setMaterial(mDefaultEntityMaterial);
                            }
                        }
                    }

                    mFutures.Remove(pf);
                    break; //list was modified while iterating...
                }
            }
        }
        void TabPanelListener.PackageLoaded(GodzGlue.Package package)
        {
            if (package.Type == PackageType.PackageType_RESOURCE)
            {
                TreeNode node = AddPackage(package);
                selectedPackage = package;

                if (node != null)
                {
                    setActivePackageNode(node);
                }
            }
        }
示例#3
0
        private void packageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewPackageForm dlg = new NewPackageForm();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                GodzGlue.Package p = dlg.getPackage();

                //iterate through all the trees and update...
                int len = mTabs.Count;
                for (int i = 0; i < len; i++)
                {
                    TabPage      tab  = mTabs[i];
                    TabPanelData data = (TabPanelData)mTabMap[tab];
                    data.mListener.PackageLoaded(p);
                }
            }
        }
示例#4
0
 void TabPanelListener.PackageLoaded(GodzGlue.Package package)
 {
     AddPackage(package);
 }