24 #ifndef TINSEL_INVENTORY_H // prevent multiple includes 25 #define TINSEL_INVENTORY_H 27 #include "tinsel/dw.h" 28 #include "tinsel/events.h" 29 #include "tinsel/inv_objects.h" 30 #include "tinsel/object.h" 31 #include "tinsel/movers.h" 67 MAX_NUM_INV = NUM_INV_V3
70 #define INV_CONF ((TinselVersion == 3) ? NOIR_INV_CONF : DW0_INV_CONF) 71 #define NUM_INV ((TinselVersion == 3) ? NUM_INV_V3 : NUM_INV_V0) 78 INV_HELDNOTIN_V0 = -4,
85 #define INV_NOICON ((TinselVersion == 3) ? INV_NOICON_V3 : INV_NOICON_V0) 86 #define INV_HELDNOTIN ((TinselVersion == 3) ? INV_HELDNOTIN_V3 : INV_HELDNOTIN_V0) 95 enum InventoryType { EMPTY,
99 enum InvCursorFN { IC_AREA,
102 #define sliderRange (_sliderYmax - _sliderYmin) 104 #define MAX_PERMICONS 10 // Max permanent conversation icons 105 #define MAXHICONS 10 // Max dimensions of 106 #define MAXVICONS 6 // an inventory window 107 #define SG_DESC_LEN 40 // Max. saved game description length 110 #define MAX_WCOMP_T0 21 // 4 corners + (3+3) sides + (2+2) extra sides 113 #define MAX_WCOMP_T3 84 114 #define MAX_WCOMP (TinselVersion == 3 ? MAX_WCOMP_T3 : MAX_WCOMP_T0) 116 #define MAX_ICONS MAXHICONS *MAXVICONS 117 #define MAX_ININV_TOT 160 228 enum TM { TM_POINTER,
272 void popUpInventory(
int invno,
int menuId = -1);
273 void openMenu(CONFTYPE menuType);
275 void xMovement(
int x);
276 void yMovement(
int y);
278 void eventToInventory(PLR_EVENT pEvent,
const Common::Point &coOrds);
282 void holdItem(
int item,
bool bKeepFilm =
false);
283 void dropItem(
int item);
284 void clearInventory(
int invno);
285 void addToInventory(
int invno,
int icon,
bool hold =
false);
286 bool remFromInventory(
int invno,
int icon);
288 void registerIcons(
void *cptr,
int num);
290 void idec_convw(
SCNHANDLE text,
int MaxContents,
int MinWidth,
int MinHeight,
291 int StartWidth,
int StartHeight,
int MaxWidth,
int MaxHeight);
292 void idec_inv1(
SCNHANDLE text,
int MaxContents,
int MinWidth,
int MinHeight,
293 int StartWidth,
int StartHeight,
int MaxWidth,
int MaxHeight);
294 void idec_inv2(
SCNHANDLE text,
int MaxContents,
int MinWidth,
int MinHeight,
295 int StartWidth,
int StartHeight,
int MaxWidth,
int MaxHeight);
299 void idec_invMain(
SCNHANDLE text,
int MaxContents);
301 bool inventoryActive();
302 bool inventoryOrNotebookActive();
304 void permaConvIcon(
int icon,
bool bEnd =
false);
306 void convPos(
int bpos);
309 void closeDownConv();
310 void hideConversation(
bool hide);
313 void convAction(
int index);
314 void setConvDetails(CONV_PARAM fn,
HPOLYGON hPoly,
int ano);
315 void inventoryIconCursor(
bool bNewItem);
322 int invItem(
int *x,
int *y,
bool update);
323 int invItemId(
int x,
int y);
325 int inventoryPos(
int num);
327 bool isInInventory(
int object,
int invnum);
329 void killInventory();
333 int invGetLimit(
int invno);
334 void invSetLimit(
int invno,
int MaxContents);
335 void invSetSize(
int invno,
int MinWidth,
int MinHeight,
336 int StartWidth,
int StartHeight,
int MaxWidth,
int MaxHeight);
338 bool getIsInvObject(
int id);
340 int whichInventoryOpen();
346 const FILM *getObjectFilm(
int object)
const;
347 void setObjectFilm(
int object,
SCNHANDLE hFilm);
348 void callFunction(BFUNC boxFunc);
351 void invPutDown(
int index);
352 void slideMSlider(
int x, SSFN fn);
353 void addBoxes(
bool posnSlide);
354 void select(
int i,
bool force);
355 void fillInInventory();
356 void invCursor(InvCursorFN fn,
int CurX,
int CurY);
361 bool inventoryIsActive() {
return _inventoryState == ACTIVE_INV; }
362 bool isMixingDeskControl() {
return _invDragging == ID_MDCONT; }
363 int currentInventoryX() {
return _invD[_activeInv].inventoryX; }
364 int currentInventoryY() {
return _invD[_activeInv].inventoryY; }
365 bool configurationIsActive() {
return _activeInv == INV_CONF; }
366 bool displayObjectsActive() {
return _objArray[0] != NULL; }
367 bool inventoryIsHidden() {
return _InventoryHidden; }
368 const FILM *getWindowData();
372 bool isConvAndNotMove();
376 volatile int _pointedWaitCount;
378 char _saveGameDesc[SG_DESC_LEN + 2];
380 OBJECT *_iconArray[MAX_ICONS];
384 int whichMenuBox(
int curX,
int curY,
bool bSlides);
385 void confActionSpecial(
int i);
387 bool languageChange();
388 void primeSceneHopper();
389 void freeSceneHopper();
390 void rememberChosenScene();
391 void setChosenScene();
392 void firstEntry(
int first);
394 void dumpIconArray();
395 void dumpDobjArray();
397 void firstScene(
int first);
398 void firstFile(
int first);
399 int getObjectIndex(
int id)
const;
402 int invArea(
int x,
int y);
403 void invBoxes(
bool InBody,
int curX,
int curY);
404 void invLabels(
bool InBody,
int aniX,
int aniY);
409 void addSlider(
OBJECT **slide,
const FILM *pfilm);
410 void addBox(
int *pi,
const int i);
411 void addEWSlider(
OBJECT **slide,
const FILM *pfilm);
412 void positionInventory(
OBJECT *pMultiObj,
int xOffset,
int yOffset,
int zPosition);
413 int addExtraWindow(
int x,
int y,
OBJECT **retObj);
414 void constructInventoryCommon(SysReel reel,
bool hasTitle);
415 void constructConversationInventory();
416 void constructInventory(InventoryType filling);
417 void constructOtherInventory(
int menuId);
418 void constructMainInventory();
419 void alterCursor(
int num);
420 void setMenuGlobals(CONFINIT *ci);
421 void closeInventory();
422 int nearestSlideY(
int fity);
423 void slideSlider(
int y, SSFN fn);
424 void slideCSlider(
int y, SSFN fn);
425 void gettingTaller();
426 void gettingShorter();
428 void gettingNarrower();
429 void changeingSize();
432 bool menuDown(
int lines);
433 bool menuUp(
int lines);
438 void inventoryDown();
440 void menuAction(
int i,
bool dbl);
441 void invPickup(
int index);
445 void idec_inv(
int num,
SCNHANDLE text,
int MaxContents,
446 int MinWidth,
int MinHeight,
447 int StartWidth,
int StartHeight,
448 int MaxWidth,
int MaxHeight,
449 int startx,
int starty,
bool moveable);
459 DIRECTION _initialDirection;
468 int _permIcons[MAX_PERMICONS];
474 bool _InventoryHidden;
475 bool _InventoryMaximised;
488 int _TL, _TR, _BL, _BR;
489 int _TLwidth, _TLheight;
493 LANGUAGE _displayedLanguage;
495 OBJECT *_objArray[MAX_WCOMP_T3];
496 OBJECT *_dispObjArray[MAX_WCOMP_T3];
497 ANIM _iconAnims[MAX_ICONS];
499 OBJECT *_rectObject, *_slideObject;
503 int _sliderYmax, _sliderYmin;
509 } _slideStuff[MAX_ININV_TOT + 1];
516 MDSLIDES _mdSlides[MAXSLIDES];
524 CONV_PARAM _thisConvFn;
542 int _lastChosenScene;
556 BOGUS_INV } _inventoryState;
570 ID_MDCONT } _invDragging;
573 void ObjectEvent(
CORO_PARAM,
int objId,
TINSEL_EVENT event,
bool bWait,
int myEscape,
bool *result = NULL);
Definition: inv_objects.h:80
uint32 SCNHANDLE
Definition: dw.h:31
Definition: inv_objects.h:105
Definition: dialogs.h:133
BTYPE
Definition: dialogs.h:180
Action always, text box.
Definition: dialogs.h:184
Discworld 2 toggle type 2.
Definition: dialogs.h:190
Discworld 2 toggle type 1.
Definition: dialogs.h:189
Action always, graphic button.
Definition: dialogs.h:186
Definition: serializer.h:79
TINSEL_EVENT
Definition: events.h:91
#define CORO_PARAM
Definition: coroutines.h:107
Not a button at all.
Definition: dialogs.h:187
Definition: algorithm.h:29
Definition: dialogs.h:259
Definition: dialogs.h:267
Discworld 1 toggle.
Definition: dialogs.h:188
Definition: inv_objects.h:50
Definition: keyboard.h:294
Definition: dialogs.h:174
Action always.
Definition: dialogs.h:183
Action if a radio button is selected.
Definition: dialogs.h:182
Definition: dialogs.h:243
Radio button group - 1 is selectable at a time. Action on double click.
Definition: dialogs.h:181
Definition: dialogs.h:167
int HPOLYGON
Definition: dw.h:34