CUIMsgRewind.cpp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. #include "CUIMsgRewind.h"
  2. #include "FETU.h"
  3. #include "FESU.h"
  4. #include "LOCstring.h"
  5. #include "FREE.h"
  6. #include "FE2D.h"
  7. #include "CStoryCore.h"
  8. #include "FEU.h"
  9. #include "TStoryConfig.h"
  10. //-------------------------------------------------------------------------------------------------
  11. //001354C0
  12. CUIMsgRewind::CUIMsgRewind() {
  13. }
  14. //-------------------------------------------------------------------------------------------------
  15. //00135554
  16. void CUIMsgRewind::Render() {
  17. // 00135554
  18. wchar_t var_D8_sp228[64];
  19. TImage var_2D8_sp28;
  20. TRect rc_2E8;
  21. float s0_f = 24.0;
  22. float s22_f = 0.5;
  23. float s28_f = this->field_14;
  24. // 47AEA8 - 0x477E90 =3018
  25. float s26_f = this->field_10;
  26. float s30_f = this->field_8;
  27. float r5_f = s26_f;
  28. float s17_f = this->field_C;
  29. s0_f = s28_f + s0_f;
  30. int r8_i = MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0;
  31. float s20_f = s26_f * s22_f;
  32. // 00135596
  33. if (r8_i == 11) {
  34. // 0013559C
  35. s28_f = s0_f;
  36. }
  37. // 001355A0
  38. float s19_f = this->field_24;
  39. float s18_f = s28_f * s22_f;
  40. float s21_f = this->field_28;
  41. float s16_f = s30_f - s20_f;
  42. float s23_f = this->field_1C;
  43. float s24_f = s17_f - s18_f;
  44. RenderBox(s16_f, s24_f, s26_f, s28_f);
  45. RenderBorder(s16_f, s24_f, s26_f, s28_f);
  46. RenderOptions();
  47. int r5_i = 1;
  48. FESU_SetFont(1);
  49. int r7_i = -1;
  50. int r6_i = 0;
  51. FTTFont_SetColour(0xFFFFFFFF, 0);
  52. int r0_i = FREE_tInfo.filed_0.b_8;
  53. float r1_f;
  54. // 00135604
  55. if (r0_i != 0) {
  56. // 00135608
  57. wchar_t *r2_pwc = LOCstring(193);
  58. xsnprintf(var_D8_sp228, 64, r2_pwc);
  59. FESU_Capitalize(var_D8_sp228, var_D8_sp228, -1);
  60. FESU_SetFontScale(0.699999988079071, -1);
  61. // 0013562E
  62. if (r8_i == 11) {
  63. // 00135634
  64. FESU_SetFontScale(0.5, -1);
  65. }
  66. // loc_13563E
  67. FTTFont_SetAlign(EFontAlign_2);
  68. s0_f = s26_f * 0.300000012f;
  69. FESU_SetFontScaleForWidth(var_D8_sp228, s0_f);
  70. s0_f = -25.0f;
  71. float s4_f = 82;
  72. float s2_f = 4;
  73. float r6_f = -0.5235987901687622;
  74. s4_f = s16_f + s4_f;
  75. s0_f = s17_f + s0_f;
  76. float s25_f = s0_f + s2_f;
  77. FTTFont_PrintRotUnicode(s4_f, s25_f, r6_f, s4_f, s25_f, var_D8_sp228);
  78. s0_f = s30_f + s20_f + (float)(-50.0) + (float)(-44.0);
  79. // loc_13576E
  80. FTTFont_PrintRotUnicode(s0_f, s25_f, r6_f, s0_f, s25_f, var_D8_sp228);
  81. } else {
  82. // loc_1356AE
  83. FETU_GetImage(&var_2D8_sp28, "credits.png",
  84. 0, EFTTTexFormat_19,
  85. 0, 0, 1);
  86. s0_f = -25.0;
  87. float s6_f = -50.0;
  88. float s2_f = s30_f + s20_f;
  89. float r3_f = 50;
  90. float s4_f = -8.0;
  91. float s25_f = s17_f + s0_f;
  92. s0_f = -20.0;
  93. s2_f = s2_f + s6_f;
  94. s4_f = s25_f + s4_f;
  95. s0_f = s2_f + s0_f;
  96. float r5_f = s0_f;
  97. FE2D_DrawTexScaleColRot(&var_2D8_sp28, s0_f, s4_f, r3_f, r3_f, 0xFFFFFFFF, s23_f, s19_f, s21_f);
  98. FESU_SetFontScale(0.699999988079071, -1);
  99. FTTFont_SetAlign(EFontAlign_1);
  100. // 4B0E28 - 0x4AB140
  101. r0_i = CStoryCore::m_tStageManager.GetPlayableIndex(
  102. CStoryCore::m_tStageManager.filed_5ce8);
  103. // 0013572A
  104. if (r0_i >= 9) {
  105. // 0013572E
  106. r0_i = 9;
  107. }
  108. // 00135730
  109. wchar_t *r3_pwc = FESU_GetCommaSeperatedString(STY_tConfig.RewindCosts_5c8[r0_i],
  110. 3);
  111. xsnprintf(var_D8_sp228, 64, L"%s", r3_pwc);
  112. s0_f = -2.0;
  113. s0_f = s25_f + s0_f;
  114. // loc_13576E
  115. FTTFont_PrintRotUnicode(r5_f, s0_f, s23_f, r5_f, s0_f, var_D8_sp228);
  116. }
  117. // 00135772
  118. FTTFont_SetAlign(EFontAlign_2);
  119. FESU_SetFont(1);
  120. float r0_f;
  121. switch (r8_i) {
  122. case 1:
  123. case 6: {
  124. // loc_135796
  125. r0_f = 0.4000000059604645;
  126. r1_f = -1;
  127. FESU_SetFontScale(r0_f, r1_f);
  128. break;
  129. }
  130. case 4:
  131. case 5: {
  132. // loc_13579A
  133. r0_f = 0.47999998927116394;
  134. r1_f = -1;
  135. FESU_SetFontScale(r0_f, r1_f);
  136. break;
  137. }
  138. case 2: {
  139. // loc_13579E
  140. r0_f = 0.4099999964237213;
  141. r1_f = -1;
  142. FESU_SetFontScale(r0_f, r1_f);
  143. break;
  144. }
  145. case 3:
  146. case 7:
  147. case 8:
  148. case 10:
  149. default: {
  150. // def_135786
  151. r1_f = -1;
  152. r0_f = 0.5f;
  153. FESU_SetFontScale(r0_f, r1_f);
  154. break;
  155. }
  156. case 9: {
  157. // loc_1357AA
  158. r0_f = 0.41999998688697815;
  159. r1_f = -1;
  160. FESU_SetFontScale(r0_f, r1_f);
  161. break;
  162. }
  163. case 11: {
  164. // loc_1357AE
  165. r0_f = 0.44999998807907104;
  166. r1_f = -1;
  167. FESU_SetFontScale(r0_f, r1_f);
  168. break;
  169. }
  170. }
  171. // loc_1357B2
  172. wchar_t *r2_pwc = LOCstring(6167);
  173. wchar_t buf_sp28[0x100];
  174. xsnprintf(buf_sp28, 256, r2_pwc);
  175. s0_f = 0.800000012f;
  176. s0_f = s26_f * s0_f;
  177. float r6_f = FESU_BalanceWithWrapWidth(buf_sp28, s0_f, 50);
  178. /*
  179. * 此处返回类型很可能是TRect的,但为了不影响其它函数,暂时保留TextDimensions类型
  180. */
  181. TextDimensions var_2E8_sp18 =
  182. FTTFont_GetUnicodeTextDimensionsWrap(EFontWrapType_2,
  183. r6_f, buf_sp28);
  184. s0_f = s17_f + s18_f;
  185. float s2_f = var_2E8_sp18.field_4;
  186. float s4_f = -12.0;
  187. s0_f = s0_f - s2_f;
  188. s0_f = s0_f + s4_f;
  189. FTTFont_PrintWrapRotUnicode(s30_f, s0_f, EFontWrapType_2,
  190. r6_f, s28_f, s23_f, s19_f, s21_f, buf_sp28);
  191. rc_2E8.fy_4 = s24_f;
  192. rc_2E8.fx_0 = s16_f;
  193. rc_2E8.fWidth_8 = s26_f;
  194. rc_2E8.fHeight_C = s28_f;
  195. r0_i = this->filed_84;
  196. // 00135838
  197. if (r0_i != 0) {
  198. // 0013583A
  199. s0_f = r0_i;
  200. s2_f = 0.015625;
  201. s0_f = s0_f * s2_f;
  202. r0_f = FEU_UpdateHighlightRect(&rc_2E8, s0_f);
  203. s0_f = rc_2E8.fWidth_8;
  204. s2_f = rc_2E8.fHeight_C;
  205. s20_f = s0_f * s22_f;
  206. s16_f = rc_2E8.fx_0;
  207. s18_f = s2_f * s22_f;
  208. s24_f = rc_2E8.fy_4;
  209. s0_f = r0_f;
  210. } else {
  211. // loc_135872
  212. s0_f = 1.0;
  213. }
  214. // loc_135876
  215. s2_f = s24_f + s18_f;
  216. s4_f = 160.0;
  217. float s6_f = -0.5;
  218. float s10_f = 66.0;
  219. s4_f = s0_f * s4_f;
  220. float s8_f = s16_f + s20_f;
  221. s2_f = s2_f - s18_f;
  222. s8_f = s8_f + s4_f * s6_f;
  223. s2_f = s2_f + s0_f * s10_f;
  224. RenderRewindIcon(s8_f, s2_f, s4_f, s4_f);
  225. }
  226. //-------------------------------------------------------------------------------------------------
  227. //00135918
  228. void CUIMsgRewind::RenderRewindIcon(float f1, float f2, float f3, float f4) {
  229. LOGE("CUIMsgRewind::RenderRewindIcon%p%f%f%f%f",this,f1,f2,f3,f4);
  230. }
  231. //-------------------------------------------------------------------------------------------------
  232. //00135B78
  233. void CUIMsgRewind::Init(EMessageBoxType, wchar_t const *, wchar_t *, int, int, int, int, bool, bool, bool, CMessageBoxHandler_func, void *) {
  234. }
  235. //-------------------------------------------------------------------------------------------------
  236. //00135C10
  237. int CUIMsgRewind::Process() {
  238. return rand() % 10;
  239. }
  240. //-------------------------------------------------------------------------------------------------