void CUIOptConCom::Init() { ReadPlayerNameFromRegistry(); CMD3(CCC_UserName, "mm_net_player_name", m_playerName, 64); m_iMaxPlayers = 32; m_curGameMode = eGameIDDeathmatch; CMD4(CCC_Integer, "mm_net_srv_maxplayers", &m_iMaxPlayers, 2, 32); CMD3(CCC_Token, "mm_net_srv_gamemode", &m_curGameMode, g_GameModes); m_uNetSrvParams.zero(); CMD3(CCC_Mask, "mm_mm_net_srv_dedicated", &m_uNetSrvParams, flNetSrvDedicated); CMD3(CCC_Mask, "mm_net_con_publicserver", &m_uNetSrvParams, flNetConPublicServer); CMD3(CCC_Mask, "mm_net_con_spectator_on", &m_uNetSrvParams, flNetConSpectatorOn); m_iNetConSpectator = 20; CMD4(CCC_Integer, "mm_net_con_spectator", &m_iNetConSpectator, 1, 32); xr_strcpy(reinforcementType, "reinforcement"); CMD3(CCC_String, "mm_net_srv_reinforcement_type", reinforcementType, sizeof(reinforcementType)); m_fNetWeatherRate = 1.0f; CMD4(CCC_Float, "mm_net_weather_rateofchange", &m_fNetWeatherRate, 0.0, 100.0f); xr_strcpy(m_serverName, "Stalker"); CMD3(CCC_String, "mm_net_srv_name", m_serverName, sizeof(m_serverName)); m_uNetFilter.one (); CMD3(CCC_Mask, "mm_net_filter_empty", &m_uNetFilter, fl_empty); CMD3(CCC_Mask, "mm_net_filter_full", &m_uNetFilter, fl_full); CMD3(CCC_Mask, "mm_net_filter_pass", &m_uNetFilter, fl_pass); CMD3(CCC_Mask, "mm_net_filter_wo_pass", &m_uNetFilter, fl_wo_pass); CMD3(CCC_Mask, "mm_net_filter_wo_ff", &m_uNetFilter, fl_wo_ff); CMD3(CCC_Mask, "mm_net_filter_listen", &m_uNetFilter, fl_listen); };
void CMainMenu::OnRunDownloadedPatch (CUIWindow*, void*) { xr_strcpy (g_sLaunchOnExit_app,*m_sPatchFileName); xr_strcpy (g_sLaunchOnExit_params,""); xr_strcpy (g_sLaunchWorkingFolder, ""); Console->Execute ("quit"); }
virtual void Execute (LPCSTR args) { CCC_Token::Execute (args); string_path _cfg; string_path cmd; switch (*value) { case 0: xr_strcpy(_cfg, "rspec_minimum.ltx"); break; case 1: xr_strcpy(_cfg, "rspec_low.ltx"); break; case 2: xr_strcpy(_cfg, "rspec_default.ltx"); break; case 3: xr_strcpy(_cfg, "rspec_high.ltx"); break; case 4: xr_strcpy(_cfg, "rspec_extreme.ltx"); break; } FS.update_path (_cfg,"$game_config$",_cfg); strconcat (sizeof(cmd),cmd,"cfg_load", " ", _cfg); Console->Execute (cmd); }
void CBlender_Compile::PassBegin () { RS.Invalidate (); passTextures.clear (); passMatrices.clear (); passConstants.clear (); xr_strcpy (pass_ps,"null"); xr_strcpy (pass_vs,"null"); dwStage = 0; }
void xrSASH::TryInitEngine( bool bNoRun) { if (m_bReinitEngine) { InitEngine(); // It was destroyed on previous exit Console->Initialize(); } xr_strcpy (Console->ConfigFile,"user.ltx"); if (strstr(Core.Params,"-ltx ")) { string64 c_name; sscanf (strstr(Core.Params,"-ltx ")+5,"%[^ ] ",c_name); xr_strcpy (Console->ConfigFile,c_name); } if(strstr(Core.Params,"-r2a")) Console->Execute ("renderer renderer_r2a"); else if(strstr(Core.Params,"-r2")) Console->Execute ("renderer renderer_r2"); else { CCC_LoadCFG_custom* pTmp = xr_new<CCC_LoadCFG_custom>("renderer "); pTmp->Execute (Console->ConfigFile); if (m_bOpenAutomate) pTmp->Execute ("SASH.ltx"); else pTmp->Execute (Console->ConfigFile); xr_delete (pTmp); } InitInput(); Engine.External.Initialize( ); if (bNoRun) InitSound1(); Console->Execute ("unbindall"); Console->ExecuteScript (Console->ConfigFile); if (m_bOpenAutomate) { // Overwrite setting using SASH.ltx if has any. xr_strcpy(Console->ConfigFile,"SASH.ltx"); Console->ExecuteScript (Console->ConfigFile); } if (bNoRun) { InitSound2(); Device.Create(); } }
void CBlender_Model::Save ( IWriter& fs ) { IBlender::Save (fs); xrPWRITE_PROP (fs,"Use alpha-channel", xrPID_BOOL, oBlend); xrPWRITE_PROP (fs,"Alpha ref", xrPID_INTEGER, oAREF); xrP_TOKEN::Item I; xrPWRITE_PROP (fs,"Tessellation", xrPID_TOKEN, oTessellation); I.ID = 0; xr_strcpy(I.str,"NO_TESS"); fs.w (&I,sizeof(I)); I.ID = 1; xr_strcpy(I.str,"TESS_PN"); fs.w (&I,sizeof(I)); I.ID = 2; xr_strcpy(I.str,"TESS_HM"); fs.w (&I,sizeof(I)); I.ID = 3; xr_strcpy(I.str,"TESS_PN+HM"); fs.w (&I,sizeof(I)); }
bool EFS_Utils::GetOpenName(LPCSTR initial, xr_string& buffer, bool bMulti, LPCSTR offset, int start_flt_ext ) { char buf [255*255]; //max files to select xr_strcpy (buf, buffer.c_str()); /* char* g_SHBF_Folder =("C:\\Program Files"); TCHAR path[_MAX_PATH]; BROWSEINFO info={NULL,NULL,path,"title",BIF_USENEWUI,BrowseCallbackProc, (LPARAM)g_SHBF_Folder }; SHBrowseForFolder (&info); */ /* { HANDLE hDialog = OSDInit(true, "SDITEST", 0, 0, 0, 0, 0, 0); if(hDialog) { OSDRET osResult=OSDDoModal(hDialog, 0); OSDRelease(hDialog); } } */ // bool bRes = false; bool bRes = GetOpenNameInternal(initial, buf, sizeof(buf), bMulti, offset, start_flt_ext); if (bRes) buffer=(char*)buf; return bRes; }
CUIQuestionItem::CUIQuestionItem(CUIXml* xml_doc, LPCSTR path) { m_text = xr_new<CUI3tButton>(); m_text->SetAutoDelete (true); AttachChild (m_text); string512 str; CUIXmlInit xml_init; xr_strcpy (str,path); xml_init.InitWindow (*xml_doc, str, 0, this); m_min_height = xml_doc->ReadAttribFlt(path,0,"min_height",15.0f); strconcat (sizeof(str),str,path,":content_text"); xml_init.Init3tButton (*xml_doc, str, 0, m_text); Register (m_text); AddCallback (m_text,BUTTON_CLICKED,CUIWndCallback::void_function(this, &CUIQuestionItem::OnTextClicked)); m_num_text = xr_new<CUITextWnd>(); m_num_text->SetAutoDelete (true); AttachChild (m_num_text); strconcat (sizeof(str),str,path,":num_text"); xml_init.InitTextWnd (*xml_doc, str, 0, m_num_text); }
CALifeSimulator::CALifeSimulator (xrServer *server, shared_str *command_line) : CALifeUpdateManager(server, alife_section), CALifeSimulatorBase (server,alife_section) { restart_all (); ai().set_alife (this); setup_command_line (command_line); typedef IGame_Persistent::params params; params &p = g_pGamePersistent->m_game_params; R_ASSERT2 ( xr_strlen(p.m_game_or_spawn) && !xr_strcmp(p.m_alife,"alife") && !xr_strcmp(p.m_game_type,"single"), "Invalid server options!" ); string256 temp; xr_strcpy (temp,p.m_game_or_spawn); xr_strcat (temp,"/"); xr_strcat (temp,p.m_game_type); xr_strcat (temp,"/"); xr_strcat (temp,p.m_alife); *command_line = temp; LPCSTR start_game_callback = pSettings->r_string(alife_section,"start_game_callback"); luabind::functor<void> functor; R_ASSERT2 (ai().script_engine().functor(start_game_callback,functor),"failed to get start game callback"); functor (); load (p.m_game_or_spawn,!xr_strcmp(p.m_new_or_load,"load") ? false : true, !xr_strcmp(p.m_new_or_load,"new")); }
xr_string EFS_Utils::AppendFolderToName(xr_string& tex_name, int depth, BOOL full_name) { string1024 nm; xr_strcpy(nm,tex_name.c_str()); tex_name = AppendFolderToName(nm,sizeof(nm),depth,full_name); return tex_name; }
BOOL is_combat_cover (shared_str const &table_id) { if (table_id.size() == 0) return (FALSE); string256 temp; xr_strcpy (temp, "smart_covers.descriptions."); xr_strcat (temp, *table_id); luabind::object table, value; bool result = ai().script_engine().function_object( temp, table, LUA_TTABLE ); VERIFY2 (result, make_string("bad or missing description in smart_cover [%s]", table_id.c_str())); if (table.type() != LUA_TTABLE) { VERIFY (table.type() != LUA_TNIL); return (TRUE); } value = table["is_combat_cover"]; if (value.type() == LUA_TNIL) { Msg ("! is_combat_cover flag not found for smart_cover [%s], forcing to \"true\"", table_id.c_str()); return (TRUE); } return (parse_bool(table, "is_combat_cover") ? TRUE : FALSE); }
void CUIGameCTA::LoadTeamDefaultPresetItems (const shared_str& caSection) { if (!pSettings->line_exist(caSection, "default_items")) return; if (!m_pCurBuyMenu) return; PlayerDefItems.clear(); string256 ItemName; string4096 DefItems; // Читаем данные этого поля xr_strcpy(DefItems, pSettings->r_string(caSection, "default_items")); u32 count = _GetItemCount(DefItems); // теперь для каждое имя оружия, разделенные запятыми, заносим в массив for (u32 i = 0; i < count; ++i) { _GetItem(DefItems, i, ItemName); u8 SlotID, ItemID; m_pCurBuyMenu->GetWeaponIndexByName(ItemName, SlotID, ItemID); if (SlotID == 0xff || ItemID == 0xff) continue; // s16 ID = GetBuyMenuItemIndex(SlotID, ItemID); s16 ID = GetBuyMenuItemIndex(0, ItemID); PlayerDefItems.push_back(ID); }; };
virtual void Execute(LPCSTR args) { string_path cfg_full_name; xr_strcpy(cfg_full_name, (xr_strlen(args) > 0) ? args : Console->ConfigFile); bool b_abs_name = xr_strlen(cfg_full_name) > 2 && cfg_full_name[1] == ':'; if (!b_abs_name) FS.update_path(cfg_full_name, "$app_data_root$", cfg_full_name); if (strext(cfg_full_name)) *strext(cfg_full_name) = 0; xr_strcat(cfg_full_name, ".ltx"); BOOL b_allow = TRUE; if (FS.exist(cfg_full_name)) b_allow = SetFileAttributes(cfg_full_name, FILE_ATTRIBUTE_NORMAL); if (b_allow) { IWriter* F = FS.w_open(cfg_full_name); CConsole::vecCMD_IT it; for (it = Console->Commands.begin(); it != Console->Commands.end(); it++) it->second->Save(F); FS.w_close(F); Msg("Config-file [%s] saved successfully", cfg_full_name); } else Msg("!Cannot store config file [%s]", cfg_full_name); }
void protect_Name_strlwr(LPSTR str) { string4096 out; xr_strcpy(out, sizeof(out), str); strlwr(str); LPCSTR name_str = "name="; LPCSTR name1 = strstr(str, name_str); if (!name1 || !xr_strlen(name1)) { return; } int begin_p = xr_strlen(str) - xr_strlen(name1) + xr_strlen(name_str); if (begin_p < 1) { return; } LPCSTR name2 = strchr(name1, '/'); int end_p = xr_strlen(str) - ((name2) ? xr_strlen(name2) : 0); if (begin_p >= end_p) { return; } for (int i = begin_p; i < end_p; ++i) { str[i] = out[i]; } }
void CSE_SmartCover::check_enterable_loopholes(shared_str const &description) { string256 temp; xr_strcpy (temp, "smart_covers.descriptions."); xr_strcat (temp, m_description.c_str()); xr_strcat (temp, ".transitions"); luabind::object transitions; bool result = ai().script_engine().function_object( temp, transitions, LUA_TTABLE ); VERIFY2 (result, make_string("bad or missing transitions table in smart_cover [%s]", temp)); luabind::object::iterator I = transitions.begin(); luabind::object::iterator E = transitions.end(); for ( ; I != E; ++I) { luabind::object table = *I; if (table.type() != LUA_TTABLE) { VERIFY (table.type() != LUA_TNIL); continue; } shared_str vertex_0 = smart_cover::parse_vertex(table, "vertex0", true); if (vertex_0 != smart_cover::transform_vertex("", true)) continue; set_enterable (smart_cover::parse_vertex(table, "vertex1", false)); } }
void CUIZoneMap::Update() { CActor* pActor = smart_cast<CActor*>( Level().CurrentViewEntity() ); if ( !pActor ) return; if ( !( Device.dwFrame % 20 ) && IsGameTypeSingle() ) { string16 text_str; xr_strcpy( text_str, sizeof(text_str), "" ); CPda* pda = pActor->GetPDA(); if ( pda ) { u32 cn = pda->ActiveContactsNum(); if ( cn > 0 ) { xr_sprintf( text_str, sizeof(text_str), "%d", cn ); } } m_Counter_text.SetText( text_str ); } UpdateRadar( Device.vCameraPosition ); float h, p; Device.vCameraDirection.getHP( h, p ); SetHeading( -h ); m_clock_wnd->TextItemControl()->SetText( InventoryUtilities::GetGameTimeAsString( InventoryUtilities::etpTimeToMinutes ).c_str() ); }
void Phase (const char *phase_name) { while (!(hwPhaseTime && hwStage)) Sleep(1); csLog.Enter (); // Replace phase name with TIME:Name char tbuf [512]; bPhaseChange = TRUE; phase_total_time = timeGetTime()-phase_start_time; xr_sprintf ( tbuf,"%s : %s",make_time(phase_total_time/1000).c_str(), phase); SendMessage ( hwPhaseTime, LB_DELETESTRING, SendMessage(hwPhaseTime,LB_GETCOUNT,0,0)-1,0); SendMessage ( hwPhaseTime, LB_ADDSTRING, 0, (LPARAM) tbuf); // Start _new phase phase_start_time = timeGetTime(); xr_strcpy (phase, phase_name); SetWindowText ( hwStage, phase_name ); xr_sprintf ( tbuf,"--:--:-- * %s",phase); SendMessage ( hwPhaseTime, LB_ADDSTRING, 0, (LPARAM) tbuf); SendMessage ( hwPhaseTime, LB_SETTOPINDEX, SendMessage(hwPhaseTime,LB_GETCOUNT,0,0)-1,0); Progress (0); // Release focus Msg("\n* New phase started: %s",phase_name); csLog.Leave (); }
CDemoPlay::CDemoPlay(const char *name, float ms, u32 cycles, float life_time) : CEffectorCam(cefDemo,life_time/*,FALSE*/) { Msg ("*** Playing demo: %s",name); Console->Execute ("hud_weapon 0"); if( g_bBenchmark || g_SASH.IsRunning() ) Console->Execute ("hud_draw 0"); fSpeed = ms; dwCyclesLeft = cycles?cycles:1; m_pMotion = 0; m_MParam = 0; string_path nm, fn; xr_strcpy (nm,sizeof(nm),name); LPSTR extp =strext(nm); if (extp) xr_strcpy ( nm, sizeof( nm ) - ( extp - nm ), ".anm"); if ( FS.exist(fn,"$level$",nm) || FS.exist(fn,"$game_anims$",nm) ) { m_pMotion = xr_new<COMotion> (); m_pMotion->LoadMotion (fn); m_MParam = xr_new<SAnimParams> (); m_MParam->Set (m_pMotion); m_MParam->Play (); }else{ if (!FS.exist(name)) { g_pGameLevel->Cameras().RemoveCamEffector (cefDemo); return ; } IReader* fs = FS.r_open (name); u32 sz = fs->length(); if (sz%sizeof(Fmatrix) != 0) { FS.r_close (fs); g_pGameLevel->Cameras().RemoveCamEffector (cefDemo); return ; } seq.resize (sz/sizeof(Fmatrix)); m_count = seq.size(); CopyMemory (&*seq.begin(),fs->pointer(),sz); FS.r_close (fs); Log ("~ Total key-frames: ",m_count); } stat_started = FALSE; Device.PreCache (50, true, false); }
void player_hud_motion_container::load(IKinematicsAnimated* model, const shared_str& sect) { CInifile::Sect& _sect = pSettings->r_section(sect); CInifile::SectCIt _b = _sect.Data.begin(); CInifile::SectCIt _e = _sect.Data.end(); player_hud_motion* pm = NULL; string512 buff; MotionID motion_ID; for(;_b!=_e;++_b) { if(strstr(_b->first.c_str(), "anm_")==_b->first.c_str()) { const shared_str& anm = _b->second; m_anims.resize (m_anims.size()+1); pm = &m_anims.back(); //base and alias name pm->m_alias_name = _b->first; if(_GetItemCount(anm.c_str())==1) { pm->m_base_name = anm; pm->m_additional_name = anm; }else { R_ASSERT2(_GetItemCount(anm.c_str())==2, anm.c_str()); string512 str_item; _GetItem(anm.c_str(),0,str_item); pm->m_base_name = str_item; _GetItem(anm.c_str(),1,str_item); pm->m_additional_name = str_item; } //and load all motions for it for(u32 i=0; i<=8; ++i) { if(i==0) xr_strcpy (buff,pm->m_base_name.c_str()); else xr_sprintf (buff,"%s%d",pm->m_base_name.c_str(),i); motion_ID = model->ID_Cycle_Safe(buff); if(motion_ID.valid()) { pm->m_animations.resize (pm->m_animations.size()+1); pm->m_animations.back().mid = motion_ID; pm->m_animations.back().name = buff; #ifdef DEBUG // Msg(" alias=[%s] base=[%s] name=[%s]",pm->m_alias_name.c_str(), pm->m_base_name.c_str(), buff); #endif // #ifdef DEBUG } } R_ASSERT2(pm->m_animations.size(),make_string("motion not found [%s]", pm->m_base_name.c_str()).c_str()); } } }
shared_str game_sv_GameState::parse_level_version (const shared_str &server_options) { const char* map_ver = strstr(server_options.c_str(), map_ver_string); string128 result_version; if (map_ver) { map_ver += sizeof(map_ver_string); if (strchr(map_ver, '/')) strncpy_s(result_version, map_ver, strchr(map_ver, '/') - map_ver); else xr_strcpy(result_version, map_ver); } else { xr_strcpy(result_version, default_map_version); } return shared_str(result_version); }
void CSE_Visual::set_visual (LPCSTR name, bool load) { string_path tmp; xr_strcpy (tmp,name); if (strext(tmp)) *strext(tmp) = 0; xr_strlwr (tmp); visual_name = tmp; }
void CUILogsWnd::Init() { m_uiXml.Load( CONFIG_PATH, UI_PATH, PDA_LOGS_XML ); CUIXmlInit::InitWindow( m_uiXml, "main_wnd", 0, this ); // m_background = UIHelper::CreateFrameLine( m_uiXml, "background", this ); m_background = UIHelper::CreateFrameWindow(m_uiXml, "background", this); m_center_background = UIHelper::CreateFrameWindow(m_uiXml, "center_background", this); //m_actor_ch_info = xr_new<CUICharacterInfo>(); //m_actor_ch_info->SetAutoDelete( true ); //AttachChild( m_actor_ch_info ); //m_actor_ch_info->InitCharacterInfo( &m_uiXml, "actor_ch_info" ); // m_center_background = UIHelper::CreateStatic( m_uiXml, "center_background", this ); m_center_caption = UIHelper::CreateTextWnd( m_uiXml, "center_caption", this ); string256 buf; xr_strcpy( buf, sizeof(buf), m_center_caption->GetText() ); xr_strcat( buf, sizeof(buf), CStringTable().translate("ui_logs_center_caption").c_str() ); m_center_caption->SetText( buf ); CUIFixedScrollBar* tmp_scroll = xr_new<CUIFixedScrollBar>(); m_list = xr_new<CUIScrollView>(tmp_scroll); m_list->SetAutoDelete( true ); AttachChild( m_list ); CUIXmlInit::InitScrollView( m_uiXml, "logs_list", 0, m_list); // m_list->SetWindowName("---logs_list"); // m_logs_list->m_sort_function = fastdelegate::MakeDelegate( this, &CUIRankingWnd::SortingLessFunction ); m_filter_news = UIHelper::CreateCheck( m_uiXml, "filter_news", this ); m_filter_talk = UIHelper::CreateCheck( m_uiXml, "filter_talk", this ); m_filter_news->SetCheck( true ); m_filter_talk->SetCheck( true ); // m_date_caption = UIHelper::CreateTextWnd( m_uiXml, "date_caption", this ); // m_date = UIHelper::CreateTextWnd( m_uiXml, "date", this ); m_period_caption = UIHelper::CreateTextWnd( m_uiXml, "period_caption", this ); m_period = UIHelper::CreateTextWnd( m_uiXml, "period", this ); m_prev_period = UIHelper::Create3tButton( m_uiXml, "btn_prev_period", this ); m_next_period = UIHelper::Create3tButton( m_uiXml, "btn_next_period", this ); Register( m_filter_news ); Register( m_filter_talk ); Register( m_prev_period ); Register( m_next_period ); AddCallback( m_filter_news, BUTTON_CLICKED, CUIWndCallback::void_function( this, &CUILogsWnd::UpdateChecks ) ); AddCallback( m_filter_talk, BUTTON_CLICKED, CUIWndCallback::void_function( this, &CUILogsWnd::UpdateChecks ) ); AddCallback( m_prev_period, BUTTON_CLICKED, CUIWndCallback::void_function( this, &CUILogsWnd::PrevPeriod ) ); AddCallback( m_next_period, BUTTON_CLICKED, CUIWndCallback::void_function( this, &CUILogsWnd::NextPeriod ) ); m_start_game_time = Level().GetStartGameTime(); m_start_game_time = GetShiftPeriod( m_start_game_time, 0 ); }
LPSTR _GetItem(LPCSTR src, int index, LPSTR dst, u32 const dst_size, char separator, LPCSTR def, bool trim) { LPCSTR ptr; ptr = _SetPos(src, index, separator); if (ptr) _CopyVal(ptr, dst, separator); else xr_strcpy(dst, dst_size, def); if (trim) _Trim(dst); return dst; }
dxRender_Visual* CModelPool::Instance_Load (const char* N, BOOL allow_register) { dxRender_Visual *V; string_path fn; string_path name; // Add default ext if no ext at all if (0==strext(N)) strconcat (sizeof(name),name,N,".ogf"); else xr_strcpy (name,sizeof(name),N); // Load data from MESHES or LEVEL if (!FS.exist(N)) { if (!FS.exist(fn, "$level$", name)) if (!FS.exist(fn, "$game_meshes$", name)){ #ifdef _EDITOR Msg("!Can't find model file '%s'.",name); return 0; #else Debug.fatal(DEBUG_INFO,"Can't find model file '%s'.",name); #endif } } else { xr_strcpy (fn,N); } // Actual loading #ifdef DEBUG if (bLogging) Msg ("- Uncached model loading: %s",fn); #endif // DEBUG IReader* data = FS.r_open(fn); ogf_header H; data->r_chunk_safe (OGF_HEADER,&H,sizeof(H)); V = Instance_Create (H.type); V->Load (N,data,0); FS.r_close (data); g_pGamePersistent->RegisterModel(V); // Registration if (allow_register) Instance_Register(N,V); return V; }
bool EFS_Utils::GetSaveName( LPCSTR initial, xr_string& buffer, LPCSTR offset, int start_flt_ext ) { string_path buf; xr_strcpy (buf,sizeof(buf), buffer.c_str()); bool bRes = GetSaveName(initial, buf ,offset, start_flt_ext); if (bRes) buffer = buf; return bRes; }
BOOL CRestrictedObject::net_Spawn (CSE_Abstract* data) { CSE_Abstract *abstract = (CSE_Abstract*)(data); CSE_ALifeMonsterAbstract *monster = smart_cast<CSE_ALifeMonsterAbstract*>(abstract); VERIFY (monster); m_applied = false; m_removed = true; string4096 temp0; string4096 temp1; xr_strcpy (temp0,*monster->m_out_space_restrictors); xr_strcpy (temp1,*monster->m_in_space_restrictors); if (ai().get_alife()) { construct_string (temp0,sizeof(temp0),monster->m_dynamic_out_restrictions); construct_string (temp1,sizeof(temp1),monster->m_dynamic_in_restrictions); } #if 0 string4096 temp2; string4096 temp3; construct_id_string (temp2,monster->m_dynamic_out_restrictions); construct_id_string (temp3,monster->m_dynamic_in_restrictions); Msg ("Restricting object %s with",monster->name_replace()); Msg ("STATIC OUT : %s",*monster->m_out_space_restrictors); Msg ("STATIC IN : %s",*monster->m_in_space_restrictors); Msg ("DYNAMIC OUT : %s",temp2); Msg ("DYNAMIC IN : %s",temp3); Msg ("OUT : %s",temp0); Msg ("IN : %s",temp1); #endif Level().space_restriction_manager().restrict (monster->ID,temp0,temp1); actual (true); return (TRUE); }
CUICellItem* CUIDragDropReferenceList::RemoveItem(CUICellItem* itm, bool force_root) { Ivector2 vec2 = m_container->GetItemPos(itm); if(vec2.x!=-1&&vec2.y!=-1) { u8 index = u8(vec2.x); xr_strcpy(ACTOR_DEFS::g_quick_use_slots[index], ""); m_references[index]->SetTextureColor(color_rgba(255,255,255,0)); } inherited::RemoveItem(itm, force_root); return NULL; }
void CUIMapList::StartDedicatedServer(){ string_path ModuleFileName; GetModuleFileName(NULL, ModuleFileName, sizeof(ModuleFileName)); char* ModuleName = NULL; GetFullPathName (ModuleFileName, sizeof(g_sLaunchWorkingFolder), g_sLaunchWorkingFolder, &ModuleName); //removing module name from WorkingDirectory that contain full path... ModuleName[0] = 0; xr_strcpy (g_sLaunchOnExit_app, g_sLaunchWorkingFolder); xr_strcat (g_sLaunchOnExit_app, "dedicated\\xrEngine.exe"); xr_strcpy (g_sLaunchOnExit_params, g_sLaunchOnExit_app); xr_strcat (g_sLaunchOnExit_params, " -i -fsltx ..\\fsgame.ltx -nosound -"); xr_strcat (g_sLaunchOnExit_params, GetCommandLine("")); Msg ("Going to quit before starting dedicated server"); Msg ("Working folder is:%s", g_sLaunchWorkingFolder); Msg ("%s %s",g_sLaunchOnExit_app, g_sLaunchOnExit_params); Console->Execute ("quit"); }
void CUIDragDropReferenceList::OnItemDrop(CUIWindow* w, void* pData) { OnItemSelected(w, pData); CUICellItem* itm = smart_cast<CUICellItem*>(w); VERIFY(itm->OwnerList() == itm->OwnerList()); if(m_f_item_drop && m_f_item_drop(itm)) { DestroyDragItem(); return; } CUIDragDropListEx* old_owner = itm->OwnerList(); CUIDragDropListEx* new_owner = m_drag_item->BackList(); if(old_owner && new_owner && old_owner!=new_owner) { inherited::OnItemDrop(w, pData); return; } CActor* actor = smart_cast<CActor*>(Level().CurrentViewEntity()); if(actor) { Ivector2 vec = PickCell(GetUICursor().GetCursorPosition()); if(vec.x!=-1&&vec.y!=-1) { Ivector2 vec2 = m_container->GetItemPos(itm); if(vec2.x!=-1&&vec2.y!=-1) { u8 index = u8(vec2.x); shared_str tmp = ACTOR_DEFS::g_quick_use_slots[vec.x]; xr_strcpy(ACTOR_DEFS::g_quick_use_slots[vec.x], ACTOR_DEFS::g_quick_use_slots[index]); xr_strcpy(ACTOR_DEFS::g_quick_use_slots[index], tmp.c_str()); ReloadReferences(actor); return; } } } DestroyDragItem(); }
void SActorState::CreateClimb(IKinematicsAnimated* K) { string128 buf,buf1; string16 base; //climb anims xr_strcpy(base,"cl"); legs_idle = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_idle_1")); m_torso_idle = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_torso_0_aim_0")); m_walk.Create (K,base,"_run"); m_run.Create (K,base,"_run"); //norm anims xr_strcpy(base,"norm"); legs_turn = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_turn")); death = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_death_0")); m_torso[0].Create(K,base,"_1"); m_torso[1].Create(K,base,"_2"); m_torso[2].Create(K,base,"_3"); m_torso[3].Create(K,base,"_4"); m_torso[4].Create(K,base,"_5"); m_torso[5].Create(K,base,"_6"); m_torso[6].Create(K,base,"_7"); m_torso[7].Create(K,base,"_8"); m_torso[8].Create(K,base,"_9"); m_torso[9].Create(K,base,"_10"); m_torso[10].Create(K,base,"_11"); m_torso[11].Create(K,base,"_12"); m_torso[12].Create(K,base,"_13"); m_head_idle.invalidate();///K->ID_Cycle("head_idle_0"); jump_begin = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_jump_begin")); jump_idle = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_jump_idle")); landing[0] = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_jump_end")); landing[1] = K->ID_Cycle(strconcat(sizeof(buf),buf,base,"_jump_end_1")); for (int k=0; k<12; ++k) m_damage[k] = K->ID_FX(strconcat(sizeof(buf),buf,base,"_damage_",itoa(k,buf1,10))); }