BOOL CDropLootDialog::OnInitDialog() { CDialog::OnInitDialog(); skin.SetButtonSkin(m_add); skin.SetButtonSkin(m_delete); skin.SetButtonSkin(m_OK); skin.SetButtonSkin(m_cancel); LoadItemList(); m_dropWhenCapacityLimitReached.SetCheck(*dropWhenCapacityLimitReached); m_dropOnlyLooted.SetCheck(*dropOnlyLooted); OnDroplistDropWhenCapacityLimitReached(); OnDroplistDropOnlyLooted(); return TRUE; }
void Initialize() { LoadItemList(); LoadDropList(); LoadLootList(); PUnarmedItem = new CItemWeapon(0); PUnarmedItem->setDmgType(DAMAGE_NONE); PUnarmedItem->setSkillType(SKILL_NON); PUnarmedH2HItem = new CItemWeapon(0); PUnarmedH2HItem->setDmgType(DAMAGE_HTH); PUnarmedH2HItem->setSkillType(SKILL_H2H); }
void CBuyRegDialog::Linking() { m_pTypeList = (cListDialog*)GetWindowForID(BRS_TYPELIST); // 091127 ONS 구매상점 아이템리스트 추가/변경 m_pItemList[WEAPON] = (cListDialog*)GetWindowForID(BRS_ITEMLIST1); m_pItemList[CLOTHES] = (cListDialog*)GetWindowForID(BRS_ITEMLIST2); m_pItemList[ACCESSORY] = (cListDialog*)GetWindowForID(BRS_ITEMLIST3); m_pItemList[POTION] = (cListDialog*)GetWindowForID(BRS_ITEMLIST4); m_pItemList[MATERIAL] = (cListDialog*)GetWindowForID(BRS_ITEMLIST5); m_pItemList[PET] = (cListDialog*)GetWindowForID(BRS_ITEMLIST6); m_pItemList[COSTUME] = (cListDialog*)GetWindowForID(BRS_ITEMLIST7); m_pItemList[PRODUCTION] = (cListDialog*)GetWindowForID(BRS_ITEMLIST8); m_pItemList[HOUSING] = (cListDialog*)GetWindowForID(BRS_ITEMLIST9); m_pItemList[ETC] = (cListDialog*)GetWindowForID(BRS_ITEMLIST10); m_pClassList = (cListDialog*)GetWindowForID(BRS_CLASSLIST); m_pClassList->SetShowSelect(TRUE); m_pVolumeEdit = (cEditBox*)GetWindowForID(BRS_VOLUMEEDIT); m_pVolumeEdit->SetValidCheck( VCM_NUMBER ); m_pVolumeEdit->SetAlign( TXT_RIGHT ); m_pVolumeEdit->SetReadOnly( FALSE ); cImage ToolTipImage; SCRIPTMGR->GetImage( 0, &ToolTipImage, PFT_HARDPATH ); m_pVolumeEdit->SetToolTip( CHATMGR->GetChatMsg(1440), RGBA_MAKE(255, 255, 255, 255), &ToolTipImage, TTCLR_DEFAULT ); m_pMoneyEdit = (cEditBox*)GetWindowForID(BRS_MONEYEDIT); m_pMoneyEdit->SetValidCheck( VCM_NUMBER ); m_pMoneyEdit->SetAlign( TXT_RIGHT ); m_pMoneyEdit->SetReadOnly( FALSE ); m_pRegBtn = (cButton*)GetWindowForID(BRS_REGBTN); m_pDltBtn = (cButton*)GetWindowForID(BRS_DELETEBTN); m_pClassText = (cStatic*)GetWindowForID(BRS_CLASSTEXT); m_pClassRect1 = (cStatic*)GetWindowForID(BRS_CLASSRECT1); m_pClassRect2 = (cStatic*)GetWindowForID(BRS_CLASSRECT2); m_pItemBigRect = (cStatic*)GetWindowForID(BRS_ITEMBIGRECT); m_pItemSmallRect1 = (cStatic*)GetWindowForID(BRS_ITEMSMALLRECT1); m_pItemSmallRect2 = (cStatic*)GetWindowForID(BRS_ITEMSMALLRECT2); LoadItemList(); InitRegInfo(); }
void ItemManager :: LoadItemPackages(char *listFile, bool itemOverride) { FileReader lfr; if(lfr.OpenText(listFile) != Err_OK) { g_Logs.data->error("Could not open Item list file [%v]", listFile); Finalize(); return; } lfr.CommentStyle = Comment_Semi; while(lfr.FileOpen() == true) { int r = lfr.ReadLine(); if(r > 0) { Platform::FixPaths(lfr.DataBuffer); LoadItemList(lfr.DataBuffer, itemOverride); } } lfr.CloseCurrent(); //Run any post-processing, like sorting. Finalize(); }
bool CCourse::LoadCourse (size_t idx) { if (idx >= CourseList.size()) { Message ("wrong course index"); curr_course = NULL; return false; } if (&CourseList[idx] != curr_course || g_game.force_treemap) { ResetCourse (); curr_course = &CourseList[idx]; CourseDir = param.common_course_dir + SEP + curr_course->dir; start_pt.x = CourseList[idx].start.x; start_pt.y = -CourseList[idx].start.y; base_height_value = 127; g_game.use_keyframe = CourseList[idx].use_keyframe; g_game.finish_brake = CourseList[idx].finish_brake; if (!LoadElevMap ()) { Message ("could not load course elev map"); return false; } MakeCourseNormals (); FillGlArrays (); if (!LoadTerrainMap ()) { Message ("could not load course terrain map"); return false; } // ................................................................ string itemfile = CourseDir + SEP + "items.lst"; bool itemsexists = FileExists (itemfile); const CControl *ctrl = Players.GetCtrl (g_game.player_id); if (itemsexists && !g_game.force_treemap) { SaveItemsFlag = false; LoadItemList (); } else { SaveItemsFlag = true; LoadObjectMap (); } g_game.force_treemap = false; // ................................................................ init_track_marks (); InitQuadtree ( elevation, nx, ny, curr_course->size.x / (nx - 1.0), -curr_course->size.y / (ny - 1.0), ctrl->viewpos, param.course_detail_level); } if (g_game.mirror_id != mirrored) { MirrorCourse (); mirrored = g_game.mirror_id; } return true; }
/* METODA WCZYTUJ¥CA DANE Za³o¿enia pliku s¹ proste. Na pocz¹tku podstawowe dane, a dalej jedziemy ze œcianami i ca³¹ reszt¹ danych. */ const bool CLevel::LoadLevel( const std::string &filename ) { if( filename == "" ) { Log.Error( "GLEVEL( " + file + " ): £añcuch znaków jest pusty!" ); return false; } // Najpierw definiujemy wskaŸnik na plik i go otwieramy std::fstream stream( filename, std::ios::in ); if( !stream ) { Log.Error( "GLEVEL( " + file + " ): Plik nie istnieje, lub podana œcie¿ka jest b³êdna: " + filename ); return false; } // definiujemy zmienne pomocnicze std::string str; // Pobieramy wersje poziomu oraz j¹ sprawdzamy str = GetClearLine( stream ); if( !sscanf_s( str.c_str(), "E3DTLEV=%u", &Version ) ) { Log.Error( "GLEVEL( " + file + " ): Nieprawid³owy plik poziomu!" ); return false; } if( Version > GAME_VERSION ) { Log.Error( "GLEVEL( " + file + " ): Zbyt wysoka wersja pliku!" ); return false; } /* Wczeœnijsze if'y by³y, by uzyskaæ pewnoœæ, ¿e wszystko z nowym plikiem jest w porz¹dku. Dlaczego tyle zachodu? By unikn¹æ sytuacji, kiedy ³adujemy plik, na ju¿ istniej¹cy level. Level istnieje, wiêc go kasujemy i czytamy plik. A teraz Zonk! Nie ma pliku! I co? zostajemy na lodzie bez levelu :). Teraz wiecie o co chodzi :) */ if( loaded ) { Log.Report( "GLEVEL( " + file + " ): Prze³adowanie poziomu na : " + filename ); Free(); Player.Reset(); } Log.Log( "GLEVEL( " + file + " ): Wczytywanie poziomu: " + filename ); //GUI.SendConMsg( "Wczytywanie poziomu: " + filename, false ); file = filename; while( stream ) { str = GetLine( stream ); if( str == "END E3DTLEV" ) break; str = ClearWhiteSpace( str ); if( str == "HEADER" ) { if( !LoadHeader( stream ) ) { Log.Error( "GLEVEL( " + file + " ): B³¹d odczytu nag³ówka!" ); continue; } } else if( str == "TEXTURES" ) { if( !LoadTextures( stream ) ) { Log.Error( "GLEVEL( " + file + " ): B³¹d odczytu tekstur!" ); continue; } } else if( str == "WALLS" ) { if( !LoadWalls( stream ) ) { Log.Error( "GLEVEL( " + file + " ): B³¹d odczytu œcian!" ); continue; } } else if( str == "ITEMLIST" ) { if( !LoadItemList( stream ) ) { Log.Error( "GLEVEL( " + file + " ): B³¹d odczytu listy przedmiotów!" ); continue; } } else Log.Error( "GLEVEL( " + file + " ): Nierozpoznany ci¹g " + str + "!" ); } for( unsigned row = 0; row < Rows; row++ ) { for( unsigned col = 0; col < Cols; col++ ) GetBlock( col, row )->Set( row, col, blockWidth, blockHeight, blockDepth ); } Player.SetStartPos( this->GetBlockPos( PlayerStartBlock ) ); Player.SetStartAngle( (float)PlayerStartAngle ); Player.Reset(); this->AddEntity( &Player ); loaded = true; BuildVisual(); BuildPhysic(); return true; }