Esempio n. 1
0
void CProfileSelectState::Enter()
{
	LoadProfiles();
	currentProfile = 0;
	renderedProfile = 0;
	transTimer = transDuration;
	state = MyState::Idle;

	font.Load("Resources/XML/font1.xml");
	std::vector<std::string> labels;
	labels.push_back("Play");
	labels.push_back("Create New");
	labels.push_back("Delete");
	labels.push_back("Cancel");

	labels.push_back("Main Menu");

	SGD::Size screen = SGD::Size{ (float)Game::GetInstance()->GetScreenWidth(), (float)Game::GetInstance()->GetScreenHeight() };
	menu = new CMenu(&Game::GetInstance()->FontPoiret, labels, "", { screen.width * .3f, screen.height * .55f }, false);

	current = SGD::Point{ (screen.width - profileSize.width) * 0.5f, (screen.height - profileSize.height) * 0.5f };
	previous = SGD::Point{ profileSize.width * -0.75f, (screen.height - profileSize.height) * 0.75f };
	 next = SGD::Point{ screen.width - profileSize.width * 0.25f, (screen.height - profileSize.height) * 0.75f };

	 profileImage = SGD::GraphicsManager::GetInstance()->LoadTexture("Resources/Graphics/Hologram hud.png");
}
Esempio n. 2
0
ProfileBox::ProfileBox(QWidget* parent, const QString& type, LoadCallback load_callback, SaveCallback save_callback, void *userdata)
	: QGroupBox(tr("Profile"), parent) {

	m_type = type;
	m_load_callback = load_callback;
	m_save_callback = save_callback;
	m_userdata = userdata;

	m_combobox_profiles = new QComboBox(this);
	m_combobox_profiles->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	m_pushbutton_save = new QPushButton(tr("Save"), this);
	m_pushbutton_save->setToolTip(tr("Save the current settings to this profile."));
	m_pushbutton_new = new QPushButton(tr("New"), this);
	m_pushbutton_new->setToolTip(tr("Create a new profile with the current settings."));
	m_pushbutton_delete = new QPushButton(tr("Delete"), this);
	m_pushbutton_delete->setToolTip(tr("Delete this profile."));

	connect(m_combobox_profiles, SIGNAL(activated(int)), this, SLOT(OnProfileChange()));
	connect(m_pushbutton_save, SIGNAL(clicked()), this, SLOT(OnProfileSave()));
	connect(m_pushbutton_new, SIGNAL(clicked()), this, SLOT(OnProfileNew()));
	connect(m_pushbutton_delete, SIGNAL(clicked()), this, SLOT(OnProfileDelete()));

	QHBoxLayout *layout = new QHBoxLayout(this);
	layout->addWidget(m_combobox_profiles);
	layout->addWidget(m_pushbutton_save);
	layout->addWidget(m_pushbutton_new);
	layout->addWidget(m_pushbutton_delete);

	LoadProfiles();
	UpdateProfileFields();

}
UDeviceProfileManager::UDeviceProfileManager( const class FPostConstructInitializeProperties& PCIP )
	: Super( PCIP )
{
	RenameIndex = 0;
#if WITH_EDITOR
	LoadProfiles();
#endif
}
Esempio n. 4
0
void ProfileBox::OnProfileDelete() {
	QString name = GetProfileName();
	if(name.isEmpty())
		return;
	QString filename = GetApplicationUserDir(m_type) + "/" + name + ".conf";
	if(MessageBox(QMessageBox::Warning, this, MainWindow::WINDOW_CAPTION, tr("Are you sure that you want to delete this profile?"), BUTTON_YES | BUTTON_NO, BUTTON_YES) == BUTTON_YES) {
		QFile(filename).remove();
		LoadProfiles();
		UpdateProfileFields();
	}
}
Esempio n. 5
0
void ProfileBox::OnProfileSave() {
	QString name = GetProfileName();
	if(name.isEmpty())
		return;
	QString filename = GetApplicationUserDir(m_type) + "/" + name + ".conf";
	if(MessageBox(QMessageBox::Warning, this, MainWindow::WINDOW_CAPTION, tr("Are you sure that you want to overwrite this profile?"), BUTTON_YES | BUTTON_NO, BUTTON_YES) == BUTTON_YES) {
		{
			QSettings settings(filename, QSettings::IniFormat);
			m_save_callback(&settings, m_userdata);
		}
		LoadProfiles();
		SetProfile(FindProfile(name));
		UpdateProfileFields();
	}
}
Esempio n. 6
0
void ProfileBox::OnProfileNew() {
	QString name = InputBox(this, MainWindow::WINDOW_CAPTION, tr("Enter a name for the new profile:"), "");
	if(name.isEmpty())
		return;
	name = name.toAscii().toPercentEncoding();
	QString filename = GetApplicationUserDir(m_type) + "/" + name + ".conf";
	if(!QFileInfo(filename).exists() || MessageBox(QMessageBox::Warning, this, MainWindow::WINDOW_CAPTION,
			tr("A profile with the same name already exists. Are you sure that you want to replace it?"), BUTTON_YES | BUTTON_NO, BUTTON_YES) == BUTTON_YES) {
		{
			QSettings settings(filename, QSettings::IniFormat);
			m_save_callback(&settings, m_userdata);
		}
		LoadProfiles();
		SetProfile(FindProfile(name));
		UpdateProfileFields();
	}
}
HRESULT __stdcall vcInitialize()
{
	GetTempPath(MAX_PATH, g_szTempPath);
	PathRemoveBackslash(g_szTempPath);
	GetModuleFileName(NULL, g_szModulePath, MAX_PATH);
	PathRemoveFileSpec(g_szModulePath);

	CreateLogFile(); 
	GetOSDisplayString(); 
	GetSystemInformations(); 
	InitGdiplus();
	InitCommonResource(); 
	InitHSBControlWindow();
	ffmpeg_init(); 
	LoadProfiles();
	InitMediaMananger(); 
	InitVideoPlayer();
	InitVideoRender();
	
	StringCchCopy(g_merge_info.m_Name, 256, L"merged");

	if (LoadOptions() != S_OK)
	{
		SHGetFolderPath(NULL, CSIDL_MYVIDEO | CSIDL_FLAG_CREATE, NULL, 0, g_opt.m_OutputPath);
		g_opt.m_Parallel = g_cpu_count;
		g_opt.m_FillColor2 = 0xFFFFFFFF;
	}

	if (LoadProfileSettings() != S_OK)
	{
		ZeroMemory(&g_ProfileSettings, sizeof(g_ProfileSettings));
		GetDefaultProfileSetting1(g_ProfileSettings, GROUP_VIDEO);
	}
	CopyProfileSettings();
	
	return S_OK;
}
void FLauncherProfileManager::LoadSettings( )
{
	LoadDeviceGroups();
	LoadProfiles();
}