CvDLLInterfaceIFaceBase.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. #pragma once
  2. #ifndef CvDLLInterfaceIFaceBase_h
  3. #define CvDLLInterfaceIFaceBase_h
  4. //
  5. // abstract class containing CvInterface functions that the DLL needs
  6. //
  7. //#include "CvStructs.h"
  8. #include "LinkedList.h"
  9. class CvUnit;
  10. class CvCity;
  11. class CvPlot;
  12. class CvSelectionGroup;
  13. class CvPopupInfo;
  14. class CvPopup;
  15. class CvTalkingHeadMessage;
  16. typedef std::list<CvPopupInfo*> CvPopupQueue;
  17. class CvDLLInterfaceIFaceBase
  18. {
  19. public:
  20. virtual void lookAtSelectionPlot(bool bRelease = false) = 0;
  21. virtual bool canHandleAction(int iAction, CvPlot* pPlot = NULL, bool bTestVisible = false) = 0;
  22. virtual bool canDoInterfaceMode(InterfaceModeTypes eInterfaceMode, CvSelectionGroup* pSelectionGroup) = 0;
  23. virtual CvPlot* getLookAtPlot() = 0;
  24. virtual CvPlot* getSelectionPlot() = 0;
  25. virtual CvUnit* getInterfacePlotUnit(const CvPlot* pPlot, int iIndex) = 0;
  26. virtual CvUnit* getSelectionUnit(int iIndex) = 0;
  27. virtual CvUnit* getHeadSelectedUnit() = 0;
  28. virtual void selectUnit(CvUnit* pUnit, bool bClear, bool bToggle = false, bool bSound = false) = 0;
  29. virtual void selectGroup(CvUnit* pUnit, bool bShift, bool bCtrl, bool bAlt) = 0;
  30. virtual void selectAll(CvPlot* pPlot) = 0;
  31. virtual bool removeFromSelectionList(CvUnit* pUnit) = 0;
  32. virtual void makeSelectionListDirty() = 0;
  33. virtual bool mirrorsSelectionGroup() = 0;
  34. virtual bool canSelectionListFound() = 0;
  35. virtual void bringToTop(CvPopup *pPopup) = 0;
  36. virtual bool isPopupUp() = 0;
  37. virtual bool isPopupQueued() = 0;
  38. virtual bool isDiploOrPopupWaiting() = 0;
  39. virtual CvUnit* getLastSelectedUnit() = 0;
  40. virtual void setLastSelectedUnit(CvUnit* pUnit) = 0;
  41. virtual void changePlotListColumn(int iChange) = 0;
  42. virtual CvPlot* getGotoPlot() = 0;
  43. virtual CvPlot* getSingleMoveGotoPlot() = 0;
  44. virtual CvPlot* getOriginalPlot() = 0;
  45. virtual void playGeneralSound(LPCTSTR pszSound, NiPoint3 vPos = NiPoint3(-1.0f, -1.0f, -1.0f)) = 0;
  46. virtual void playGeneralSound(int iSoundId, int iSoundType = 1, NiPoint3 vPos = NiPoint3(-1.0f, -1.0f, -1.0f)) = 0;
  47. virtual void clearQueuedPopups() = 0;
  48. virtual CvSelectionGroup* getSelectionList() = 0;
  49. virtual void clearSelectionList() = 0;
  50. virtual void insertIntoSelectionList(CvUnit* pUnit, bool bClear, bool bToggle, bool bGroup = false, bool bSound = false, bool bMinimalChange = false) = 0;
  51. virtual void selectionListPostChange() = 0;
  52. virtual void selectionListPreChange() = 0;
  53. virtual int getSymbolID(int iSymbol) = 0;
  54. virtual CLLNode<IDInfo>* deleteSelectionListNode(CLLNode<IDInfo>* pNode) = 0;
  55. virtual CLLNode<IDInfo>* nextSelectionListNode(CLLNode<IDInfo>* pNode) = 0;
  56. virtual int getLengthSelectionList() = 0;
  57. virtual CLLNode<IDInfo>* headSelectionListNode() = 0;
  58. virtual void selectCity(CvCity* pNewValue, bool bTestProduction = false) = 0;
  59. virtual void selectLookAtCity(bool bAdd = false) = 0;
  60. virtual void addSelectedCity(CvCity* pNewValue, bool bToggle = false) = 0;
  61. virtual void clearSelectedCities() = 0;
  62. virtual bool isCitySelected(CvCity *pCity) = 0;
  63. virtual CvCity* getHeadSelectedCity() = 0;
  64. virtual bool isCitySelection() = 0;
  65. virtual CLLNode<IDInfo>* nextSelectedCitiesNode(CLLNode<IDInfo>* pNode) = 0;
  66. virtual CLLNode<IDInfo>* headSelectedCitiesNode() = 0;
  67. virtual void addMessage(PlayerTypes ePlayer, bool bForce, int iLength, CvWString szString, LPCTSTR pszSound = NULL,
  68. InterfaceMessageTypes eType = MESSAGE_TYPE_INFO, LPCSTR pszIcon = NULL, ColorTypes eFlashColor = NO_COLOR,
  69. int iFlashX = -1, int iFlashY = -1, bool bShowOffScreenArrows = false, bool bShowOnScreenArrows = false) = 0;
  70. virtual void addCombatMessage(PlayerTypes ePlayer, CvWString szString) = 0;
  71. virtual void addQuestMessage(PlayerTypes ePlayer, CvWString szString, int iQuestId) = 0;
  72. virtual void showMessage(CvTalkingHeadMessage& msg) = 0;
  73. virtual void flushTalkingHeadMessages() = 0;
  74. virtual void clearEventMessages() = 0;
  75. virtual void addPopup(CvPopupInfo* pInfo, PlayerTypes ePlayer = NO_PLAYER, bool bImmediate = false, bool bFront = false) = 0;
  76. virtual void getDisplayedButtonPopups(CvPopupQueue& infos) = 0;
  77. virtual int getCycleSelectionCounter() = 0;
  78. virtual void setCycleSelectionCounter(int iNewValue) = 0;
  79. virtual void changeCycleSelectionCounter(int iChange) = 0;
  80. virtual int getEndTurnCounter() = 0;
  81. virtual void setEndTurnCounter(int iNewValue) = 0;
  82. virtual void changeEndTurnCounter(int iChange) = 0;
  83. virtual bool isCombatFocus() = 0;
  84. virtual void setCombatFocus(bool bNewValue) = 0;
  85. virtual void setDiploQueue(CvDiploParameters* pDiploParams, PlayerTypes ePlayer = NO_PLAYER) = 0;
  86. virtual bool isDirty(InterfaceDirtyBits eDirtyItem) = 0;
  87. virtual void setDirty(InterfaceDirtyBits eDirtyItem, bool bNewValue) = 0;
  88. virtual void makeInterfaceDirty() = 0;
  89. virtual bool updateCursorType() = 0;
  90. virtual void updatePythonScreens() = 0;
  91. virtual void lookAt(NiPoint3 pt3Target, CameraLookAtTypes type, NiPoint3 attackDirection = NiPoint3(0, 1, 0)) = 0;
  92. virtual void centerCamera(CvUnit*) = 0;
  93. virtual void releaseLockedCamera() = 0;
  94. virtual bool isFocusedWidget() = 0;
  95. virtual bool isFocused() = 0;
  96. virtual bool isBareMapMode() = 0;
  97. virtual void toggleBareMapMode() = 0;
  98. virtual bool isShowYields() = 0;
  99. virtual void toggleYieldVisibleMode() = 0;
  100. virtual bool isScoresVisible() = 0;
  101. virtual void toggleScoresVisible() = 0;
  102. virtual bool isScoresMinimized() = 0;
  103. virtual void toggleScoresMinimized() = 0;
  104. virtual bool isNetStatsVisible() = 0;
  105. virtual int getOriginalPlotCount() = 0;
  106. virtual bool isCityScreenUp() = 0;
  107. virtual bool isEndTurnMessage() = 0;
  108. virtual void setInterfaceMode(InterfaceModeTypes eNewValue) = 0;
  109. virtual InterfaceModeTypes getInterfaceMode() = 0;
  110. virtual InterfaceVisibility getShowInterface() = 0;
  111. virtual CvPlot* getMouseOverPlot() = 0;
  112. virtual void setFlashing(PlayerTypes eWho, bool bFlashing = true) = 0;
  113. virtual bool isFlashing(PlayerTypes eWho) = 0;
  114. virtual void setDiplomacyLocked(bool bLocked) = 0;
  115. virtual bool isDiplomacyLocked() = 0;
  116. virtual void setMinimapColor(MinimapModeTypes eMinimapMode, int iX, int iY, ColorTypes eColor, float fAlpha) = 0;
  117. virtual unsigned char* getMinimapBaseTexture() const = 0;
  118. virtual void setEndTurnMessage(bool bNewValue) = 0;
  119. virtual bool isHasMovedUnit() = 0;
  120. virtual void setHasMovedUnit(bool bNewValue) = 0;
  121. virtual bool isForcePopup() = 0;
  122. virtual void setForcePopup(bool bNewValue) = 0;
  123. virtual void lookAtCityOffset(int iCity) = 0;
  124. virtual void toggleTurnLog() = 0;
  125. virtual void showTurnLog(ChatTargetTypes eTarget = NO_CHATTARGET) = 0;
  126. virtual void dirtyTurnLog(PlayerTypes ePlayer) = 0;
  127. virtual int getPlotListColumn() = 0;
  128. virtual void verifyPlotListColumn() = 0;
  129. virtual int getPlotListOffset() = 0;
  130. virtual void unlockPopupHelp() = 0;
  131. virtual void showDetails(bool bPasswordOnly = false) = 0;
  132. virtual void showAdminDetails() = 0;
  133. virtual void toggleClockAlarm(bool bValue, int iHour = 0, int iMin = 0) = 0;
  134. virtual bool isClockAlarmOn() = 0;
  135. virtual void setScreenDying(int iPythonFileID, bool bDying) = 0;
  136. virtual bool isExitingToMainMenu() = 0;
  137. virtual void exitingToMainMenu(const char* szLoadFile=NULL) = 0;
  138. virtual void setWorldBuilder(bool bTurnOn) = 0;
  139. virtual int getFontLeftJustify() = 0;
  140. virtual int getFontRightJustify() = 0;
  141. virtual int getFontCenterJustify() = 0;
  142. virtual int getFontCenterVertically() = 0;
  143. virtual int getFontAdditive() = 0;
  144. virtual void popupSetHeaderString( CvPopup* pPopup, CvWString szText, uint uiFlags = DLL_FONT_CENTER_JUSTIFY ) = 0;
  145. virtual void popupSetBodyString( CvPopup* pPopup, CvWString szText, uint uiFlags = DLL_FONT_LEFT_JUSTIFY, char *szName = NULL, CvWString szHelpText = "" ) = 0;
  146. virtual void popupLaunch( CvPopup* pPopup, bool bCreateOkButton = true, PopupStates bState = POPUPSTATE_QUEUED, int iNumPixelScroll = 0 ) = 0;
  147. virtual void popupSetPopupType( CvPopup* pPopup, PopupEventTypes ePopupType, LPCTSTR szArtFileName = NULL ) = 0;
  148. virtual void popupSetStyle( CvPopup* pPopup, const char* styleId ) = 0;
  149. virtual void popupAddDDS( CvPopup* pPopup, const char* szIconFilename, int iWidth = 0, int iHeight = 0, CvWString szHelpText = "") = 0;
  150. virtual void popupAddSeparator( CvPopup* pPopup, int iSpace = 0) = 0;
  151. virtual void popupAddGenericButton( CvPopup* pPopup, CvWString szText, const char* szIcon = 0, int iButtonId = -1, WidgetTypes eWidgetType = WIDGET_GENERAL, int iData1 = MAX_INT, int iData2 = MAX_INT,
  152. bool bOption = true, PopupControlLayout ctrlLayout = POPUP_LAYOUT_CENTER, unsigned int textJustifcation = DLL_FONT_LEFT_JUSTIFY ) = 0;
  153. virtual void popupCreateEditBox( CvPopup* pPopup, CvWString szDefaultString = "", WidgetTypes eWidgetType = WIDGET_GENERAL, CvWString szHelpText = "", int iGroup = 0,
  154. PopupControlLayout ctrlLayout = POPUP_LAYOUT_STRETCH, unsigned int preferredCharWidth = 0, unsigned int maxCharCount = 256 ) = 0;
  155. virtual void popupEnableEditBox( CvPopup* pPopup, int iGroup = 0, bool bEnable = false ) = 0;
  156. virtual void popupCreateRadioButtons( CvPopup * pPopup, int iNumButtons, int iGroup = 0, WidgetTypes eWidgetType = WIDGET_GENERAL, PopupControlLayout ctrlLayout = POPUP_LAYOUT_CENTER ) = 0;
  157. virtual void popupSetRadioButtonText( CvPopup * pPopup, int iRadioButtonID, CvWString szText, int iGroup = 0, CvWString szHelpText = "" ) = 0;
  158. virtual void popupCreateCheckBoxes( CvPopup* pPopup, int iNumBoxes, int iGroup = 0, WidgetTypes eWidgetType = WIDGET_GENERAL, PopupControlLayout ctrlLayout = POPUP_LAYOUT_CENTER ) = 0;
  159. virtual void popupSetCheckBoxText( CvPopup* pPopup, int iCheckBoxID, CvWString szText, int iGroup = 0, CvWString szHelpText = "") = 0;
  160. virtual void popupSetCheckBoxState( CvPopup* pPopup, int iCheckBoxID, bool bChecked, int iGroup = 0 ) = 0;
  161. virtual void popupSetAsCancelled(CvPopup* pPopup) = 0;
  162. virtual bool popupIsDying(CvPopup* pPopup) = 0;
  163. virtual void setCityTabSelectionRow(CityTabTypes eTabType) = 0;
  164. virtual bool noTechSplash() = 0;
  165. virtual bool isInAdvancedStart() const = 0;
  166. virtual void setInAdvancedStart(bool bAdvancedStart) = 0;
  167. virtual bool isSpaceshipScreenUp() const = 0;
  168. virtual bool isDebugMenuCreated() const = 0;
  169. virtual void setBusy(bool bBusy) = 0;
  170. virtual void getInterfaceScreenIdsForInput(std::vector<int>& aIds) = 0;
  171. virtual void doPing(int iX, int iY, PlayerTypes ePlayer) = 0;
  172. };
  173. #endif // CvDLLInterfaceIFaceBase_h