void CScriptCameraHint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) { switch (msg) { case EScriptObjectMessage::Deleted: case EScriptObjectMessage::Deactivate: mgr.GetCameraManager()->DeleteCameraHint(GetUniqueId(), mgr); break; case EScriptObjectMessage::InitializedInArea: InitializeInArea(mgr); break; default: break; } if (GetActive()) { switch (msg) { case EScriptObjectMessage::Increment: AddHelper(sender); mgr.GetCameraManager()->AddActiveCameraHint(GetUniqueId(), mgr); x166_inactive = false; break; case EScriptObjectMessage::Decrement: RemoveHelper(sender); mgr.GetCameraManager()->AddInactiveCameraHint(GetUniqueId(), mgr); break; default: break; } } if (msg == EScriptObjectMessage::Follow) { if (!GetActive()) { if (TCastToConstPtr<CActor> act = mgr.GetObjectById(sender)) { zeus::CVector3f followerToThisFlat = x168_origXf.origin - act->GetTranslation(); followerToThisFlat.z() = 0.f; if (followerToThisFlat.canBeNormalized()) followerToThisFlat.normalize(); else followerToThisFlat = act->GetTransform().basis[1]; zeus::CVector3f target = act->GetTranslation() + followerToThisFlat; target.z() = x168_origXf.origin.z() + followerToThisFlat.z(); SetTransform(zeus::lookAt(act->GetTranslation(), target)); } } AddHelper(sender); mgr.GetCameraManager()->AddActiveCameraHint(GetUniqueId(), mgr); } CActor::AcceptScriptMsg(msg, sender, mgr); }
// Add a new project or workspace to the list of projects. void WorkspaceInfo::Add(CString projectName) { AddHelper(projectName); }
BOOL CFirstStartWizardAuthentication::OnInitDialog() { CFirstStartWizardBasePage::OnInitDialog(); CString tmp; tmp.LoadString(IDS_FIRSTSTART_SSHHINT); GetDlgItem(IDC_FIRSTSTART_SSHHINT)->SetWindowText(tmp); CAutoConfig config(true); if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitGlobalConfig()), GIT_CONFIG_LEVEL_GLOBAL, nullptr, FALSE)) MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION); else { if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitGlobalXDGConfig()), GIT_CONFIG_LEVEL_XDG, nullptr, FALSE)) MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION); } if (!g_Git.ms_bCygwinGit && !g_Git.ms_bMsys2Git) { if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitProgramDataConfig()), GIT_CONFIG_LEVEL_PROGRAMDATA, nullptr, FALSE)) MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION); } if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitSystemConfig()), GIT_CONFIG_LEVEL_SYSTEM, nullptr, FALSE)) MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION); STRING_VECTOR defaultList; git_config_foreach_match(config, "credential\\.helper", CSettingGitCredential::GetCredentialDefaultUrlCallback, &defaultList); if (defaultList.size() <= 1 && (defaultList.empty() || defaultList.at(0)[0] == 'X' || defaultList.at(0)[0] == 'G')) AddHelper(m_ctrlSimpleCredential, m_availableHelpers, MAKEINTRESOURCE(IDS_NONE)); CString selectedHelper; if (config.GetString(L"credential.helper", selectedHelper) == GIT_ENOTFOUND) m_ctrlSimpleCredential.SetCurSel(0); if (CSettingGitCredential::GCMExists()) AddHelper(m_ctrlSimpleCredential, m_availableHelpers, L"manager", selectedHelper); if (CSettingGitCredential::WincredExists()) AddHelper(m_ctrlSimpleCredential, m_availableHelpers, L"wincred", selectedHelper); if (CSettingGitCredential::WinstoreExists()) AddHelper(m_ctrlSimpleCredential, m_availableHelpers, CSettingGitCredential::GetWinstorePath(), selectedHelper); STRING_VECTOR urlList; git_config_foreach_match(config, "credential\\..*\\.helper", CSettingGitCredential::GetCredentialUrlCallback, &urlList); if (!urlList.empty() || m_ctrlSimpleCredential.GetCurSel() == -1) { m_ctrlSimpleCredential.EnableWindow(FALSE); m_availableHelpers.clear(); m_ctrlSimpleCredential.Clear(); AddHelper(m_ctrlSimpleCredential, m_availableHelpers, MAKEINTRESOURCE(IDS_ADVANCED)); m_ctrlSimpleCredential.SetCurSel(0); } AdjustControlSize(IDC_DONTSAVE); CString sshclient = CRegString(L"Software\\TortoiseGit\\SSH"); if (sshclient.IsEmpty()) sshclient = CRegString(L"Software\\TortoiseGit\\SSH", L"", FALSE, HKEY_LOCAL_MACHINE); int idx = m_ctrlSSHClient.AddString(L"TortoiseGitPlink"); if (sshclient.IsEmpty() || IsTool(L"tortoisegitplink", sshclient) || IsTool(L"tortoiseplink", sshclient)) m_ctrlSSHClient.SetCurSel(idx); idx = m_ctrlSSHClient.AddString(L"OpenSSH"); if (IsTool(L"ssh", sshclient)) m_ctrlSSHClient.SetCurSel(idx); if (m_ctrlSSHClient.GetCurSel() == -1) { idx = m_ctrlSSHClient.AddString(sshclient); m_ctrlSSHClient.SetCurSel(idx); } // TODO: Hide the button if PuTTY is not used? //GetDlgItem(IDC_GENERATEPUTTYKEY)->ShowWindow(CAppUtils::IsSSHPutty() ? SW_SHOW : SW_HIDE); UpdateData(FALSE); return TRUE; }
// Read in a .dsw file. void WorkspaceInfo::ReadDSWFile(Project& prj) { // Open the .dsw file. CStdioFile file; if (file.Open(prj.m_name, CFile::modeRead) == FALSE) { // Huh? return; } // Build the root path to resolve filenames from. CString rootPath = prj.m_name.Left(prj.m_name.ReverseFind('\\') + 1); // Begin reading the file. CString line; while (1) { // Read in a line from the file. if (!file.ReadString(line)) break; // Look for something that looks like this. // Project: "!EagleLib"=".\Prj\!EagleLib.dsp" - Package Owner=<4> // Project: "Gfx"=.\Prj\Gfx.dsp - Package Owner=<4> if (line.GetLength() <= 8 || strncmp(line, "Project:", 8) != 0) continue; // Search for the =. int endPos; // Will be one past the last letter. int startPos = line.Find('='); if (startPos == -1) continue; startPos++; // Move to the beginning of the name. /* // See if the name is quoted. if (line[startPos] == '"') { // Move past the quote. startPos++; // Find the closing quote. endPos = line.Find('"', startPos); if (endPos == -1) continue; } else //if (line[namePos] == '"') { // Find a space, since that should denote the end of the filename. endPos = line.Find(' ', startPos); } */ // Got the name isolated. Add it. CString projectPath = line.Mid(startPos, endPos - startPos); ResolveFilename(rootPath, projectPath); Project* newlyAddedProject = AddHelper(projectPath); if (newlyAddedProject) newlyAddedProject->m_parent = &prj; } //while(1) // Close the .dsp file. file.Close(); }