Subversion Repositories spk

Rev

Rev 94 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "../StdAfx.h"
#include "AddShipPart.h"

#include "Form1.h"

namespace Creator {
        void AddShipPart::SetComponent(bool edit)
        {
                if ( edit )
                        this->Text = "Edit Component Entry";
                else
                        this->Text = "Add Component Entry";

                this->PanelSection2->Visible = true;

                CGameDirectories *gameDir = _prepareSection();
                for ( Utils::WString section = gameDir->firstComponentSection(); !section.empty(); section = gameDir->nextComponentSection() )
                        this->ComboSection->Items->Add(_US(section));
        }

        CGameDirectories *AddShipPart::_prepareSection()
        {
                CGameDirectories *gameDir = ((Form1 ^)m_pParent)->gameDirectories();
                gameDir->setSelectedGameDirectory(gameDir->highestGame());

                this->ComboSection->Items->Clear();

                return gameDir;
        }

        void AddShipPart::SetDummy(bool edit)
        {
                if ( edit )
                        this->Text = "Edit Dummy Entry";
                else
                        this->Text = "Add Component Entry";

                this->PanelSection2->Visible = false;

                CGameDirectories *gameDir = _prepareSection();
                for ( Utils::WString section = gameDir->firstDummySection(); !section.empty(); section = gameDir->nextDummySection() )
                        this->ComboSection->Items->Add(_US(section));
        }

        void AddShipPart::SetBodies(bool edit)
        {
                if ( edit )
                        this->Text = "Edit Bodies Entry";
                else
                        this->Text = "Add Bodies Entry";

                this->PanelSection2->Visible = false;

                CGameDirectories *gameDir = _prepareSection();
                for ( Utils::WString section = gameDir->firstBodiesSection(); !section.empty(); section = gameDir->nextBodiesSection() )
                        this->ComboSection->Items->Add(_US(section));
        }
}