Subversion Repositories spk

Rev

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

Rev 98 Rev 126
Line 690... Line 690...
690
		return false;
690
		return false;
691
 
691
 
692
	return true;
692
	return true;
693
}
693
}
694
 
694
 
695
bool CSpkFile::GeneratePackagerScript(bool wildcard, CyStringList *list, bool datafile)
695
bool CSpkFile::GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, bool datafile)
696
{
696
{
697
	if ( !CBaseFile::GeneratePackagerScript(wildcard, list, datafile) )
697
	if ( !CBaseFile::GeneratePackagerScript(wildcard, list, game, datafile) )
698
		return false;
698
		return false;
699
 
699
 
700
	list->PushBack("# File Type, Script or Ship");
700
	list->pushBack("# File Type, Script or Ship");
701
	list->PushBack("FileType: Script");
701
	list->pushBack("FileType: Script");
702
	list->PushBack("");
702
	list->pushBack("");
703
 
703
 
704
	list->PushBack("# Script Type, the type of package file, some are special types, others are just for show");
704
	list->pushBack("# Script Type, the type of package file, some are special types, others are just for show");
705
	if ( this->IsLibrary() )
705
	if ( this->IsLibrary() )
706
		list->PushBack("ScriptType: Library");
706
		list->pushBack("ScriptType: Library");
707
	else if ( this->IsPackageUpdate() )
707
	else if ( this->IsPackageUpdate() )
708
		list->PushBack("ScriptType: Package Update");
708
		list->pushBack("ScriptType: Package Update");
709
	else if ( this->IsCustomStart() )
709
	else if ( this->IsCustomStart() )
710
		list->PushBack("ScriptType: Custom Start");
710
		list->pushBack("ScriptType: Custom Start");
711
	else if ( this->IsPatch() )
711
	else if ( this->IsPatch() )
712
		list->PushBack("ScriptType: Patch");
712
		list->pushBack("ScriptType: Patch");
713
	else
713
	else
714
		list->PushBack(CyString("ScriptType: ") + this->GetScriptTypeString(44));
714
		list->pushBack("ScriptType: " + this->GetScriptTypeString(44));
715
	list->PushBack("");
715
	list->pushBack("");
716
 
716
 
717
	if ( this->IsAnotherMod() )
717
	if ( this->IsAnotherMod() )
718
	{
718
	{
719
		list->PushBack("# For another mod/package, this is a child package");
719
		list->pushBack("# For another mod/package, this is a child package");
720
		list->PushBack(CyString("AnotherMod: ") + m_sOtherName + "|" + m_sOtherAuthor);
720
		list->pushBack("AnotherMod: " + m_sOtherName + "|" + m_sOtherAuthor);
721
		list->PushBack("");
721
		list->pushBack("");
722
	}
722
	}
723
 
723
 
724
	if ( !m_lWares.empty() )
724
	if ( !m_lWares.empty() )
725
	{
725
	{
726
		list->PushBack("# Custom Wares, Ware<type>: <id> <price> <size> <volumn> <notority>");
726
		list->pushBack("# Custom Wares, Ware<type>: <id> <price> <size> <volumn> <notority>");
727
		for ( CListNode<SWares> *node = m_lWares.Front(); node; node = node->next() )
727
		for ( CListNode<SWares> *node = m_lWares.Front(); node; node = node->next() )
728
		{
728
		{
729
			SWares *w = node->Data();
729
			SWares *w = node->Data();
730
			if ( w->iTextID > 0 )
730
			if ( w->iTextID > 0 )
731
				list->PushBack(CyString("Ware") + (char)w->cType + ": " + w->sID + " " + (long)w->iPrice + " " + (long)w->iSize + " " + (long)w->iVolumn + " " + (long)w->iNotority + " " + (long)w->iTextPage + "," + (long)w->iTextID);
731
				list->pushBack(Utils::String("Ware") + (char)w->cType + ": " + w->sID + " " + (long)w->iPrice + " " + (long)w->iSize + " " + (long)w->iVolumn + " " + (long)w->iNotority + " " + (long)w->iTextPage + "," + (long)w->iTextID);
732
			else
732
			else
733
				list->PushBack(CyString("Ware") + (char)w->cType + ": " + w->sID + " " + (long)w->iPrice + " " + (long)w->iSize + " " + (long)w->iVolumn + " " + (long)w->iNotority);
733
				list->pushBack(Utils::String("Ware") + (char)w->cType + ": " + w->sID + " " + (long)w->iPrice + " " + (long)w->iSize + " " + (long)w->iVolumn + " " + (long)w->iNotority);
734
			for ( CListNode<SWaresText> *wNode = w->lText.Front(); wNode; wNode = wNode->next() )
734
			for ( CListNode<SWaresText> *wNode = w->lText.Front(); wNode; wNode = wNode->next() )
735
			{
735
			{
736
				SWaresText *wt = wNode->Data();
736
				SWaresText *wt = wNode->Data();
737
				if ( !wt->sName.empty() )
737
				if ( !wt->sName.empty() )
738
					list->PushBack(CyString("WareName: ") + w->sID + " " + (long)wt->iLang + " " + wt->sName);
738
					list->pushBack("WareName: " + w->sID + " " + (long)wt->iLang + " " + wt->sName);
739
				if ( !wt->sDesc.empty() )
739
				if ( !wt->sDesc.empty() )
740
					list->PushBack(CyString("WareDesc: ") + w->sID + " " + (long)wt->iLang + " " + wt->sDesc);
740
					list->pushBack("WareDesc: " + w->sID + " " + (long)wt->iLang + " " + wt->sDesc);
741
			}
741
			}
742
			list->PushBack("");
742
			list->pushBack("");
743
		}
743
		}
744
	}
744
	}
745
 
745
 
746
	if ( !datafile )
746
	if ( !datafile )
747
	{
747
	{
748
		if ( !CBaseFile::GeneratePackagerScriptFile(wildcard, list) )
748
		if ( !CBaseFile::GeneratePackagerScriptFile(wildcard, list, game) )
749
			return false;
749
			return false;
750
	}
750
	}
751
 
751
 
752
	return true;
752
	return true;
753
 
753