Rev 1 | Rev 197 | Go to most recent revision | 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 entriesCGameDirectories *game = ((CustomiseShip ^)m_pParent)->gameDirectories();this->ComboRace->Items->Clear();for ( int i = 1; i <= 19; i++ ){if ( i == 10 ) // special case for playerthis->ComboRace->Items->Add("Player");elsethis->ComboRace->Items->Add(_US(game->findText(0, TEXTPAGE_RACE, i, Utils::String::Number(i))));}// fill variation entriesthis->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::String::Number(i))));// fill ship class entriesthis->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 classthis->ComboCargo->Items->Clear();for ( int i = 0; i < 6; i++ ){Utils::String text = game->findText(0, TEXTPAGE_CARGOCLASS, i + 10);if ( text.empty() )text = game->findText(0, TEXTPAGE_CARGOCLASS, i, _S(this->GetCargoClass(i)));elsetext = text + " (" + game->findText(0, TEXTPAGE_CARGOCLASS, i, _S(this->GetCargoClass(i))) + ")";this->ComboCargo->Items->Add(_US(text));}// the sub typethis->ComboSubType->Items->Clear();for ( int i = 0; i < SG_SH_MAX; i++ )this->ComboSubType->Items->Add(SystemStringFromCyString(CShipData::ConvertShipSubType(i)));this->UpdateNotority();m_bUpdateing = false;}void CustomiseInfo::UpdateNotority(){this->ComboNoto->Items->Clear();CGameDirectories *game = ((CustomiseShip ^)m_pParent)->gameDirectories();Utils::String 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: // argonreturn 23;case 2: // boronreturn 24;case 3: // splitreturn 25;case 4: // paranidreturn 26;case 5: // teladireturn 27;case 9: // gonerreturn 28;case 18: // terranreturn 829;case 17: // atfreturn 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;}}};