uibattle.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. #include "common.h"
  26. #include "ui.h"
  27. typedef enum tagBATTLEUISTATE
  28. {
  29. kBattleUIWait,
  30. kBattleUISelectMove,
  31. kBattleUISelectTargetEnemy,
  32. kBattleUISelectTargetPlayer,
  33. kBattleUISelectTargetEnemyAll,
  34. kBattleUISelectTargetPlayerAll,
  35. } BATTLEUISTATE;
  36. typedef enum tagBATTLEMENUSTATE
  37. {
  38. kBattleMenuMain,
  39. kBattleMenuMagicSelect,
  40. kBattleMenuUseItemSelect,
  41. kBattleMenuThrowItemSelect,
  42. kBattleMenuMisc,
  43. kBattleMenuMiscItemSubMenu,
  44. } BATTLEMENUSTATE;
  45. typedef enum tagBATTLEUIACTION
  46. {
  47. kBattleUIActionAttack,
  48. kBattleUIActionMagic,
  49. kBattleUIActionCoopMagic,
  50. kBattleUIActionMisc,
  51. } BATTLEUIACTION;
  52. #define SPRITENUM_BATTLEICON_ATTACK 40
  53. #define SPRITENUM_BATTLEICON_MAGIC 41
  54. #define SPRITENUM_BATTLEICON_COOPMAGIC 42
  55. #define SPRITENUM_BATTLEICON_MISCMENU 43
  56. #define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER 69
  57. #define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER_RED 68
  58. #define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER 67
  59. #define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER_RED 66
  60. #define BATTLEUI_LABEL_ITEM 5
  61. #define BATTLEUI_LABEL_DEFEND 58
  62. #define BATTLEUI_LABEL_AUTO 56
  63. #define BATTLEUI_LABEL_INVENTORY 57
  64. #define BATTLEUI_LABEL_FLEE 59
  65. #define BATTLEUI_LABEL_STATUS 60
  66. #define BATTLEUI_LABEL_USEITEM 23
  67. #define BATTLEUI_LABEL_THROWITEM 24
  68. #define TIMEMETER_COLOR_DEFAULT 0x1B
  69. #define TIMEMETER_COLOR_SLOW 0x5B
  70. #define TIMEMETER_COLOR_HASTE 0x2A
  71. #define BATTLEUI_MAX_SHOWNUM 16
  72. typedef struct tagSHOWNUM
  73. {
  74. WORD wNum;
  75. PAL_POS pos;
  76. DWORD dwTime;
  77. NUMCOLOR color;
  78. } SHOWNUM;
  79. typedef struct tagBATTLEUI
  80. {
  81. BATTLEUISTATE state;
  82. BATTLEMENUSTATE MenuState;
  83. WCHAR szMsg[256]; // message to be shown on the screen
  84. WCHAR szNextMsg[256]; // next message to be shown on the screen
  85. DWORD dwMsgShowTime; // the end time of showing the message
  86. WORD wNextMsgDuration; // duration of the next message
  87. WORD wCurPlayerIndex; // index of the current player
  88. WORD wSelectedAction; // current selected action
  89. WORD wSelectedIndex; // current selected index of player or enemy
  90. WORD wPrevEnemyTarget; // previous enemy target
  91. WORD wActionType; // type of action to be performed
  92. WORD wObjectID; // object ID of the item or magic to use
  93. BOOL fAutoAttack; // TRUE if auto attack
  94. SHOWNUM rgShowNum[BATTLEUI_MAX_SHOWNUM];
  95. } BATTLEUI;
  96. PAL_C_LINKAGE_BEGIN
  97. VOID
  98. PAL_PlayerInfoBox(
  99. PAL_POS pos,
  100. WORD wPlayerRole,
  101. INT iTimeMeter,
  102. BYTE bTimeMeterColor,
  103. BOOL fUpdate
  104. );
  105. VOID
  106. PAL_BattleUIShowText(
  107. LPCWSTR lpszText,
  108. WORD wDuration
  109. );
  110. VOID
  111. PAL_BattleUIPlayerReady(
  112. WORD wPlayerIndex
  113. );
  114. VOID
  115. PAL_BattleUIUpdate(
  116. VOID
  117. );
  118. VOID
  119. PAL_BattleUIShowNum(
  120. WORD wNum,
  121. PAL_POS pos,
  122. NUMCOLOR color
  123. );
  124. PAL_C_LINKAGE_END
  125. #endif