void JXStyleTableMenu::UpdateMenu() { if (itsTable->IsEditing()) { EnableAll(); JXStyleMenu::UpdateMenu(); } }
void CUICarBodyWnd::InitCarBody(CInventoryOwner* pOur, CInventoryOwner* pOthers) { m_pOurObject = pOur; m_pOthersObject = pOthers; m_pInventoryBox = NULL; u16 our_id = smart_cast<CGameObject*>(m_pOurObject)->ID(); u16 other_id = smart_cast<CGameObject*>(m_pOthersObject)->ID(); m_pUICharacterInfoLeft->InitCharacter (our_id); m_pUIOthersIcon->Show (true); CBaseMonster *monster = NULL; if(m_pOthersObject) { monster = smart_cast<CBaseMonster *>(m_pOthersObject); if (monster || m_pOthersObject->use_simplified_visual() ) { m_pUICharacterInfoRight->ClearInfo (); if(monster) { shared_str monster_tex_name = pSettings->r_string(monster->cNameSect(),"icon"); m_pUICharacterInfoRight->UIIcon().InitTexture(monster_tex_name.c_str()); m_pUICharacterInfoRight->UIIcon().SetStretchTexture(true); } }else { m_pUICharacterInfoRight->InitCharacter (other_id); } } m_pUIPropertiesBox->Hide (); EnableAll (); UpdateLists (); if(!monster){ CInfoPortionWrapper *known_info_registry = xr_new<CInfoPortionWrapper>(); known_info_registry->registry().init (other_id); KNOWN_INFO_VECTOR& known_info = known_info_registry->registry().objects(); KNOWN_INFO_VECTOR_IT it = known_info.begin(); for(int i=0;it!=known_info.end();++it,++i){ (*it).info_id; NET_Packet P; CGameObject::u_EventGen (P,GE_INFO_TRANSFER, our_id); P.w_u16 (0);//not used P.w_stringZ ((*it).info_id); //сообщение P.w_u8 (1); //добавление сообщения CGameObject::u_EventSend (P); } known_info.clear (); xr_delete (known_info_registry); } }
void CUICarBodyWnd::InitCarBody(CInventoryOwner* pOur, CInventoryBox* pInvBox) { m_pOurObject = pOur; m_pOthersObject = NULL; m_pInventoryBox = pInvBox; m_pInventoryBox->m_in_use = true; u16 our_id = smart_cast<CGameObject*>(m_pOurObject)->ID(); m_pUICharacterInfoLeft->InitCharacter (our_id); m_pUIOthersIcon->Show (false); m_pUICharacterInfoRight->ClearInfo (); m_pUIPropertiesBox->Hide (); EnableAll (); UpdateLists (); }
void CMainDlg::Load(string &out) { CString SurType; if(!file->LoadFile(out)) { MessageBox("Model not loaded", "Error", MB_ICONERROR | MB_OK); return; } SurType.Format("%i", file->surfaces[0].surfaceType); EnableAll(); CString title = "TriExporter_sharedcache"; title += " - "; title += out.c_str(); SetWindowText(title); m_p3d.Open(*file); textures.clear(); texdata.clear(); textures.resize(file->header.numSurfaces); texdata.resize(file->header.numSurfaces); for(dword i = 0; i < file->header.numSurfaces; i++) texdata[i] = -1; CString VSize; CString TriVersion; CString VCount; CString BoxMax; CString BoxMin; CString SurCount; VSize.Format("%i", file->header.sizeVertex); TriVersion.Format("%i.%i", file->header.versionHi, file->header.versionLo); VCount.Format("%i", file->header.numVertices); BoxMax.Format("{%1.2f; %1.2f; %1.2f}", file->header.maxBox[0], file->header.maxBox[1], file->header.maxBox[2]); BoxMin.Format("{%1.2f; %1.2f; %1.2f}", file->header.minBox[0], file->header.minBox[1], file->header.minBox[2]); SurCount.Format("%i", file->header.numSurfaces); m_VSize.SetWindowText(VSize); m_TriVersion.SetWindowText(TriVersion); m_VCount.SetWindowText(VCount); m_BoxMax.SetWindowText(BoxMax); m_BoxMin.SetWindowText(BoxMin); m_SurType.SetWindowText(SurType); m_SurCount.SetWindowText(SurCount); loaded = true; }
void CUITradeWnd::InitTrade(CInventoryOwner* pOur, CInventoryOwner* pOthers) { VERIFY (pOur); VERIFY (pOthers); m_pInvOwner = pOur; m_pOthersInvOwner = pOthers; m_uidata->UIOthersPriceCaption.GetPhraseByIndex(0)->SetText(*CStringTable().translate("ui_st_opponent_items")); m_uidata->UICharacterInfoLeft.InitCharacter(m_pInvOwner->object_id()); m_uidata->UICharacterInfoRight.InitCharacter(m_pOthersInvOwner->object_id()); m_pInv = &m_pInvOwner->inventory(); m_pOthersInv = pOur->GetTrade()->GetPartnerInventory(); m_pTrade = pOur->GetTrade(); m_pOthersTrade = pOur->GetTrade()->GetPartnerTrade(); EnableAll (); UpdateLists (eBoth); }
LRESULT CMainDlg::OnTreeDblClick(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& bHandled) { CTreeItem ti = m_Tree.GetSelectedItem(); if(ti) { int out = ti.GetData()-1; if(out>=0) { CString f = sc.index[out].filename.c_str(); if(!f.Right(4).Compare(".tri")) { delete file; file = new TriFile(); Load(out); } else if(!f.Right(4).Compare(".dds")) { if(loaded) { Add(f.Right(f.GetLength()-f.ReverseFind('/')-1), out); m_p3d.TextureChange(sc, texdata); } } else if(!f.Right(4).Compare(".gr2")) { delete file; file = new GrannyTriFile(); Load(out); } else MessageBox("WTF?", "Error", MB_ICONERROR | MB_OK); } } else if(!loaded) EnableAll(FALSE); return TRUE; }
void CMainDlg::Load(int out) { CString SurType; if(!file->LoadFile(sc.index[out])) { MessageBox("Model not loaded", "Error", MB_ICONERROR | MB_OK); return; } SurType.Format("%i", file->surfaces[0].surfaceType); EnableAll(); CString title = "TriExporter_sharedcache"; title += " - "; title += sc.index[out].filename.c_str(); SetWindowText(title); m_p3d.Open(*file); textures.clear(); texdata.clear(); textures.resize(file->header.numSurfaces); texdata.resize(file->header.numSurfaces); for(dword i = 0; i < file->header.numSurfaces; i++) texdata[i] = -1; CString VSize; CString TriVersion; CString VCount; CString BoxMax; CString BoxMin; CString SurCount; VSize.Format("%i", file->header.sizeVertex); TriVersion.Format("%i.%i", file->header.versionHi, file->header.versionLo); VCount.Format("%i", file->header.numVertices); BoxMax.Format("{%1.2f; %1.2f; %1.2f}", file->header.maxBox[0], file->header.maxBox[1], file->header.maxBox[2]); BoxMin.Format("{%1.2f; %1.2f; %1.2f}", file->header.minBox[0], file->header.minBox[1], file->header.minBox[2]); SurCount.Format("%i", file->header.numSurfaces); // Loop through Checkboxes for(dword i=0; i<10; i++) { // Get current Checkbox CButton currButton = m_ChkSurfaces[i]; // If the current model uses this surface, enable the checkbox and set it if(i < file->header.numSurfaces) { currButton.EnableWindow(true); currButton.SetCheck(true); m_p3d.drawSurface[i] = 1; } // Clear and disable the rest else { currButton.EnableWindow(false); currButton.SetCheck(false); m_p3d.drawSurface[i] = 0; } } m_VSize.SetWindowText(VSize); m_TriVersion.SetWindowText(TriVersion); m_VCount.SetWindowText(VCount); m_BoxMax.SetWindowText(BoxMax); m_BoxMin.SetWindowText(BoxMin); m_SurType.SetWindowText(SurType); m_SurCount.SetWindowText(SurCount); loaded = true; }
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // center the dialog on the screen //DlgResize_Init(); //InitResizing(TRUE, TRUE, WS_THICKFRAME | WS_CLIPCHILDREN); CenterWindow(); // set icons HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_TRIEXPORTER), IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR); SetIcon(hIcon, TRUE); HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SMALL), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); SetIcon(hIconSmall, FALSE); file = new TriFile; // register object for message filtering and idle updates loaded = false; CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); //UIAddChildWindowContainer(m_hWnd); menu.Attach(GetMenu()); m_Tree = GetDlgItem(IDC_TREE); il.Create(16,16, ILC_COLOR32,0,0); HANDLE bmp = LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_ICONS),IMAGE_BITMAP,0,0,LR_LOADTRANSPARENT); il.Add((HBITMAP)bmp); DeleteObject(bmp); m_Tree.SetImageList(il, TVSIL_NORMAL); m_p3d.SubclassWindow(GetDlgItem(IDC_PREVIEW)); m_Scale.Attach(GetDlgItem(IDC_SCALE)); m_Light.Attach(GetDlgItem(IDC_LIGHT)); m_Fps.Attach(GetDlgItem(IDC_FPS)); m_eScale.Attach(GetDlgItem(IDC_ESCALE)); m_Texture.Attach(GetDlgItem(IDC_TEXTURE)); m_VSize.Attach(GetDlgItem(IDC_VSIZE)); m_TriVersion.Attach(GetDlgItem(IDC_TRIVERSION)); m_VCount.Attach(GetDlgItem(IDC_VCOUNT)); m_BoxMax.Attach(GetDlgItem(IDC_BOXMAX)); m_BoxMin.Attach(GetDlgItem(IDC_BOXMIN)); m_SurType.Attach(GetDlgItem(IDC_SURTYPE)); m_SurCount.Attach(GetDlgItem(IDC_SURCOUNT)); m_Textures.Attach(GetDlgItem(IDC_TEXTURES)); m_Add.Attach(GetDlgItem(IDC_ADD)); m_Remove.Attach(GetDlgItem(IDC_REMOVE)); m_Select.Attach(GetDlgItem(IDC_SELECT)); // Attach all 10 Checkboxes for(int i=0; i<10; i++) m_ChkSurfaces[i].Attach(GetDlgItem(IDC_SURFACE1+i)); m_Scale.SetRange(0, 19); m_Scale.SetPageSize(5); m_UpDown.Attach(GetDlgItem(IDC_UPDOWN)); m_Light.SetRange(0, 360); m_Light.SetPageSize(1); m_Light.SetPos(100); m_p3d.alight = 100/(180/D3DX_PI); CRegKey rk; if(rk.Open(HKEY_CURRENT_USER, "Software\\TriExporter") == ERROR_SUCCESS) { ULONG g=256; TCHAR path[256]; rk.QueryStringValue("EVE", path, &g); rk.Close(); if (sc.LoadDir(path)) FillTree(); } m_p3d.Render(); EnableAll(FALSE); return TRUE; }