!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! 2004.02.07 OROptionListMenu [Z, GLULX] ! Defines an object which reads the current OptionList of an object that inherits from ! OROptionList and displays an appropriate menu. Each object should !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !-------------------------------------------------------------------------------------- ! Created by Jim Fisher !-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - ! License: ! This work is licensed under the Creative Commons Attribution-ShareAlike License ! (http://creativecommons.org/licenses/by-sa/1.0/). ! ! In summary: you must credit the original author(s); if you alter, transform, or ! build upon this software, you may distribute the SOURCE FORM of the resulting ! work only under a license identical to this one. Note that the ShareAlike clause ! does not affect the way in which you distribute the COMPILED FORM of works built upon ! this software. Copyright remains with the original author(s), from whom you ! must seek permission if you wish to vary any of the terms of this license. ! The author(s) would also welcome bug reports and enhancement suggestions. !-------------------------------------------------------------------------------------- ! A more detailed description of this file, what it does, and how to use it goes here. ! !-------------------------------------------------------------------------------------- ! AutoDep: ORRockDispensor ! ORCenter ! ORMiniMenu !-------------------------------------------------------------------------------------- ! To register this module with your library, add the line: ! ! #ifdef USE_OROptionListMenu; #include "OROptionListMenu"; #endif; ! ! to the library header file (OR_Library_Include). To use in a game, add the line: ! ! Constant USE_OROptionListMenu; to the game file; ! ! to the game file; !-------------------------------------------------------------------------------------- ! Revision History ! 2002.04.03 Initial Creation ! 2002.04.21 Added code to support options directions (by defining the Directions ! property with a value to be displayed) ! 2002.04.22 Made directions work in GLULX mode. ! 2002.04.24 Fixed clear problem with incorrect line number with using directions. ! Also added OROptionList autodep code. ! 2002.05.01 Modified comments. ! 2002.07.14 Modified to allow menu options to *not* be included if they have the ! workflag attribute. This enables filtering of the menu prior to showing. ! 2004.02.01 Added support for source property to be a routine. !-------------------------------------------------------------------------------------- message " Processing library extension OROptionListMenu..."; !====================================================================================== ! D E P E N D A N C I E S section (for bringing in dependant modules) !====================================================================================== ! #ifndef _DONEREPLACE; default USE_ 0; message " [OROptionListMenu forcing inclusion of ]"; #include ""; #endif; #ifndef ORLibraryInclude; message fatalerror "OROptionListMenu has dependences and cannot stand alone. Leverage the OR_Library_Include file to automatically meet module prerequisites."; #endif; ! -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- #ifdef TARGET_GLULX; #ifndef ORRockDispensor_DONEREPLACE; default USE_ORRockDispensor 0; message " [OROptionListMenu forcing inclusion of ORRockDispensor]"; #include "ORRockDispensor"; #endif; #endif; #ifndef ORCenter_DONEREPLACE; default USE_ORCenter 0; message " [OROptionListMenu forcing inclusion of ORCenter]"; #include "ORCenter"; #endif; #ifndef ORMiniMenu_DONEREPLACE; default USE_ORMiniMenu 0; message " [OROptionListMenu forcing inclusion of ORMiniMenu]"; #include "ORMiniMenu"; #endif; #ifndef OROptionList_DONEREPLACE; default USE_OROptionList 0; message " [OROptionListMenu forcing inclusion of OROptionList]"; #include "OROptionList"; #endif; !====================================================================================== #ifndef LIBRARY_PARSER; #ifndef OROptionListMenu_DONEREPLACE; constant OROptionListMenu_DONEREPLACE; #ifdef OROptionListMenu_DONEREPLACE; #endif; !--suppress warning ! -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ! R E P L A C E section (for code that preceeds the inclusion of PARSER) !====================================================================================== !====================================================================================== #ifnot; message " ...Already Included. Skipping."; #endif; #ifnot; #ifndef LIBRARY_VERBLIB; #ifndef OROptionListMenu_DONEMESSAGE; constant OROptionListMenu_DONEMESSAGE; #ifdef OROptionListMenu_DONEMESSAGE; #endif; !--suppress warning ! -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ! M E S S A G E section (for code that falls between PARSER and VERBLIB ) !====================================================================================== ! #ifndef OREnglish; message fatalerror "ERROR!!!! OROptionListMenu requires the OREnglish file.";#endif; class OROptionListMenu class ORMiniMenu with source 0 , count[src t c o; src=ValueOrRun(self,source); if(src==0 || (src ofclass OROptionList)==false) return 0; for(t=0:tt) hasnt workflag) c++; if((src.&OptionList-->t) hasnt workflag) return c; return -1; ] , TranslatePositionToAbsolute[number t c src; src=ValueOrRun(self,source); for(t=0:tt) hasnt workflag) c++; if(number