int lngFileID = -1; ref refUsedCharacter; int chrPerksQ = 0; string strPerkName; string newLine; int imageQuantity = 0; int perksIconsQ = 0; int g_nGroup = 0; int g_nLine = 0; void InitInterface_R(string iniName, ref chref) { GameInterface.title = "titleAbilitys"; refUsedCharacter = chref; SendMessage(&GameInterface,"ls",MSG_INTERFACE_INIT,iniName); CreateString(true,"ChrName",refUsedCharacter.name+" "+refUsedCharacter.lastname,FONT_NORMAL,COLOR_NORMAL,320,38,SCRIPT_ALIGN_CENTER,1.0); CreateString(true,"FreeAbilitys","",FONT_NORMAL,COLOR_NORMAL,320,72,SCRIPT_ALIGN_CENTER,1.0); lngFileID = LanguageOpenFile("AbilityDescribe.txt"); newLine = LanguageConvertString(lngFileID,"newLine"); SetNodeUsing("DESCRIBEWINDOW",false); SetNodeUsing("PERK_NAME",false); SetNodeUsing("PERK_IMAGE",false); SetNodeUsing("OK_BUTTON",false); SetNodeUsing("CANCEL_BUTTON",false); SetNodeUsing("DESCRIBE_RECT",false); SetEventHandler("InterfaceBreak","ProcessCancelExit",0); SetEventHandler("exitCancel","ProcessCancelExit",0); SetEventHandler("ievnt_command","ProcessCommandExecute",0); SetEventHandler("FormatedTextActivate","procFTActivate",0); SetEventHandler("SetScrollerPos","procFTSetScrollPos",0); SetEventHandler("ScrollPosChange","ProcScrollPosChange",0); SetEventHandler("evntUpdateFormtText","procFTUpdate",0); SetAbilitesList(); } void ProcessCancelExit() { DoIExit(RC_INTERFACE_PERKS_EXIT); } void DoIExit(int exitCode) { LanguageCloseFile(lngFileID); DelEventHandler("InterfaceBreak","ProcessCancelExit"); DelEventHandler("exitCancel","ProcessCancelExit"); DelEventHandler("ievnt_command","ProcessCommandExecute"); DelEventHandler("FormatedTextActivate","procFTActivate"); DelEventHandler("SetScrollerPos","procFTSetScrollPos"); DelEventHandler("ScrollPosChange","ProcScrollPosChange"); DelEventHandler("evntUpdateFormtText","procFTUpdate"); interfaceResultCommand = exitCode; if( CheckAttribute(&InterfaceStates,"InstantExit") && sti(InterfaceStates.InstantExit)==true ) { EndCancelInterface(true); } else { PostEvent("LaunchIAfterFrame",1,"sl", "I_CHARACTER", 1); EndCancelInterface(false); } } void ProcessCommandExecute() { string comName = GetEventData(); string nodName = GetEventData(); switch(nodName) { case "OK_BUTTON": if(comName=="deactivate") { ReturnToPerksView(); } if(comName=="activate" || comName=="click") { SetPerkToCharacter(); ReturnToPerksView(); } break; case "CANCEL_BUTTON": if(comName=="deactivate" || comName=="activate" || comName=="click") {ReturnToPerksView();} if(comName=="leftstep") { if(GetSelectable("OK_BUTTON")) { SetCurrentNode("OK_BUTTON"); } } break; } } void SetAbilitesList() { int perksQ,i; string tmpStr,perkName; aref arPerksRoot,arChrPerk; chrPerksQ = 0; // Варианты перков, которые можно добавить makearef(arPerksRoot,ChrPerksList.list); perksQ = GetAttributesNum(arPerksRoot); for(i=0; i=0) { tmpstr = GetPerkName(grNum); nPerkState = GetPerkState(tmpstr); switch(nPerkState) { case 0: argbColor = argb(255,128,128,128); tmpstr = "64\"+tmpstr; break; case 1: argbColor = argb(255,128,128,128); tmpstr = "64Disable\"+tmpstr; break; case 2: argbColor = argb(255,128,128,128); tmpstr = "64Disable\"+tmpstr; break; } SetNodeUsing("PERK_ICON_"+imgQ,true); SetNodeUsing("PERK_STATE_"+imgQ, nPerkState==0); SetNewPicture("PERK_ICON_"+imgQ,"interfaces\perks\" + tmpstr + ".tga"); SendMessage(&GameInterface,"lsll",MSG_INTERFACE_MSG_TO_NODE,"PERK_ICON_"+imgQ, 4,argbColor); imgQ++; } grNum++; } for(i=imgQ; i