Rev 197 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#include "../StdAfx.h"
#include "CustomiseInfo.h"
namespace Creator {
void CustomiseInfo::UpdateDisplay()
{
m_bUpdateing = true;
this->ComboClass->SelectedIndex = CShipData::ConvertShipClassToNum(m_pShipData->iClass);
this->ComboRace->SelectedIndex = m_pShipData->iRace - 1;
this->ComboVariation->SelectedIndex = m_pShipData->iVariation;
this->NumDock->Value = m_pShipData->iDocking;
this->NumCargoMin->Value = m_pShipData->iCargoMin;
this->NumCargoMax->Value = m_pShipData->iCargoMax;
this->ComboCargo->SelectedIndex = m_pShipData->iCargoClass;
this->NumPriceNPC->Value = m_pShipData->iRelVal;
this->NumPricePlayer->Value = m_pShipData->iRelValPlayer;
this->NumNoto->Value = m_pShipData->iMinNoto;
this->ComboSubType->SelectedIndex = m_pShipData->iSubType;
m_bUpdateing = false;
}
void CustomiseInfo::UpdateInfo()
{
m_bUpdateing = true;
// fill race entries
CGameDirectories *game = ((CustomiseShip ^)m_pParent)->gameDirectories();
this->ComboRace->Items->Clear();
for ( int i = 1; i <= 19; i++ )
{
if ( i == 10 ) // special case for player
this->ComboRace->Items->Add("Player");
else
this->ComboRace->Items->Add(_US(game->findText(0, TEXTPAGE_RACE, i, Utils::WString::Number(i))));
}
// fill variation entries
this->ComboVariation->Items->Clear();
this->ComboVariation->Items->Add("Standard");
for ( int i = 1; i <= 20; i++ )
this->ComboVariation->Items->Add(_US(game->findText(0, TEXTPAGE_OBJECTS, 10000 + i, Utils::WString::Number(i))));
// fill ship class entries
this->ComboClass->Items->Clear();
for ( int i = 0; i < OBJ_SHIP_MAX; i++ )
this->ComboClass->Items->Add(_US(game->findText(0, TEXTPAGE_CLASS, CShipData::GetShipClassFromNum(i), CShipData::ConvertShipClass(CShipData::GetShipClassFromNum(i)))));
// the cargo class
this->ComboCargo->Items->Clear();
for ( int i = 0; i < 6; i++ )
{
Utils::WString text = game->findText(0, TEXTPAGE_CARGOCLASS, i + 10);
if ( text.empty() )
text = game->findText(0, TEXTPAGE_CARGOCLASS, i, _WS(this->GetCargoClass(i)));
else
text = text + L" (" + game->findText(0, TEXTPAGE_CARGOCLASS, i, _WS(this->GetCargoClass(i))) + L")";
this->ComboCargo->Items->Add(_US(text));
}
// the sub type
this->ComboSubType->Items->Clear();
for ( int i = 0; i < SG_SH_MAX; i++ )
this->ComboSubType->Items->Add(_US(CShipData::ConvertShipSubType(i)));
this->UpdateNotority();
m_bUpdateing = false;
}
void CustomiseInfo::UpdateNotority()
{
this->ComboNoto->Items->Clear();
CGameDirectories *game = ((CustomiseShip ^)m_pParent)->gameDirectories();
Utils::WString text = game->findText(0, this->GetNotoPage(m_pShipData->iRace), 110);
if ( this->GetNotoPage(m_pShipData->iRace) == 0 || text.empty() )
this->ComboNoto->Enabled = false;
else
{
this->ComboNoto->Enabled = true;
this->ComboNoto->Items->Add("-");
for ( int i = 0; i < 16; i++ )
this->ComboNoto->Items->Add(_US(game->findText(0, this->GetNotoPage(m_pShipData->iRace), 110 - i)));
}
}
String ^CustomiseInfo::GetCargoClass(int i)
{
switch ( i )
{
case 1:
return "S";
case 2:
return "M";
case 3:
return "L";
case 4:
return "XL";
case 5:
return "ST";
}
return "-";
}
int CustomiseInfo::GetNotoPage(int race)
{
switch ( race )
{
case 1: // argon
return 23;
case 2: // boron
return 24;
case 3: // split
return 25;
case 4: // paranid
return 26;
case 5: // teladi
return 27;
case 9: // goner
return 28;
case 18: // terran
return 829;
case 17: // atf
return 830;
default:
return 0;
}
}
int CustomiseInfo::GetNotoAmount(int preset)
{
switch ( preset )
{
case 1:
return 333333;
case 2:
return 100000;
case 3:
return 33333;
case 4:
return 10000;
case 5:
return 3333;
case 6:
return 1000;
case 7:
return 333;
case 8:
return 100;
case 9:
return 33;
case 10:
return 10;
case 11:
return 0;
case 12:
return -11;
case 13:
return -101;
case 14:
return -1001;
case 15:
return -10001;
case 16:
return -100001;
default:
return 0;
}
}
};