uibattle.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* -*- mode: c; tab-width: 4; c-basic-offset: 3; c-file-style: "linux" -*- */
  2. //
  3. // Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
  4. // All rights reserved.
  5. //
  6. // This file is part of SDLPAL.
  7. //
  8. // SDLPAL is free software: you can redistribute it and/or modify
  9. // it under the terms of the GNU General Public License as published by
  10. // the Free Software Foundation, either version 3 of the License, or
  11. // (at your option) any later version.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU General Public License
  19. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. //
  21. // Modified by Lou Yihua <louyihua@21cn.com> with Unicode support, 2015
  22. //
  23. #ifndef UIBATTLE_H
  24. #define UIBATTLE_H
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. #include "ui.h"
  30. typedef enum tagBATTLEUISTATE
  31. {
  32. kBattleUIWait,
  33. kBattleUISelectMove,
  34. kBattleUISelectTargetEnemy,
  35. kBattleUISelectTargetPlayer,
  36. kBattleUISelectTargetEnemyAll,
  37. kBattleUISelectTargetPlayerAll,
  38. } BATTLEUISTATE;
  39. typedef enum tagBATTLEMENUSTATE
  40. {
  41. kBattleMenuMain,
  42. kBattleMenuMagicSelect,
  43. kBattleMenuUseItemSelect,
  44. kBattleMenuThrowItemSelect,
  45. kBattleMenuMisc,
  46. kBattleMenuMiscItemSubMenu,
  47. } BATTLEMENUSTATE;
  48. typedef enum tagBATTLEUIACTION
  49. {
  50. kBattleUIActionAttack,
  51. kBattleUIActionMagic,
  52. kBattleUIActionCoopMagic,
  53. kBattleUIActionMisc,
  54. } BATTLEUIACTION;
  55. #define SPRITENUM_BATTLEICON_ATTACK 40
  56. #define SPRITENUM_BATTLEICON_MAGIC 41
  57. #define SPRITENUM_BATTLEICON_COOPMAGIC 42
  58. #define SPRITENUM_BATTLEICON_MISCMENU 43
  59. #define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER 69
  60. #define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER_RED 68
  61. #define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER 67
  62. #define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER_RED 66
  63. #define BATTLEUI_LABEL_ITEM 5
  64. #define BATTLEUI_LABEL_DEFEND 58
  65. #define BATTLEUI_LABEL_AUTO 56
  66. #define BATTLEUI_LABEL_INVENTORY 57
  67. #define BATTLEUI_LABEL_FLEE 59
  68. #define BATTLEUI_LABEL_STATUS 60
  69. #define BATTLEUI_LABEL_USEITEM 23
  70. #define BATTLEUI_LABEL_THROWITEM 24
  71. #define TIMEMETER_COLOR_DEFAULT 0x1B
  72. #define TIMEMETER_COLOR_SLOW 0x5B
  73. #define TIMEMETER_COLOR_HASTE 0x2A
  74. #define BATTLEUI_MAX_SHOWNUM 16
  75. typedef struct tagSHOWNUM
  76. {
  77. WORD wNum;
  78. PAL_POS pos;
  79. DWORD dwTime;
  80. NUMCOLOR color;
  81. } SHOWNUM;
  82. typedef struct tagBATTLEUI
  83. {
  84. BATTLEUISTATE state;
  85. BATTLEMENUSTATE MenuState;
  86. WCHAR szMsg[256]; // message to be shown on the screen
  87. WCHAR szNextMsg[256]; // next message to be shown on the screen
  88. DWORD dwMsgShowTime; // the end time of showing the message
  89. WORD wNextMsgDuration; // duration of the next message
  90. WORD wCurPlayerIndex; // index of the current player
  91. WORD wSelectedAction; // current selected action
  92. WORD wSelectedIndex; // current selected index of player or enemy
  93. WORD wPrevEnemyTarget; // previous enemy target
  94. WORD wActionType; // type of action to be performed
  95. WORD wObjectID; // object ID of the item or magic to use
  96. BOOL fAutoAttack; // TRUE if auto attack
  97. SHOWNUM rgShowNum[BATTLEUI_MAX_SHOWNUM];
  98. } BATTLEUI;
  99. VOID
  100. PAL_PlayerInfoBox(
  101. PAL_POS pos,
  102. WORD wPlayerRole,
  103. INT iTimeMeter,
  104. BYTE bTimeMeterColor,
  105. BOOL fUpdate
  106. );
  107. VOID
  108. PAL_BattleUIShowText(
  109. LPCWSTR lpszText,
  110. WORD wDuration
  111. );
  112. VOID
  113. PAL_BattleUIPlayerReady(
  114. WORD wPlayerIndex
  115. );
  116. VOID
  117. PAL_BattleUIUpdate(
  118. VOID
  119. );
  120. VOID
  121. PAL_BattleUIShowNum(
  122. WORD wNum,
  123. PAL_POS pos,
  124. NUMCOLOR color
  125. );
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129. #endif