29 #include "../idlib/precompiled.h"
48 dest =
dynamic_cast<idWinStr*
>((*src)[1].var);
49 int parmCount = src->
Num();
53 while (i < parmCount) {
55 val += (*src)[
i].var->
c_str();
66 (*src)[0].var->Set((*src)[1].var->c_str());
67 (*src)[0].var->SetEval(
false);
79 if (win && win->
win) {
93 if ( atoi( *parm ) ) {
112 str +=
" ; runScript ";
113 str += parm->
c_str();
157 if (parm && src->
Num() > 1) {
159 parm =
dynamic_cast<idWinStr*
>((*src)[1].var);
161 if (win && win->
win) {
186 if (src->
Num() >= 4) {
197 if (
NULL == rect ) {
198 val =
dynamic_cast<idWinFloat*
>((*src)[0].var);
207 if (!((vec4 || rect || val) && from && to && timeStr)) {
212 int time = atoi(*timeStr);
215 if (src->
Num() > 4) {
285 for (
int i = 0;
i <
c;
i++ ) {
309 for ( i = 0; i <
parms.
Num(); i++ ) {
310 if (
parms[i].own ) {
311 parms[
i].var->WriteToSaveGame( savefile );
333 for ( i = 0; i <
parms.
Num(); i++ ) {
334 if (
parms[i].own ) {
335 parms[
i].var->ReadFromSaveGame( savefile );
353 src->
Error(
"Unexpected end of file" );
367 src->
Error(
"Uknown script call %s", token.
c_str());
374 src->
Error(
"Unexpected end of file" );
398 src->
Error(
"incorrect number of parameters for script %s", commandList[i].
name );
412 for (
int i = 0;
i <
c;
i++) {
438 bool precacheBackground =
false;
439 bool precacheSounds =
false;
446 parms[0].own =
false;
448 if ( dynamic_cast<idWinBackground *>(dest) !=
NULL ) {
449 precacheBackground =
true;
452 precacheSounds =
true;
455 for (
int i = 1;
i < parmCount;
i++) {
463 defvar->
Init ( *str, win );
476 }
else if ((*str[0]) ==
'$') {
488 }
else if ( precacheBackground ) {
491 }
else if ( precacheSounds ) {
498 if ( token.
Icmp(
"play") == 0 ) {
499 if ( parser.
ReadToken(&token) && ( token !=
"" ) ) {
521 parms[0].own =
false;
529 for ( c = 1; c < 3; c ++ ) {
538 if ( (*str[0]) ==
'$' ) {
552 if ( ownerparent && destparent &&
576 for (
int i = 0;
i <
c;
i++) {
589 for (
int i = 0;
i <
c;
i++) {
609 for ( i = 0; i <
list.
Num(); i++ ) {
610 list[
i]->WriteToSaveGame( savefile );
622 for ( i = 0; i <
list.
Num(); i++ ) {
623 list[
i]->ReadFromSaveGame( savefile );
void Execute(idWindow *win)
void Error(const char *str,...) const id_attribute((format(printf
void Script_SetFocus(idWindow *window, idList< idGSWinVar > *src)
void Script_EvalRegs(idWindow *window, idList< idGSWinVar > *src)
assert(prefInfo.fullscreenBtn)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
void UnreadToken(idToken *token)
idCVarSystem * cvarSystem
void ScreenToClient(idRectangle *rect)
void AddDefinedVar(idWinVar *var)
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)=0
idWindow * GetParent(void)
drawWin_t * FindChildByName(const char *name)
void AddCommand(const char *cmd)
virtual void PlayShaderDirectly(const char *name, int channel=-1)=0
virtual void Set(const char *val)
void Script_Transition(idWindow *window, idList< idGSWinVar > *src)
void ClientToScreen(idRectangle *rect)
void FixupParms(idWindow *win)
void SetGranularity(int newgranularity)
int LoadMemory(const char *ptr, int length, const char *name)
void Script_LocalSound(idWindow *window, idList< idGSWinVar > *src)
void Script_Set(idWindow *window, idList< idGSWinVar > *src)
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
int Cmpn(const char *text, int n) const
int Icmp(const char *text) const
#define STRTABLE_ID_LENGTH
int Icmpn(const char *text, int n) const
int ReadToken(idToken *token)
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
virtual const char * c_str() const =0
void WriteToSaveGame(idFile *savefile)
const idVec4 & ToVec4() const
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
float EvalRegs(int test=-1, bool force=false)
void Script_ShowCursor(idWindow *window, idList< idGSWinVar > *src)
const char * GetSourceFile(void) const
virtual int Read(void *buffer, int len)
const char * GetString(const char *str) const
void Script_RunScript(idWindow *window, idList< idGSWinVar > *src)
idList< idGuiScript * > list
void(* handler)(idWindow *window, idList< idGSWinVar > *src)
void FixupParms(idWindow *win)
idWindow * GetDesktop() const
void Script_ResetCinematics(idWindow *window, idList< idGSWinVar > *src)
idWinVar * GetWinVarByName(const char *_name)
idDeclManager * declManager
idWindow * SetFocus(idWindow *w, bool scripts=true)
void(* handler)(idWindow *window, idList< idGSWinVar > *src)
bool RunScriptList(idGuiScriptList *src)
void Execute(idWindow *win)
idGuiScriptList * elseList
void ClearFlag(unsigned int f)
int Append(const type &obj)
void Script_EndGame(idWindow *window, idList< idGSWinVar > *src)
void ReadFromSaveGame(idFile *savefile)
guiCommandDef_t commandList[]
idUserInterfaceLocal * GetGui()
virtual int Write(const void *buffer, int len)
bool Parse(idParser *src)
virtual const char * c_str() const
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
const char * c_str(void) const
void WriteToSaveGame(idFile *savefile)
void SetSort(float s) const
idList< idGSWinVar > parms
virtual void Set(const char *val)
void SetFlag(unsigned int f)
virtual void Init(const char *_name, idWindow *win)
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
void Script_ResetTime(idWindow *window, idList< idGSWinVar > *src)
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
void ReadFromSaveGame(idFile *savefile)
void AddTransition(idWinVar *dest, idVec4 from, idVec4 to, int time, float accelTime, float decelTime)