Subversion Repositories spk

Rev

Rev 124 | Rev 127 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 124 Rev 126
Line 767... Line 767...
767
	if ( !m_sData.empty() )
767
	if ( !m_sData.empty() )
768
		return m_sData.token(";", TSHIPPOS_CLASS);
768
		return m_sData.token(";", TSHIPPOS_CLASS);
769
	return "OBJ_SHIP_M5";
769
	return "OBJ_SHIP_M5";
770
}
770
}
771
 
771
 
772
bool CXspFile::GeneratePackagerScript(bool wildcard, CyStringList *list, bool datafile)
772
bool CXspFile::GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, bool datafile)
773
{
773
{
774
	if ( !CBaseFile::GeneratePackagerScript(wildcard, list, datafile) )
774
	if ( !CBaseFile::GeneratePackagerScript(wildcard, list, game, datafile) )
775
		return false;
775
		return false;
776
 
776
 
777
	list->PushBack("# File Type, Script or Ship");
777
	list->pushBack("# File Type, Script or Ship");
778
	list->PushBack("FileType: Ship");
778
	list->pushBack("FileType: Ship");
779
	list->PushBack("");
779
	list->pushBack("");
780
 
780
 
781
	if ( m_iShipyard )
781
	if ( m_iShipyard )
782
	{
782
	{
783
		list->PushBack("# Shipyards, Set which shipyards to add ships for sale to");
783
		list->pushBack("# Shipyards, Set which shipyards to add ships for sale to");
784
		for ( int i = SHIPYARD_ARGON; i <= SHIPYARD_MAX; i *= 2 )
784
		for ( int i = SHIPYARD_ARGON; i <= SHIPYARD_MAX; i *= 2 )
785
		{
785
		{
786
			if ( this->IsShipyard(i) )
786
			if ( this->IsShipyard(i) )
787
				list->PushBack(CyString("Shipyard: ") + GetShipyardName(i));
787
				list->pushBack("Shipyard: " + GetShipyardName(i));
788
		}
788
		}
789
		list->PushBack("");
789
		list->pushBack("");
790
	}
790
	}
791
 
791
 
792
	if ( m_iOrgDesc > 0 )
792
	if ( m_iOrgDesc > 0 )
793
	{
793
	{
794
		list->PushBack("# Use Original Description, overrides text entrys to use one of the built in text");
794
		list->pushBack("# Use Original Description, overrides text entrys to use one of the built in text");
795
		list->PushBack(CyString("OriginalDescription: ") + (long)m_iOrgDesc);
795
		list->pushBack(Utils::String("OriginalDescription: ") + (long)m_iOrgDesc);
796
		list->PushBack("");
796
		list->pushBack("");
797
	}
797
	}
798
 
798
 
799
	if ( !m_sID.empty() )
799
	if ( !m_sID.empty() )
800
	{
800
	{
801
		list->PushBack("# Ship ID, the ship id to identify the ship as");
801
		list->pushBack("# Ship ID, the ship id to identify the ship as");
802
		list->PushBack(CyString("ShipID: ") + m_sID);
802
		list->pushBack("ShipID: " + m_sID);
803
	}
803
	}
804
 
804
 
805
	if ( m_bExistingShip )
805
	if ( m_bExistingShip )
806
	{
806
	{
807
		list->PushBack("# Existing Ship, replaces an existing ship in the game with ship package instead of creating a new entry");
807
		list->pushBack("# Existing Ship, replaces an existing ship in the game with ship package instead of creating a new entry");
808
		list->PushBack("ExistingShip");
808
		list->pushBack("ExistingShip");
809
		list->PushBack("");
809
		list->pushBack("");
810
	}
810
	}
811
 
811
 
812
	if ( !m_sData.empty() )
812
	if ( !m_sData.empty() )
813
	{
813
	{
814
		list->PushBack("# Ship Data, the TShip data entry to add to the game (parts of this are adjusted and auto generated by the installer)");
814
		list->pushBack("# Ship Data, the TShip data entry to add to the game (parts of this are adjusted and auto generated by the installer)");
815
		list->PushBack(CyString("ShipData: ") + m_sData);
815
		list->pushBack("ShipData: " + m_sData);
816
		list->PushBack("");
816
		list->pushBack("");
817
	}
817
	}
818
 
818
 
819
	if ( m_lText.size() ) {
819
	if ( m_lText.size() ) {
820
		list->PushBack("# Ship Texts, the name/description of the ship in each language: <LANGID> <NAME>|<DESCRIPTION>");
820
		list->pushBack("# Ship Texts, the name/description of the ship in each language: <LANGID> <NAME>|<DESCRIPTION>");
821
		for(CListNode<SText> *node = m_lText.Front(); node; node = node->next()) {
821
		for(CListNode<SText> *node = m_lText.Front(); node; node = node->next()) {
822
			list->PushBack(CyString("ShipText: ") + (long)node->Data()->iId + " " + node->Data()->sName + "|" + node->Data()->sDesc);
822
			list->pushBack(Utils::String("ShipText: ") + (long)node->Data()->iId + " " + node->Data()->sName + "|" + node->Data()->sDesc);
823
		}
823
		}
824
 
824
 
825
		list->PushBack("");
825
		list->pushBack("");
826
	}
826
	}
827
 
827
 
828
	if ( this->m_lWeaponMasks.size() ) {
828
	if ( this->m_lWeaponMasks.size() ) {
829
		list->PushBack("# Weapon Masks, the weapons for each game: <GAME> <MASK>");
829
		list->pushBack("# Weapon Masks, the weapons for each game: <GAME> <MASK>");
830
		for(CListNode<SWeaponMask> *node = m_lWeaponMasks.Front(); node; node = node->next()) {
830
		for(CListNode<SWeaponMask> *node = m_lWeaponMasks.Front(); node; node = node->next()) {
831
			list->PushBack(CyString("WeaponMask: ") + (long)node->Data()->iGame + " " + (long)node->Data()->iMask);
831
			list->pushBack(Utils::String("WeaponMask: ") + (long)node->Data()->iGame + " " + (long)node->Data()->iMask);
832
		}
832
		}
833
 
833
 
834
		list->PushBack("");
834
		list->pushBack("");
835
	}
835
	}
836
 
836
 
837
	if ( this->m_lMissileMasks.size() ) {
837
	if ( this->m_lMissileMasks.size() ) {
838
		list->PushBack("# Missile Masks, the missiles for each game: <GAME> <MASK>");
838
		list->pushBack("# Missile Masks, the missiles for each game: <GAME> <MASK>");
839
		for(CListNode<SWeaponMask> *node = m_lMissileMasks.Front(); node; node = node->next()) {
839
		for(CListNode<SWeaponMask> *node = m_lMissileMasks.Front(); node; node = node->next()) {
840
			list->PushBack(CyString("WeaponMask: ") + (long)node->Data()->iGame + " " + (long)node->Data()->iMask);
840
			list->pushBack(Utils::String("WeaponMask: ") + (long)node->Data()->iGame + " " + (long)node->Data()->iMask);
841
		}
841
		}
842
 
842
 
843
		list->PushBack("");
843
		list->pushBack("");
844
	}
844
	}
845
 
845
 
846
	if ( this->m_lComponent.size() ) {
846
	if ( this->m_lComponent.size() ) {
847
		list->PushBack("# Ship Components, each component used in the ships scene: <SECTION> <MODELENTRY> <VALUES>");
847
		list->pushBack("# Ship Components, each component used in the ships scene: <SECTION> <MODELENTRY> <VALUES>");
848
		for(CListNode<SComponent> *node = m_lComponent.Front(); node; node = node->next()) {
848
		for(CListNode<SComponent> *node = m_lComponent.Front(); node; node = node->next()) {
849
			list->PushBack(CyString("Component: ") + node->Data()->sSection + " " + node->Data()->sSection2 + " " + node->Data()->sData);
849
			list->pushBack(Utils::String("Component: ") + node->Data()->sSection + " " + node->Data()->sSection2 + " " + node->Data()->sData);
850
		}
850
		}
851
		list->PushBack("");
851
		list->pushBack("");
852
	}
852
	}
853
 
853
 
854
	if ( this->m_lDummy.size() ) {
854
	if ( this->m_lDummy.size() ) {
855
		list->PushBack("# Ship Dummies, each dummy entry used in the ships scene: <SECTION> <VALUE>");
855
		list->pushBack("# Ship Dummies, each dummy entry used in the ships scene: <SECTION> <VALUE>");
856
		for(CListNode<SDummy> *node = m_lDummy.Front(); node; node = node->next()) {
856
		for(CListNode<SDummy> *node = m_lDummy.Front(); node; node = node->next()) {
857
			list->PushBack(CyString("Dummy: ") + node->Data()->sSection + " " + node->Data()->sData);
857
			list->pushBack("Dummy: " + node->Data()->sSection + " " + node->Data()->sData);
858
		}
858
		}
859
		list->PushBack("");
859
		list->pushBack("");
860
	}
860
	}
861
 
861
 
862
	if ( this->m_lCockpit.size() ) {
862
	if ( this->m_lCockpit.size() ) {
863
		list->PushBack("# Cockpit entries, each cockpit value with thier weapons mask");
863
		list->pushBack("# Cockpit entries, each cockpit value with thier weapons mask");
864
		for(CListNode<SCockpit> *node = m_lCockpit.Front(); node; node = node->next()) {
864
		for(CListNode<SCockpit> *node = m_lCockpit.Front(); node; node = node->next()) {
865
			list->PushBack(CyString("Cockpit: ") + node->Data()->sCockpit.token(";", 19) + " " + node->Data()->sCockpit);
865
			list->pushBack("Cockpit: " + node->Data()->sCockpit.token(";", 19) + " " + node->Data()->sCockpit);
866
			for(SWeaponMask *mask = node->Data()->lWeaponMask.First(); mask; mask = node->Data()->lWeaponMask.Next()) {
866
			for(SWeaponMask *mask = node->Data()->lWeaponMask.First(); mask; mask = node->Data()->lWeaponMask.Next()) {
867
				list->PushBack(CyString("CockpitWeapon: ") + node->Data()->sCockpit.token(";", 19) + " " + (long)mask->iGame + " " + (long)mask->iMask);
867
				list->pushBack("CockpitWeapon: " + node->Data()->sCockpit.token(";", 19) + " " + (long)mask->iGame + " " + (long)mask->iMask);
868
			}
868
			}
869
		}
869
		}
870
 
870
 
871
		list->PushBack("");
871
		list->pushBack("");
872
	}
872
	}
873
 
873
 
874
	if ( !this->m_lCutData.Empty() ) {
874
	if ( !this->m_lCutData.Empty() ) {
875
		list->PushBack("# Ship Cut Data");
875
		list->pushBack("# Ship Cut Data");
876
		for(SStringList *str = m_lCutData.Head(); str; str = str->next) {
876
		for(SStringList *str = m_lCutData.Head(); str; str = str->next) {
877
			list->PushBack(CyString(";CutData: &quot;) + str->str);
877
			list->pushBack(Utils::String(";CutData: &quot;) + str->str.ToString());
878
		}
878
		}
879
		list->PushBack("");
879
		list->pushBack("");
880
	}
880
	}
881
 
881
 
882
	if ( !this->m_lBodies.Empty() ) {
882
	if ( !this->m_lBodies.Empty() ) {
883
		list->PushBack("# Ship Bodies");
883
		list->pushBack("# Ship Bodies");
884
		for(SStringList *str = m_lBodies.Head(); str; str = str->next) {
884
		for(SStringList *str = m_lBodies.Head(); str; str = str->next) {
885
			list->PushBack(CyString(";Bodies: &quot;) + str->str);
885
			list->pushBack(Utils::String(";Bodies: &quot;) + str->str.ToString());
886
		}
886
		}
887
		list->PushBack("");
887
		list->pushBack("");
888
	}
888
	}
889
 
889
 
890
	if ( !this->m_lAnimations.Empty() ) {
890
	if ( !this->m_lAnimations.Empty() ) {
891
		list->PushBack("# Ship Animations");
891
		list->pushBack("# Ship Animations");
892
		for(SStringList *str = m_lAnimations.Head(); str; str = str->next) {
892
		for(SStringList *str = m_lAnimations.Head(); str; str = str->next) {
893
			list->PushBack(CyString(";Animation: &quot;) + str->str);
893
			list->pushBack(Utils::String(";Animation: &quot;) + str->str.ToString());
894
		}
894
		}
895
		list->PushBack("");
895
		list->pushBack("");
896
	}
896
	}
897
 
897
 
898
	if ( !datafile )
898
	if ( !datafile )
899
	{
899
	{
900
		if ( !CBaseFile::GeneratePackagerScriptFile(wildcard, list) )
900
		if ( !CBaseFile::GeneratePackagerScriptFile(wildcard, list, game) )
901
			return false;
901
			return false;
902
	}
902
	}
903
 
903
 
904
	return true;
904
	return true;
905
}
905
}