| 1 |
#include "stdafx.h" |
| 2 |
#include "CSimpleDialog.h" |
| 3 |
#include "CPopMenu.h" |
| 4 |
#include "CRailPlugin.h" |
| 5 |
#include "CTiePlugin.h" |
| 6 |
#include "CGirderPlugin.h" |
| 7 |
#include "CPierPlugin.h" |
| 8 |
#include "CLinePlugin.h" |
| 9 |
#include "CPolePlugin.h" |
| 10 |
#include "CRailwayPluginSet.h" |
| 11 |
#include "CSkinPlugin.h" |
| 12 |
#include "CRailBuildMode.h" |
| 13 |
|
| 14 |
// 内部定数 |
| 15 |
const char *RPS_DIRNAME = "RailwayPluginSet"; |
| 16 |
|
| 17 |
// 内部グローバル |
| 18 |
CPopMenu *g_RailwayPluginSetMenu = NULL; // プラグインセットメニュー |
| 19 |
list<CRailwayPluginSet> g_RailwayPluginSetList; // プラグインセットリスト |
| 20 |
|
| 21 |
int g_RPSModalState; // モーダル状態 |
| 22 |
string g_RPSTempString; // テンポラリ文字列 |
| 23 |
IRailwayPluginSet g_RPSTarget; // 処理対象 |
| 24 |
IRailwayPluginSet g_RPSErasing; // 削除対象 |
| 25 |
CYesNoDialog *g_RPSYesNoDialog = NULL; // 問合せダイアログ |
| 26 |
CInputDialog *g_RPSInputDialog = NULL; // 入力ダイアログ |
| 27 |
|
| 28 |
/* |
| 29 |
* コンストラクタ |
| 30 |
*/ |
| 31 |
CRailwayPluginSet::CRailwayPluginSet( |
| 32 |
char *name, // 設定名 |
| 33 |
bool create // 現在の設定から作成 |
| 34 |
): |
| 35 |
CPlugin(lang(RailwayTemplate)) // 基本クラス |
| 36 |
{ |
| 37 |
m_Name = name; |
| 38 |
m_Author = "RailSim II"; |
| 39 |
if(!create){ |
| 40 |
m_State = 1; |
| 41 |
return; |
| 42 |
} |
| 43 |
m_State = 2; |
| 44 |
CRailwayMode::GetPlugin(&m_RailPlugin, &m_TiePlugin, |
| 45 |
&m_GirderPlugin, &m_PierPlugin, &m_LinePlugin, &m_PolePlugin); |
| 46 |
m_RailFlag = !!m_RailPlugin; |
| 47 |
m_TieFlag = !!m_TiePlugin; |
| 48 |
m_GirderFlag = !!m_GirderPlugin; |
| 49 |
m_PierFlag = !!m_PierPlugin; |
| 50 |
m_LineFlag = !!m_LinePlugin; |
| 51 |
m_PoleFlag = !!m_PolePlugin; |
| 52 |
if(m_RailPlugin = g_Rail) m_RailID = m_RailPlugin->GetID(); |
| 53 |
if(m_TiePlugin = g_Tie) m_TieID = m_TiePlugin->GetID(); |
| 54 |
if(m_GirderPlugin = g_Girder) m_GirderID = m_GirderPlugin->GetID(); |
| 55 |
if(m_PierPlugin = g_Pier) m_PierID = m_PierPlugin->GetID(); |
| 56 |
if(m_LinePlugin = g_Line) m_LineID = m_LinePlugin->GetID(); |
| 57 |
if(m_PolePlugin = g_Pole) m_PoleID = m_PolePlugin->GetID(); |
| 58 |
m_EnableCant = CRailwayMode::IsCantEnabled(); |
| 59 |
m_LiftRailSurface = CRailwayMode::IsLiftRail(); |
| 60 |
m_MultiTrack = CRailwayMode::IsMultiTrack(); |
| 61 |
m_TrackNum = CRailwayMode::GetTrackNum(); |
| 62 |
m_TrackInterval = CRailwayMode::GetTrackInterval(); |
| 63 |
} |
| 64 |
|
| 65 |
/* |
| 66 |
* デストラクタ |
| 67 |
*/ |
| 68 |
CRailwayPluginSet::~CRailwayPluginSet(){ |
| 69 |
DELETE_A(m_Buffer); |
| 70 |
} |
| 71 |
|
| 72 |
/* |
| 73 |
* 定義ファイルアタッチ |
| 74 |
*/ |
| 75 |
bool CRailwayPluginSet::PreLoadRPS( |
| 76 |
FILE *file // ファイル |
| 77 |
){ |
| 78 |
char *str = m_Buffer = LoadBinaryText(file), *eee; |
| 79 |
try{ |
| 80 |
if(!(str = Space(eee = str))) return false; |
| 81 |
if(!(str = BeginBlock(eee = str, "DatafileHeader"))) return false; |
| 82 |
if(!(str = AsgnFloat(eee = str, "RailSimVersion", &m_Version))) throw CSynErr(eee); |
| 83 |
if(m_Version<2.00f) throw CSynErr(eee, "%s: %.2f", lang(InvalidVersion), m_Version); |
| 84 |
if(RAILSIM_VERSION<m_Version) throw CSynErr(eee, "%s: %.2f", lang(UnsupportedVersion), m_Version); |
| 85 |
string datafiletype; |
| 86 |
if(!(str = AsgnIdentifier(eee = str, "DatafileType", &datafiletype))) throw CSynErr(eee); |
| 87 |
if(datafiletype!=RPS_DIRNAME) throw CSynErr(eee, lang(InvalidDatafileType)); |
| 88 |
if(!(str = EndBlock(eee = str))) throw CSynErr(eee, ERR_ENDBLOCK); |
| 89 |
} |
| 90 |
catch(CSynErr err){ |
| 91 |
HandleError(&err); |
| 92 |
return false; |
| 93 |
} |
| 94 |
m_Script = str; |
| 95 |
return true; |
| 96 |
} |
| 97 |
|
| 98 |
/* |
| 99 |
* 読込 |
| 100 |
*/ |
| 101 |
bool CRailwayPluginSet::Load(){ |
| 102 |
char *str = m_Script, *eee; |
| 103 |
try{ |
| 104 |
if(!(str = BeginBlock(eee = str, "RailwayPluginSet"))) throw CSynErr(eee); |
| 105 |
if(!(str = AsgnString(eee = str, "SettingName", &m_Name))) throw CSynErr(eee); |
| 106 |
m_Name = RestoreDoubleQuote(m_Name); |
| 107 |
if(!(str = AsgnString(eee = str, "RailPlugin", &m_RailID))) throw CSynErr(eee); |
| 108 |
if(!(str = AsgnYesNo(eee = str, "RailCheck", &m_RailFlag))) throw CSynErr(eee); |
| 109 |
if(!(str = AsgnString(eee = str, "TiePlugin", &m_TieID))) throw CSynErr(eee); |
| 110 |
if(!(str = AsgnYesNo(eee = str, "TieCheck", &m_TieFlag))) throw CSynErr(eee); |
| 111 |
if(!(str = AsgnString(eee = str, "GirderPlugin", &m_GirderID))) throw CSynErr(eee); |
| 112 |
if(!(str = AsgnYesNo(eee = str, "GirderCheck", &m_GirderFlag))) throw CSynErr(eee); |
| 113 |
if(!(str = AsgnString(eee = str, "PierPlugin", &m_PierID))) throw CSynErr(eee); |
| 114 |
if(!(str = AsgnYesNo(eee = str, "PierCheck", &m_PierFlag))) throw CSynErr(eee); |
| 115 |
if(!(str = AsgnString(eee = str, "LinePlugin", &m_LineID))) throw CSynErr(eee); |
| 116 |
if(!(str = AsgnYesNo(eee = str, "LineCheck", &m_LineFlag))) throw CSynErr(eee); |
| 117 |
if(!(str = AsgnString(eee = str, "PolePlugin", &m_PoleID))) throw CSynErr(eee); |
| 118 |
if(!(str = AsgnYesNo(eee = str, "PoleCheck", &m_PoleFlag))) throw CSynErr(eee); |
| 119 |
if(!(str = AsgnYesNo(eee = str, "EnableCant", &m_EnableCant))) throw CSynErr(eee); |
| 120 |
if(!(str = AsgnYesNo(eee = str, "LiftRailSurface", &m_LiftRailSurface))) throw CSynErr(eee); |
| 121 |
if(!(str = AsgnYesNo(eee = str, "MultiTrack", &m_MultiTrack))) throw CSynErr(eee); |
| 122 |
if(!(str = AsgnInteger(eee = str, "TrackNum", &m_TrackNum))) throw CSynErr(eee); |
| 123 |
if(!(str = AsgnFloat(eee = str, "TrackInterval", &m_TrackInterval))) throw CSynErr(eee); |
| 124 |
if(!(str = EndBlock(eee = str))) throw CSynErr(eee, ERR_ENDBLOCK); |
| 125 |
} |
| 126 |
catch(CSynErr err){ |
| 127 |
HandleError(&err); |
| 128 |
return false; |
| 129 |
} |
| 130 |
m_RailPlugin = m_RailID.size() |
| 131 |
? g_RailPluginList->FindPlugin(m_RailID.c_str()) : NULL; |
| 132 |
m_TiePlugin = m_TieID.size() |
| 133 |
? g_TiePluginList->FindPlugin(m_TieID.c_str()) : NULL; |
| 134 |
m_GirderPlugin = m_GirderID.size() |
| 135 |
? g_GirderPluginList->FindPlugin(m_GirderID.c_str()) : NULL; |
| 136 |
m_PierPlugin = m_PierID.size() |
| 137 |
? g_PierPluginList->FindPlugin(m_PierID.c_str()) : NULL; |
| 138 |
m_LinePlugin = m_LineID.size() |
| 139 |
? g_LinePluginList->FindPlugin(m_LineID.c_str()) : NULL; |
| 140 |
m_PolePlugin = m_PoleID.size() |
| 141 |
? g_PolePluginList->FindPlugin(m_PoleID.c_str()) : NULL; |
| 142 |
DELETE_A(m_Buffer); |
| 143 |
return true; |
| 144 |
} |
| 145 |
|
| 146 |
/* |
| 147 |
* 保存 |
| 148 |
*/ |
| 149 |
void CRailwayPluginSet::Save( |
| 150 |
FILE *file // 設定ファイル |
| 151 |
){ |
| 152 |
fprintf(file, "DatafileHeader{\n"); |
| 153 |
fprintf(file, "\tRailSimVersion = %.2f;\n", RAILSIM_VERSION); |
| 154 |
fprintf(file, "\tDatafileType = %s;\n", DirName()); |
| 155 |
fprintf(file, "}\n\n"); |
| 156 |
fprintf(file, "RailwayPluginSet{\n"); |
| 157 |
fprintf(file, "\tSettingName = \"%s\";\n", ExpandDoubleQuote(m_Name).c_str()); |
| 158 |
fprintf(file, "\tRailPlugin = \"%s\";\n", m_RailID.c_str()); |
| 159 |
fprintf(file, "\tRailCheck = %s;\n", YESNO[m_RailFlag]); |
| 160 |
fprintf(file, "\tTiePlugin = \"%s\";\n", m_TieID.c_str()); |
| 161 |
fprintf(file, "\tTieCheck = %s;\n", YESNO[m_TieFlag]); |
| 162 |
fprintf(file, "\tGirderPlugin = \"%s\";\n", m_GirderID.c_str()); |
| 163 |
fprintf(file, "\tGirderCheck = %s;\n", YESNO[m_GirderFlag]); |
| 164 |
fprintf(file, "\tPierPlugin = \"%s\";\n", m_PierID.c_str()); |
| 165 |
fprintf(file, "\tPierCheck = %s;\n", YESNO[m_PierFlag]); |
| 166 |
fprintf(file, "\tLinePlugin = \"%s\";\n", m_LineID.c_str()); |
| 167 |
fprintf(file, "\tLineCheck = %s;\n", YESNO[m_LineFlag]); |
| 168 |
fprintf(file, "\tPolePlugin = \"%s\";\n", m_PoleID.c_str()); |
| 169 |
fprintf(file, "\tPoleCheck = %s;\n", YESNO[m_PoleFlag]); |
| 170 |
fprintf(file, "\tEnableCant = %s;\n", YESNO[m_EnableCant]); |
| 171 |
fprintf(file, "\tLiftRailSurface = %s;\n", YESNO[m_LiftRailSurface]); |
| 172 |
fprintf(file, "\tMultiTrack = %s;\n", YESNO[m_MultiTrack]); |
| 173 |
fprintf(file, "\tTrackNum = %d;\n", m_TrackNum); |
| 174 |
fprintf(file, "\tTrackInterval = %f;\n", m_TrackInterval); |
| 175 |
fprintf(file, "}\n"); |
| 176 |
} |
| 177 |
|
| 178 |
/* |
| 179 |
* データファイル削除 |
| 180 |
*/ |
| 181 |
bool CRailwayPluginSet::DeleteFromDisk(){ |
| 182 |
if(chdir(g_BaseDir) || chdir(DirName()) || remove(TextName2())){ |
| 183 |
EnqueueCommonDialog(new CSimpleDialog( |
| 184 |
lang(ErrorDuringDelete), TextName2())); |
| 185 |
g_Skin->Error(); |
| 186 |
return false; |
| 187 |
} |
| 188 |
return true; |
| 189 |
} |
| 190 |
|
| 191 |
/* |
| 192 |
* データファイル名変更 |
| 193 |
*/ |
| 194 |
bool CRailwayPluginSet::Rename( |
| 195 |
string &newname // 新規名 |
| 196 |
){ |
| 197 |
string fname2 = FlashIn("%s.txt", newname.c_str()); |
| 198 |
if(CheckSlash(fname2.c_str()) || chdir(g_BaseDir) || chdir(DirName()) || |
| 199 |
(remove(fname2.c_str()), rename(TextName2(), fname2.c_str()))){ |
| 200 |
EnqueueCommonDialog(new CSimpleDialog( |
| 201 |
lang(ErrorDuringRename), TextName2())); |
| 202 |
g_Skin->Error(); |
| 203 |
return false; |
| 204 |
} |
| 205 |
m_Name = newname; |
| 206 |
return true; |
| 207 |
} |
| 208 |
|
| 209 |
/* |
| 210 |
* プラグインセット適用 |
| 211 |
*/ |
| 212 |
void CRailwayPluginSet::Apply(){ |
| 213 |
LoadAndGet(); |
| 214 |
g_Rail = m_RailPlugin; |
| 215 |
g_Tie = m_TiePlugin; |
| 216 |
g_Girder = m_GirderPlugin; |
| 217 |
g_Pier = m_PierPlugin; |
| 218 |
g_Line = m_LinePlugin; |
| 219 |
g_Pole = m_PolePlugin; |
| 220 |
CRailwayMode::SetRailwayOption( |
| 221 |
m_RailFlag, m_TieFlag, m_GirderFlag, m_PierFlag, m_LineFlag, m_PoleFlag, |
| 222 |
m_EnableCant, m_LiftRailSurface, m_MultiTrack, m_TrackNum, m_TrackInterval); |
| 223 |
} |
| 224 |
|
| 225 |
//////////////////////////////////////////////////////////////////////////////// |
| 226 |
//////////////////////////////////////////////////////////////////////////////// |
| 227 |
|
| 228 |
/* |
| 229 |
* 設定リスト読込 |
| 230 |
*/ |
| 231 |
void LoadRailwayPluginSetList(){ |
| 232 |
long filelist; |
| 233 |
_finddata_t data; |
| 234 |
if(chdir(g_BaseDir) || chdir(RPS_DIRNAME)) return; |
| 235 |
if((filelist = _findfirst("*.txt", &data))>=0){ |
| 236 |
do{ |
| 237 |
FILE *file; |
| 238 |
if(data.attrib&_A_SUBDIR) continue; |
| 239 |
string name = data.name; |
| 240 |
name[name.size()-4] = 0; |
| 241 |
g_RailwayPluginSetList.push_back(CRailwayPluginSet((char *)name.c_str(), false)); |
| 242 |
CRailwayPluginSet *rps = &*g_RailwayPluginSetList.rbegin(); |
| 243 |
if(file = fopen(data.name, "rb")){ |
| 244 |
if(!rps->PreLoadRPS(file)){ |
| 245 |
g_RailwayPluginSetList.pop_back(); |
| 246 |
continue; |
| 247 |
} |
| 248 |
}else{ |
| 249 |
g_RailwayPluginSetList.pop_back(); |
| 250 |
continue; |
| 251 |
} |
| 252 |
} while(!_findnext(filelist, &data)); |
| 253 |
_findclose(filelist); |
| 254 |
} |
| 255 |
g_RailwayPluginSetList.sort(); |
| 256 |
} |
| 257 |
|
| 258 |
/* |
| 259 |
* プラグインセット検索 |
| 260 |
*/ |
| 261 |
IRailwayPluginSet FindRailwayPluginSet( |
| 262 |
string name // 設定名 |
| 263 |
){ |
| 264 |
IRailwayPluginSet irps = g_RailwayPluginSetList.begin(); |
| 265 |
for(; irps!=g_RailwayPluginSetList.end(); irps++) |
| 266 |
if(name==irps->GetNameRef()) return irps; |
| 267 |
return irps; |
| 268 |
} |
| 269 |
|
| 270 |
/* |
| 271 |
* プラグインセット追加 |
| 272 |
*/ |
| 273 |
void AddRailwayPluginSet( |
| 274 |
string name, // 設定名 |
| 275 |
bool over // 上書き |
| 276 |
){ |
| 277 |
if(!name.size()) return; |
| 278 |
IRailwayPluginSet irps = FindRailwayPluginSet(name); |
| 279 |
if(irps!=g_RailwayPluginSetList.end()){ |
| 280 |
if(over){ |
| 281 |
if(!irps->DeleteFromDisk()) return; |
| 282 |
g_RailwayPluginSetList.erase(irps); |
| 283 |
}else{ |
| 284 |
g_RPSModalState = 11; |
| 285 |
g_RPSTempString = string(name); |
| 286 |
g_ModalDialog = g_RPSYesNoDialog = new CYesNoDialog( |
| 287 |
lang(ReplaceCfmMessage), (char *)name.c_str(), false); |
| 288 |
return; |
| 289 |
} |
| 290 |
} |
| 291 |
char *fname = FlashIn("%s.txt", name.c_str()); |
| 292 |
FILE *file; |
| 293 |
if(CheckSlash(fname) || chdir(g_BaseDir) || chdir(RPS_DIRNAME) |
| 294 |
|| !(file = fopen(fname, "wt"))){ |
| 295 |
EnqueueCommonDialog(new CSimpleDialog( |
| 296 |
lang(CannotOpen_CheckFileName), fname)); |
| 297 |
return; |
| 298 |
} |
| 299 |
g_RailwayPluginSetList.push_back(CRailwayPluginSet((char *)name.c_str(), true)); |
| 300 |
g_RailwayPluginSetList.rbegin()->Save(file); |
| 301 |
fclose(file); |
| 302 |
g_RailwayPluginSetList.sort(); |
| 303 |
ListRailwayPluginSet(); |
| 304 |
} |
| 305 |
|
| 306 |
/* |
| 307 |
* プラグインセットリストアップ |
| 308 |
*/ |
| 309 |
void ListRailwayPluginSet(){ |
| 310 |
class CSettingAdder: public CMenuCommand{ |
| 311 |
public: |
| 312 |
void Exec(){ |
| 313 |
g_RPSModalState = 10; |
| 314 |
g_ModalDialog = g_RPSInputDialog = new CInputDialog( |
| 315 |
lang(FileNameInquireMessage), lang(SaveSettings), "", 64); |
| 316 |
} |
| 317 |
}; |
| 318 |
class CSettingApplier: public CMenuCommand{ |
| 319 |
private: |
| 320 |
IRailwayPluginSet m_PluginSet; // プラグインセット |
| 321 |
public: |
| 322 |
CSettingApplier(IRailwayPluginSet s){ m_PluginSet = s; } |
| 323 |
void Exec(){ m_PluginSet->Apply(); } |
| 324 |
}; |
| 325 |
class CSettingDeleter: public CMenuCommand{ |
| 326 |
private: |
| 327 |
IRailwayPluginSet m_PluginSet; // プラグインセット |
| 328 |
public: |
| 329 |
CSettingDeleter(IRailwayPluginSet s){ m_PluginSet = s; } |
| 330 |
void Exec(){ |
| 331 |
g_RPSModalState = 21; |
| 332 |
g_RPSErasing = m_PluginSet; |
| 333 |
g_ModalDialog = g_RPSYesNoDialog = new CYesNoDialog( |
| 334 |
lang(SettingDeleteCfmMessage), |
| 335 |
(char *)m_PluginSet->GetName(), false); |
| 336 |
} |
| 337 |
}; |
| 338 |
class CSettingRenamer: public CMenuCommand{ |
| 339 |
private: |
| 340 |
IRailwayPluginSet m_PluginSet; // プラグインセット |
| 341 |
public: |
| 342 |
CSettingRenamer(IRailwayPluginSet s){ m_PluginSet = s; } |
| 343 |
void Exec(){ |
| 344 |
g_RPSModalState = 30; |
| 345 |
g_RPSTarget = m_PluginSet; |
| 346 |
g_ModalDialog = g_RPSInputDialog = new CInputDialog( |
| 347 |
lang(FileNameInquireMessage), lang(ChangeName), m_PluginSet->GetName(), 64); |
| 348 |
} |
| 349 |
}; |
| 350 |
DELETE_V(g_RailwayPluginSetMenu); |
| 351 |
g_RailwayPluginSetMenu = new CPopMenu("", NULL); |
| 352 |
(new CPopMenu(lang(SaveSettingNew), g_RailwayPluginSetMenu))->SetCommand(new CSettingAdder); |
| 353 |
new CPopMenu("-", g_RailwayPluginSetMenu); |
| 354 |
IRailwayPluginSet irps = g_RailwayPluginSetList.begin(); |
| 355 |
for(; irps!=g_RailwayPluginSetList.end(); irps++){ |
| 356 |
CPopMenu *entry = new CPopMenu(irps->GetName(), g_RailwayPluginSetMenu); |
| 357 |
(new CPopMenu(lang(Apply), entry))->SetCommand(new CSettingApplier(irps)); |
| 358 |
(new CPopMenu(lang(Delete), entry))->SetCommand(new CSettingDeleter(irps)); |
| 359 |
(new CPopMenu(lang(ChangeName), entry))->SetCommand(new CSettingRenamer(irps)); |
| 360 |
} |
| 361 |
} |
| 362 |
|
| 363 |
/* |
| 364 |
* モーダル処理 |
| 365 |
*/ |
| 366 |
void ModalFuncRailwayPluginSet(){ |
| 367 |
if(g_RPSInputDialog){ |
| 368 |
if(g_RPSInputDialog->CheckOK()){ |
| 369 |
g_RPSTempString = g_RPSInputDialog->GetInputText(); |
| 370 |
DELETE_V(g_ModalDialog); |
| 371 |
g_RPSInputDialog = NULL; |
| 372 |
switch(g_RPSModalState){ |
| 373 |
case 10: // add new setting |
| 374 |
AddRailwayPluginSet((char *)g_RPSTempString.c_str(), false); |
| 375 |
break; |
| 376 |
case 30: |
| 377 |
if(g_RPSTarget->GetNameRef()==g_RPSTempString) break; |
| 378 |
g_RPSErasing = FindRailwayPluginSet((char *)g_RPSTempString.c_str()); |
| 379 |
if(g_RPSErasing!=g_RailwayPluginSetList.end()){ |
| 380 |
g_RPSModalState = 31; |
| 381 |
g_ModalDialog = g_RPSYesNoDialog = new CYesNoDialog( |
| 382 |
FlashIn("\"%s\": %s", (char *)g_RPSTempString.c_str(), |
| 383 |
lang(ReplaceCfmMessage)), lang(OverlappedSettingName), false); |
| 384 |
return; |
| 385 |
}else{ |
| 386 |
if(!g_RPSTarget->Rename(g_RPSTempString)) return; |
| 387 |
g_RailwayPluginSetList.sort(); |
| 388 |
ListRailwayPluginSet(); |
| 389 |
} |
| 390 |
break; |
| 391 |
} |
| 392 |
}else if(g_RPSInputDialog->CheckCancel()){ |
| 393 |
DELETE_V(g_ModalDialog); |
| 394 |
g_RPSInputDialog = NULL; |
| 395 |
} |
| 396 |
} |
| 397 |
if(g_RPSYesNoDialog){ |
| 398 |
if(g_RPSYesNoDialog->CheckYes()){ |
| 399 |
DELETE_V(g_ModalDialog); |
| 400 |
g_RPSYesNoDialog = NULL; |
| 401 |
switch(g_RPSModalState){ |
| 402 |
case 11: // add new setting confirmed overwrite |
| 403 |
AddRailwayPluginSet((char *)g_RPSTempString.c_str(), true); |
| 404 |
break; |
| 405 |
case 21: |
| 406 |
if(!g_RPSErasing->DeleteFromDisk()) return; |
| 407 |
g_RailwayPluginSetList.erase(g_RPSErasing); |
| 408 |
ListRailwayPluginSet(); |
| 409 |
break; |
| 410 |
case 31: |
| 411 |
if(!g_RPSErasing->DeleteFromDisk()) return; |
| 412 |
g_RailwayPluginSetList.erase(g_RPSErasing); |
| 413 |
if(!g_RPSTarget->Rename(g_RPSTempString)) return; |
| 414 |
g_RailwayPluginSetList.sort(); |
| 415 |
ListRailwayPluginSet(); |
| 416 |
break; |
| 417 |
} |
| 418 |
}else if(g_RPSYesNoDialog->CheckNo()){ |
| 419 |
DELETE_V(g_ModalDialog); |
| 420 |
g_RPSYesNoDialog = NULL; |
| 421 |
} |
| 422 |
} |
| 423 |
} |