MoreParmsDialog.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // FILE: MoreParmsDialog.cpp
  19. /*---------------------------------------------------------------------------*/
  20. /* EA Pacific */
  21. /* Confidential Information */
  22. /* Copyright (C) 2001 - All Rights Reserved */
  23. /* DO NOT DISTRIBUTE */
  24. /*---------------------------------------------------------------------------*/
  25. /* Project: RTS3 */
  26. /* File name: MoreParmsDialog.cpp */
  27. /* Created: John K. McDonald, Jr., 3/23/2002 */
  28. /* Desc: Additional particle system parameters */
  29. /* Revision History: */
  30. /* 3/23/2002 : Initial creation */
  31. /*---------------------------------------------------------------------------*/
  32. #include "StdAfx.h"
  33. #include "MoreParmsDialog.h"
  34. #include "ParticleEditorDialog.h"
  35. #define ARBITRARY_BUFF_SIZE 128
  36. MoreParmsDialog::MoreParmsDialog(UINT nIDTemplate, CWnd* pParentWnd) : CDialog(nIDTemplate, pParentWnd)
  37. {
  38. }
  39. MoreParmsDialog::~MoreParmsDialog()
  40. {
  41. }
  42. void MoreParmsDialog::InitPanel( void )
  43. {
  44. CComboBox* pCombo;
  45. pCombo = (CComboBox*) GetDlgItem(IDC_PSEd_WindMotion);
  46. if (pCombo) {
  47. for (int i = 1; WindMotionNames[i]; ++i) {
  48. pCombo->AddString(WindMotionNames[i]);
  49. }
  50. pCombo->SetCurSel(0);
  51. }
  52. }
  53. void MoreParmsDialog::performUpdate( IN Bool toUI )
  54. {
  55. static char buff[ARBITRARY_BUFF_SIZE];
  56. DebugWindowDialog *pParent = (DebugWindowDialog*) GetParent();
  57. if (!pParent) {
  58. return;
  59. }
  60. { // Update all fields on this panel.
  61. CWnd *pWnd;
  62. { // initial delay
  63. Real initialDelay;
  64. pWnd = GetDlgItem(IDC_PSEd_InitialDelayMin);
  65. if (pWnd) {
  66. if (toUI) {
  67. pParent->getInitialDelayFromSystem(0, initialDelay);
  68. sprintf(buff, FORMAT_STRING, initialDelay);
  69. pWnd->SetWindowText(buff);
  70. } else {
  71. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  72. initialDelay = atof(buff);
  73. pParent->updateInitialDelayToSystem(0, initialDelay);
  74. }
  75. }
  76. pWnd = GetDlgItem(IDC_PSEd_InitialDelayMax);
  77. if (pWnd) {
  78. if (toUI) {
  79. pParent->getInitialDelayFromSystem(1, initialDelay);
  80. sprintf(buff, FORMAT_STRING, initialDelay);
  81. pWnd->SetWindowText(buff);
  82. } else {
  83. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  84. initialDelay = atof(buff);
  85. pParent->updateInitialDelayToSystem(1, initialDelay);
  86. }
  87. }
  88. }
  89. { // burst delay
  90. Real burstDelay;
  91. pWnd = GetDlgItem(IDC_PSEd_BurstDelayMin);
  92. if (pWnd) {
  93. if (toUI) {
  94. pParent->getBurstDelayFromSystem(0, burstDelay);
  95. sprintf(buff, FORMAT_STRING, burstDelay);
  96. pWnd->SetWindowText(buff);
  97. } else {
  98. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  99. burstDelay = atof(buff);
  100. pParent->updateBurstDelayToSystem(0, burstDelay);
  101. }
  102. }
  103. pWnd = GetDlgItem(IDC_PSEd_BurstDelayMax);
  104. if (pWnd) {
  105. if (toUI) {
  106. pParent->getBurstDelayFromSystem(1, burstDelay);
  107. sprintf(buff, FORMAT_STRING, burstDelay);
  108. pWnd->SetWindowText(buff);
  109. } else {
  110. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  111. burstDelay = atof(buff);
  112. pParent->updateBurstDelayToSystem(1, burstDelay);
  113. }
  114. }
  115. }
  116. { // burst count
  117. Real burstCount;
  118. pWnd = GetDlgItem(IDC_PSEd_BurstCountMin);
  119. if (pWnd) {
  120. if (toUI) {
  121. pParent->getBurstCountFromSystem(0, burstCount);
  122. sprintf(buff, FORMAT_STRING, burstCount);
  123. pWnd->SetWindowText(buff);
  124. } else {
  125. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  126. burstCount = atof(buff);
  127. pParent->updateBurstCountToSystem(0, burstCount);
  128. }
  129. }
  130. pWnd = GetDlgItem(IDC_PSEd_BurstCountMax);
  131. if (pWnd) {
  132. if (toUI) {
  133. pParent->getBurstCountFromSystem(1, burstCount);
  134. sprintf(buff, FORMAT_STRING, burstCount);
  135. pWnd->SetWindowText(buff);
  136. } else {
  137. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  138. burstCount = atof(buff);
  139. pParent->updateBurstCountToSystem(1, burstCount);
  140. }
  141. }
  142. }
  143. { // color scale
  144. Real colorScale;
  145. pWnd = GetDlgItem(IDC_PSEd_ColorScaleMin);
  146. if (pWnd) {
  147. if (toUI) {
  148. pParent->getColorScaleFromSystem(0, colorScale);
  149. sprintf(buff, FORMAT_STRING, colorScale);
  150. pWnd->SetWindowText(buff);
  151. } else {
  152. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  153. colorScale = atof(buff);
  154. pParent->updateColorScaleToSystem(0, colorScale);
  155. }
  156. }
  157. pWnd = GetDlgItem(IDC_PSEd_ColorScaleMax);
  158. if (pWnd) {
  159. if (toUI) {
  160. pParent->getColorScaleFromSystem(1, colorScale);
  161. sprintf(buff, FORMAT_STRING, colorScale);
  162. pWnd->SetWindowText(buff);
  163. } else {
  164. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  165. colorScale = atof(buff);
  166. pParent->updateColorScaleToSystem(1, colorScale);
  167. }
  168. }
  169. }
  170. { // particle lifetime
  171. Real particleLifetime;
  172. pWnd = GetDlgItem(IDC_PSEd_ParticleLifetimeMin);
  173. if (pWnd) {
  174. if (toUI) {
  175. pParent->getParticleLifetimeFromSystem(0, particleLifetime);
  176. sprintf(buff, FORMAT_STRING, particleLifetime);
  177. pWnd->SetWindowText(buff);
  178. } else {
  179. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  180. particleLifetime = atof(buff);
  181. pParent->updateParticleLifetimeToSystem(0, particleLifetime);
  182. }
  183. }
  184. pWnd = GetDlgItem(IDC_PSEd_ParticleLifetimeMax);
  185. if (pWnd) {
  186. if (toUI) {
  187. pParent->getParticleLifetimeFromSystem(1, particleLifetime);
  188. sprintf(buff, FORMAT_STRING, particleLifetime);
  189. pWnd->SetWindowText(buff);
  190. } else {
  191. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  192. particleLifetime = atof(buff);
  193. pParent->updateParticleLifetimeToSystem(1, particleLifetime);
  194. }
  195. }
  196. }
  197. { // particle size
  198. Real particleSize;
  199. pWnd = GetDlgItem(IDC_PSEd_SizeMin);
  200. if (pWnd) {
  201. if (toUI) {
  202. pParent->getParticleSizeFromSystem(0, particleSize);
  203. sprintf(buff, FORMAT_STRING, particleSize);
  204. pWnd->SetWindowText(buff);
  205. } else {
  206. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  207. particleSize = atof(buff);
  208. pParent->updateParticleSizeToSystem(0, particleSize);
  209. }
  210. }
  211. pWnd = GetDlgItem(IDC_PSEd_SizeMax);
  212. if (pWnd) {
  213. if (toUI) {
  214. pParent->getParticleSizeFromSystem(1, particleSize);
  215. sprintf(buff, FORMAT_STRING, particleSize);
  216. pWnd->SetWindowText(buff);
  217. } else {
  218. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  219. particleSize = atof(buff);
  220. pParent->updateParticleSizeToSystem(1, particleSize);
  221. }
  222. }
  223. }
  224. { // start size rate
  225. Real startSizeRate;
  226. pWnd = GetDlgItem(IDC_PSEd_StartSizeRateMin);
  227. if (pWnd) {
  228. if (toUI) {
  229. pParent->getStartSizeRateFromSystem(0, startSizeRate);
  230. sprintf(buff, FORMAT_STRING, startSizeRate);
  231. pWnd->SetWindowText(buff);
  232. } else {
  233. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  234. startSizeRate = atof(buff);
  235. pParent->updateStartSizeRateToSystem(0, startSizeRate);
  236. }
  237. }
  238. pWnd = GetDlgItem(IDC_PSEd_StartSizeRateMax);
  239. if (pWnd) {
  240. if (toUI) {
  241. pParent->getStartSizeRateFromSystem(1, startSizeRate);
  242. sprintf(buff, FORMAT_STRING, startSizeRate);
  243. pWnd->SetWindowText(buff);
  244. } else {
  245. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  246. startSizeRate = atof(buff);
  247. pParent->updateStartSizeRateToSystem(1, startSizeRate);
  248. }
  249. }
  250. }
  251. { // size rate
  252. Real sizeRate;
  253. pWnd = GetDlgItem(IDC_PSEd_SizeRateMin);
  254. if (pWnd) {
  255. if (toUI) {
  256. pParent->getSizeRateFromSystem(0, sizeRate);
  257. sprintf(buff, FORMAT_STRING, sizeRate);
  258. pWnd->SetWindowText(buff);
  259. } else {
  260. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  261. sizeRate = atof(buff);
  262. pParent->updateSizeRateToSystem(0, sizeRate);
  263. }
  264. }
  265. pWnd = GetDlgItem(IDC_PSEd_SizeRateMax);
  266. if (pWnd) {
  267. if (toUI) {
  268. pParent->getSizeRateFromSystem(1, sizeRate);
  269. sprintf(buff, FORMAT_STRING, sizeRate);
  270. pWnd->SetWindowText(buff);
  271. } else {
  272. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  273. sizeRate = atof(buff);
  274. pParent->updateSizeRateToSystem(1, sizeRate);
  275. }
  276. }
  277. }
  278. { // size damping
  279. Real sizeDamping;
  280. pWnd = GetDlgItem(IDC_PSEd_SizeDampingMin);
  281. if (pWnd) {
  282. if (toUI) {
  283. pParent->getSizeDampingFromSystem(0, sizeDamping);
  284. sprintf(buff, FORMAT_STRING, sizeDamping);
  285. pWnd->SetWindowText(buff);
  286. } else {
  287. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  288. sizeDamping = atof(buff);
  289. pParent->updateSizeDampingToSystem(0, sizeDamping);
  290. }
  291. }
  292. pWnd = GetDlgItem(IDC_PSEd_SizeDampingMax);
  293. if (pWnd) {
  294. if (toUI) {
  295. pParent->getSizeDampingFromSystem(1, sizeDamping);
  296. sprintf(buff, FORMAT_STRING, sizeDamping);
  297. pWnd->SetWindowText(buff);
  298. } else {
  299. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  300. sizeDamping = atof(buff);
  301. pParent->updateSizeDampingToSystem(1, sizeDamping);
  302. }
  303. }
  304. }
  305. { // system lifetime
  306. Real systemLifetime;
  307. pWnd = GetDlgItem(IDC_PSEd_SystemLifetime);
  308. if (pWnd) {
  309. if (toUI) {
  310. pParent->getSystemLifetimeFromSystem(systemLifetime);
  311. sprintf(buff, FORMAT_STRING, systemLifetime);
  312. pWnd->SetWindowText(buff);
  313. } else {
  314. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  315. systemLifetime = atof(buff);
  316. pParent->updateSystemLifetimeToSystem(systemLifetime);
  317. }
  318. }
  319. }
  320. { // slave position offset
  321. Real slaveOffset;
  322. pWnd = GetDlgItem(IDC_PSEd_SlaveOffsetX);
  323. if (pWnd) {
  324. if (toUI) {
  325. pParent->getSlaveOffsetFromSystem(0, slaveOffset);
  326. sprintf(buff, FORMAT_STRING, slaveOffset);
  327. pWnd->SetWindowText(buff);
  328. } else {
  329. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  330. slaveOffset = atof(buff);
  331. pParent->updateSlaveOffsetToSystem(0, slaveOffset);
  332. }
  333. }
  334. pWnd = GetDlgItem(IDC_PSEd_SlaveOffsetY);
  335. if (pWnd) {
  336. if (toUI) {
  337. pParent->getSlaveOffsetFromSystem(1, slaveOffset);
  338. sprintf(buff, FORMAT_STRING, slaveOffset);
  339. pWnd->SetWindowText(buff);
  340. } else {
  341. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  342. slaveOffset = atof(buff);
  343. pParent->updateSlaveOffsetToSystem(1, slaveOffset);
  344. }
  345. }
  346. pWnd = GetDlgItem(IDC_PSEd_SlaveOffsetZ);
  347. if (pWnd) {
  348. if (toUI) {
  349. pParent->getSlaveOffsetFromSystem(2, slaveOffset);
  350. sprintf(buff, FORMAT_STRING, slaveOffset);
  351. pWnd->SetWindowText(buff);
  352. } else {
  353. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  354. slaveOffset = atof(buff);
  355. pParent->updateSlaveOffsetToSystem(2, slaveOffset);
  356. }
  357. }
  358. }
  359. { // drift velocity
  360. Real driftVelocity;
  361. pWnd = GetDlgItem(IDC_PSEd_DriftVelocityX);
  362. if (pWnd) {
  363. if (toUI) {
  364. pParent->getDriftVelocityFromSystem(0, driftVelocity);
  365. sprintf(buff, FORMAT_STRING, driftVelocity);
  366. pWnd->SetWindowText(buff);
  367. } else {
  368. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  369. driftVelocity = atof(buff);
  370. pParent->updateDriftVelocityToSystem(0, driftVelocity);
  371. }
  372. }
  373. pWnd = GetDlgItem(IDC_PSEd_DriftVelocityY);
  374. if (pWnd) {
  375. if (toUI) {
  376. pParent->getDriftVelocityFromSystem(1, driftVelocity);
  377. sprintf(buff, FORMAT_STRING, driftVelocity);
  378. pWnd->SetWindowText(buff);
  379. } else {
  380. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  381. driftVelocity = atof(buff);
  382. pParent->updateDriftVelocityToSystem(1, driftVelocity);
  383. }
  384. }
  385. pWnd = GetDlgItem(IDC_PSEd_DriftVelocityZ);
  386. if (pWnd) {
  387. if (toUI) {
  388. pParent->getDriftVelocityFromSystem(2, driftVelocity);
  389. sprintf(buff, FORMAT_STRING, driftVelocity);
  390. pWnd->SetWindowText(buff);
  391. } else {
  392. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  393. driftVelocity = atof(buff);
  394. pParent->updateDriftVelocityToSystem(2, driftVelocity);
  395. }
  396. }
  397. }
  398. { // slave system
  399. CComboBox *pCombo;
  400. pCombo = (CComboBox*) GetDlgItem(IDC_PSEd_SlaveSystem);
  401. if (pCombo->GetCount() == 0) {
  402. // This is done here because InitPanel is called before Particle Systems have been sent over.
  403. pCombo->AddString(NONE_STRING);
  404. std::list<std::string>::const_iterator cit;
  405. const std::list<std::string> &r = pParent->getAllParticleSystems();
  406. for (cit = r.begin(); cit != r.end(); ++cit) {
  407. pCombo->AddString(cit->begin());
  408. }
  409. }
  410. if (pCombo) {
  411. if (toUI) {
  412. pParent->getSlaveSystemFromSystem(buff, ARBITRARY_BUFF_SIZE - 1);
  413. if (buff[0] == 0) {
  414. pCombo->SelectString(-1, NONE_STRING);
  415. } else {
  416. pCombo->SelectString(-1, buff);
  417. }
  418. } else {
  419. int selndx = pCombo->GetCurSel();
  420. if (selndx >= 0) {
  421. pCombo->GetLBText(selndx, buff);
  422. if (strcmp(buff, NONE_STRING) == 0) {
  423. pParent->updateSlaveSystemToSystem("");
  424. } else {
  425. pParent->updateSlaveSystemToSystem(buff);
  426. }
  427. }
  428. }
  429. }
  430. }
  431. { // slave system
  432. CComboBox *pCombo;
  433. pCombo = (CComboBox*) GetDlgItem(IDC_PSEd_PerParticleSystem);
  434. if (pCombo->GetCount() == 0) {
  435. // This is done here because InitPanel is called before Particle Systems have been sent over.
  436. pCombo->AddString(NONE_STRING);
  437. std::list<std::string>::const_iterator cit;
  438. const std::list<std::string> &r = pParent->getAllParticleSystems();
  439. for (cit = r.begin(); cit != r.end(); ++cit) {
  440. pCombo->AddString(cit->begin());
  441. }
  442. }
  443. if (pCombo) {
  444. if (toUI) {
  445. pParent->getPerParticleSystemFromSystem(buff, ARBITRARY_BUFF_SIZE - 1);
  446. if (buff[0] == 0) {
  447. pCombo->SelectString(-1, NONE_STRING);
  448. } else {
  449. pCombo->SelectString(-1, buff);
  450. }
  451. } else {
  452. int selndx = pCombo->GetCurSel();
  453. if (selndx >= 0) {
  454. pCombo->GetLBText(selndx, buff);
  455. if (strcmp(buff, NONE_STRING) == 0) {
  456. pParent->updatePerParticleSystemToSystem("");
  457. } else {
  458. pParent->updatePerParticleSystemToSystem(buff);
  459. }
  460. }
  461. }
  462. }
  463. }
  464. { // ping pong wind start angle
  465. Real angle;
  466. pWnd = GetDlgItem(IDC_PSEd_WindPingPongStartAngleMin);
  467. if (pWnd) {
  468. if (toUI) {
  469. pParent->getPingPongStartAngleFromSystem(0, angle);
  470. sprintf(buff, FORMAT_STRING, angle);
  471. pWnd->SetWindowText(buff);
  472. } else {
  473. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  474. angle = atof(buff);
  475. pParent->updatePingPongStartAngleToSystem(0, angle);
  476. }
  477. }
  478. pWnd = GetDlgItem(IDC_PSEd_WindPingPongStartAngleMax);
  479. if (pWnd) {
  480. if (toUI) {
  481. pParent->getPingPongStartAngleFromSystem(1, angle);
  482. sprintf(buff, FORMAT_STRING, angle);
  483. pWnd->SetWindowText(buff);
  484. } else {
  485. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  486. angle = atof(buff);
  487. pParent->updatePingPongStartAngleToSystem(1, angle);
  488. }
  489. }
  490. }
  491. { // ping pong wind end angle
  492. Real angle;
  493. pWnd = GetDlgItem(IDC_PSEd_WindPingPongEndAngleMin);
  494. if (pWnd) {
  495. if (toUI) {
  496. pParent->getPingPongEndAngleFromSystem(0, angle);
  497. sprintf(buff, FORMAT_STRING, angle);
  498. pWnd->SetWindowText(buff);
  499. } else {
  500. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  501. angle = atof(buff);
  502. pParent->updatePingPongEndAngleToSystem(0, angle);
  503. }
  504. }
  505. pWnd = GetDlgItem(IDC_PSEd_WindPingPongEndAngleMax);
  506. if (pWnd) {
  507. if (toUI) {
  508. pParent->getPingPongEndAngleFromSystem(1, angle);
  509. sprintf(buff, FORMAT_STRING, angle);
  510. pWnd->SetWindowText(buff);
  511. } else {
  512. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  513. angle = atof(buff);
  514. pParent->updatePingPongEndAngleToSystem(1, angle);
  515. }
  516. }
  517. }
  518. { // wind angle change
  519. Real angle;
  520. pWnd = GetDlgItem(IDC_PSEd_WindAngleChangeMin);
  521. if (pWnd) {
  522. if (toUI) {
  523. pParent->getWindAngleChangeFromSystem(0, angle);
  524. sprintf(buff, FORMAT_STRING, angle);
  525. pWnd->SetWindowText(buff);
  526. } else {
  527. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  528. angle = atof(buff);
  529. pParent->updateWindAngleChangeToSystem(0, angle);
  530. }
  531. }
  532. pWnd = GetDlgItem(IDC_PSEd_WindAngleChangeMax);
  533. if (pWnd) {
  534. if (toUI) {
  535. pParent->getWindAngleChangeFromSystem(1, angle);
  536. sprintf(buff, FORMAT_STRING, angle);
  537. pWnd->SetWindowText(buff);
  538. } else {
  539. pWnd->GetWindowText(buff, ARBITRARY_BUFF_SIZE - 1);
  540. angle = atof(buff);
  541. pParent->updateWindAngleChangeToSystem(1, angle);
  542. }
  543. }
  544. }
  545. { // wind motion
  546. CComboBox *pCombo;
  547. pCombo = (CComboBox*) GetDlgItem(IDC_PSEd_WindMotion);
  548. if (pCombo) {
  549. int selndx;
  550. if (toUI) {
  551. ParticleSystemInfo::WindMotion windMotion;
  552. pParent->getWindMotionFromSystem( windMotion );
  553. selndx = pCombo->SelectString(-1, WindMotionNames[(long) windMotion]);
  554. } else {
  555. selndx = pCombo->GetCurSel();
  556. if (selndx >= 0) {
  557. pParent->updateWindMotionToSystem( (ParticleSystemInfo::WindMotion)(selndx + 1) );
  558. }
  559. }
  560. }
  561. }
  562. }
  563. }
  564. void MoreParmsDialog::OnParticleSystemEdit()
  565. {
  566. DebugWindowDialog *pParent = (DebugWindowDialog*) GetParent();
  567. if (!pParent) {
  568. return;
  569. }
  570. pParent->signalParticleSystemEdit();
  571. }
  572. BEGIN_MESSAGE_MAP(MoreParmsDialog, CDialog)
  573. ON_EN_KILLFOCUS(IDC_PSEd_InitialDelayMin, OnParticleSystemEdit)
  574. ON_EN_KILLFOCUS(IDC_PSEd_InitialDelayMax, OnParticleSystemEdit)
  575. ON_EN_KILLFOCUS(IDC_PSEd_BurstDelayMin, OnParticleSystemEdit)
  576. ON_EN_KILLFOCUS(IDC_PSEd_BurstDelayMax, OnParticleSystemEdit)
  577. ON_EN_KILLFOCUS(IDC_PSEd_BurstCountMin, OnParticleSystemEdit)
  578. ON_EN_KILLFOCUS(IDC_PSEd_BurstCountMax, OnParticleSystemEdit)
  579. ON_EN_KILLFOCUS(IDC_PSEd_ColorScaleMin, OnParticleSystemEdit)
  580. ON_EN_KILLFOCUS(IDC_PSEd_ColorScaleMax, OnParticleSystemEdit)
  581. ON_EN_KILLFOCUS(IDC_PSEd_ParticleLifetimeMin, OnParticleSystemEdit)
  582. ON_EN_KILLFOCUS(IDC_PSEd_ParticleLifetimeMax, OnParticleSystemEdit)
  583. ON_EN_KILLFOCUS(IDC_PSEd_SizeMin, OnParticleSystemEdit)
  584. ON_EN_KILLFOCUS(IDC_PSEd_SizeMax, OnParticleSystemEdit)
  585. ON_EN_KILLFOCUS(IDC_PSEd_StartSizeRateMin, OnParticleSystemEdit)
  586. ON_EN_KILLFOCUS(IDC_PSEd_StartSizeRateMax, OnParticleSystemEdit)
  587. ON_EN_KILLFOCUS(IDC_PSEd_SizeRateMin, OnParticleSystemEdit)
  588. ON_EN_KILLFOCUS(IDC_PSEd_SizeRateMax, OnParticleSystemEdit)
  589. ON_EN_KILLFOCUS(IDC_PSEd_SizeDampingMin, OnParticleSystemEdit)
  590. ON_EN_KILLFOCUS(IDC_PSEd_SizeDampingMax, OnParticleSystemEdit)
  591. ON_EN_KILLFOCUS(IDC_PSEd_SystemLifetime, OnParticleSystemEdit)
  592. ON_EN_KILLFOCUS(IDC_PSEd_SlaveOffsetX, OnParticleSystemEdit)
  593. ON_EN_KILLFOCUS(IDC_PSEd_SlaveOffsetY, OnParticleSystemEdit)
  594. ON_EN_KILLFOCUS(IDC_PSEd_SlaveOffsetZ, OnParticleSystemEdit)
  595. ON_EN_KILLFOCUS(IDC_PSEd_DriftVelocityX, OnParticleSystemEdit)
  596. ON_EN_KILLFOCUS(IDC_PSEd_DriftVelocityY, OnParticleSystemEdit)
  597. ON_EN_KILLFOCUS(IDC_PSEd_DriftVelocityZ, OnParticleSystemEdit)
  598. ON_CBN_SELCHANGE(IDC_PSEd_SlaveSystem, OnParticleSystemEdit)
  599. ON_CBN_SELCHANGE(IDC_PSEd_PerParticleSystem, OnParticleSystemEdit)
  600. ON_EN_KILLFOCUS(IDC_PSEd_WindAngleChangeMin, OnParticleSystemEdit)
  601. ON_EN_KILLFOCUS(IDC_PSEd_WindAngleChangeMax, OnParticleSystemEdit)
  602. ON_EN_KILLFOCUS(IDC_PSEd_WindPingPongStartAngleMin, OnParticleSystemEdit)
  603. ON_EN_KILLFOCUS(IDC_PSEd_WindPingPongStartAngleMax, OnParticleSystemEdit)
  604. ON_EN_KILLFOCUS(IDC_PSEd_WindPingPongEndAngleMin, OnParticleSystemEdit)
  605. ON_EN_KILLFOCUS(IDC_PSEd_WindPingPongEndAngleMax, OnParticleSystemEdit)
  606. ON_CBN_SELCHANGE(IDC_PSEd_WindMotion, OnParticleSystemEdit)
  607. END_MESSAGE_MAP()