2021-11-01 13:14:00 -04:00
# include "settingswindow.h"
# include <QFormLayout>
# include <QPushButton>
# include <QDesktopServices>
2021-11-01 13:35:27 -04:00
# include <QLabel>
# include <QFileDialog>
2021-11-01 14:35:32 -04:00
# include <QCheckBox>
# include <QGroupBox>
2021-11-02 08:27:00 -04:00
# include <QMessageBox>
# include <QProcess>
2021-11-09 10:37:48 -05:00
# include <QGridLayout>
2022-02-23 20:48:39 -05:00
# include <QToolTip>
2021-11-01 13:14:00 -04:00
2021-11-23 15:34:23 -05:00
# include "launchercore.h"
# include "launcherwindow.h"
2022-02-23 21:18:53 -05:00
# include "gamescopesettingswindow.h"
2021-11-01 13:14:00 -04:00
2022-03-09 08:08:03 -05:00
SettingsWindow : : SettingsWindow ( int defaultTab , LauncherWindow & window , LauncherCore & core , QWidget * parent ) : core ( core ) , window ( window ) , QDialog ( parent ) {
2021-11-01 13:14:00 -04:00
setWindowTitle ( " Settings " ) ;
setWindowModality ( Qt : : WindowModality : : ApplicationModal ) ;
2022-02-24 08:48:14 -05:00
auto mainLayout = new QVBoxLayout ( this ) ;
2021-11-09 10:37:48 -05:00
setLayout ( mainLayout ) ;
2022-02-24 08:48:14 -05:00
auto tabWidget = new QTabWidget ( ) ;
mainLayout - > addWidget ( tabWidget ) ;
2022-02-24 09:10:00 -05:00
// general tab
{
auto generalTabWidget = new QWidget ( ) ;
tabWidget - > addTab ( generalTabWidget , " General " ) ;
2022-02-24 08:48:14 -05:00
2022-02-24 09:10:00 -05:00
auto layout = new QFormLayout ( ) ;
generalTabWidget - > setLayout ( layout ) ;
2022-02-24 08:48:14 -05:00
2022-02-24 09:10:00 -05:00
closeWhenLaunched = new QCheckBox ( " Close Astra when game is launched " ) ;
connect ( closeWhenLaunched , & QCheckBox : : stateChanged , [ & ] ( int state ) {
core . appSettings . closeWhenLaunched = state ;
2021-11-09 12:06:30 -05:00
2022-02-24 09:10:00 -05:00
core . saveSettings ( ) ;
} ) ;
layout - > addWidget ( closeWhenLaunched ) ;
}
// profile tab
{
auto profileTabWidget = new QWidget ( ) ;
tabWidget - > addTab ( profileTabWidget , " Profiles " ) ;
auto profileLayout = new QGridLayout ( ) ;
profileTabWidget - > setLayout ( profileLayout ) ;
profileWidget = new QListWidget ( ) ;
profileWidget - > addItem ( " INVALID *DEBUG* " ) ;
profileWidget - > setCurrentRow ( 0 ) ;
connect ( profileWidget , & QListWidget : : currentRowChanged , this ,
& SettingsWindow : : reloadControls ) ;
2021-11-09 12:06:30 -05:00
2022-03-09 08:05:41 -05:00
profileLayout - > addWidget ( profileWidget , 0 , 0 , 3 , 1 ) ;
2021-11-01 13:14:00 -04:00
2022-02-24 09:10:00 -05:00
auto addProfileButton = new QPushButton ( " Add Profile " ) ;
connect ( addProfileButton , & QPushButton : : pressed , [ = ] {
profileWidget - > setCurrentRow ( this - > core . addProfile ( ) ) ;
2021-11-09 13:44:37 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
2022-03-09 08:05:41 -05:00
profileLayout - > addWidget ( addProfileButton , 3 , 0 ) ;
2021-11-09 13:44:37 -05:00
2022-02-24 09:10:00 -05:00
deleteProfileButton = new QPushButton ( " Delete Profile " ) ;
connect ( deleteProfileButton , & QPushButton : : pressed , [ = ] {
profileWidget - > setCurrentRow (
this - > core . deleteProfile ( getCurrentProfile ( ) . name ) ) ;
2021-11-09 13:44:37 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
2022-03-09 08:05:41 -05:00
profileLayout - > addWidget ( deleteProfileButton , 0 , 2 ) ;
2021-11-09 11:44:27 -05:00
2022-02-24 09:10:00 -05:00
nameEdit = new QLineEdit ( ) ;
connect ( nameEdit , & QLineEdit : : editingFinished , [ = ] {
getCurrentProfile ( ) . name = nameEdit - > text ( ) ;
2021-11-09 12:10:52 -05:00
2022-02-24 09:10:00 -05:00
reloadControls ( ) ;
this - > core . saveSettings ( ) ;
} ) ;
profileLayout - > addWidget ( nameEdit , 0 , 1 ) ;
2021-11-09 12:10:52 -05:00
2022-02-24 09:10:00 -05:00
auto gameBox = new QGroupBox ( " Game Options " ) ;
auto gameBoxLayout = new QFormLayout ( ) ;
gameBox - > setLayout ( gameBoxLayout ) ;
2021-11-09 10:50:45 -05:00
2022-02-24 09:10:00 -05:00
profileLayout - > addWidget ( gameBox , 1 , 1 ) ;
2021-11-09 10:50:45 -05:00
2022-02-24 09:10:00 -05:00
directXCombo = new QComboBox ( ) ;
directXCombo - > addItem ( " DirectX 11 " ) ;
directXCombo - > addItem ( " DirectX 9 " ) ;
gameBoxLayout - > addRow ( " DirectX Version " , directXCombo ) ;
2021-11-02 08:49:06 -04:00
2022-02-24 09:10:00 -05:00
connect ( directXCombo ,
static_cast < void ( QComboBox : : * ) ( int ) > (
& QComboBox : : currentIndexChanged ) ,
[ = ] ( int index ) {
getCurrentProfile ( ) . useDX9 =
directXCombo - > currentIndex ( ) = = 1 ;
this - > core . saveSettings ( ) ;
} ) ;
2021-11-02 08:49:06 -04:00
2022-02-24 09:10:00 -05:00
currentGameDirectory = new QLineEdit ( ) ;
currentGameDirectory - > setReadOnly ( true ) ;
gameBoxLayout - > addRow ( " Game Directory " , currentGameDirectory ) ;
2021-11-09 10:50:45 -05:00
2022-02-24 09:10:00 -05:00
auto gameDirButtonLayout = new QHBoxLayout ( ) ;
auto gameDirButtonContainer = new QWidget ( ) ;
gameDirButtonContainer - > setLayout ( gameDirButtonLayout ) ;
gameBoxLayout - > addWidget ( gameDirButtonContainer ) ;
2022-02-24 08:25:46 -05:00
2022-02-24 09:10:00 -05:00
auto selectDirectoryButton = new QPushButton ( " Select Game Directory " ) ;
connect ( selectDirectoryButton , & QPushButton : : pressed , [ this ] {
getCurrentProfile ( ) . gamePath =
QFileDialog : : getExistingDirectory ( this , " Open Game Directory " ) ;
2021-11-09 10:50:45 -05:00
2022-02-24 09:10:00 -05:00
this - > reloadControls ( ) ;
this - > core . saveSettings ( ) ;
2021-11-09 12:46:27 -05:00
2022-02-24 09:10:00 -05:00
this - > core . readGameVersion ( ) ;
} ) ;
gameDirButtonLayout - > addWidget ( selectDirectoryButton ) ;
2021-11-09 10:50:45 -05:00
2022-02-24 09:10:00 -05:00
auto gameDirectoryButton = new QPushButton ( " Open Game Directory " ) ;
connect ( gameDirectoryButton , & QPushButton : : pressed ,
2022-02-24 09:28:11 -05:00
[ & window , this ] { window . openPath ( getCurrentProfile ( ) . gamePath ) ; } ) ;
2022-02-24 09:10:00 -05:00
gameDirButtonLayout - > addWidget ( gameDirectoryButton ) ;
2021-11-09 10:50:45 -05:00
2022-01-27 09:25:23 -05:00
# ifdef ENABLE_WATCHDOG
2022-02-24 09:10:00 -05:00
enableWatchdog = new QCheckBox ( " Enable Watchdog (X11 only) " ) ;
gameBoxLayout - > addWidget ( enableWatchdog ) ;
2021-12-06 21:15:31 -05:00
2022-02-24 09:10:00 -05:00
connect ( enableWatchdog , & QCheckBox : : stateChanged , [ this ] ( int state ) {
getCurrentProfile ( ) . enableWatchdog = state ;
2021-12-06 21:15:31 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
2021-12-06 21:15:31 -05:00
# endif
2022-02-24 09:10:00 -05:00
expansionVersionLabel = new QLabel ( ) ;
gameBoxLayout - > addRow ( " Game Version " , expansionVersionLabel ) ;
2021-12-02 15:02:59 -05:00
2022-02-24 09:10:00 -05:00
auto loginBox = new QGroupBox ( " Login Options " ) ;
auto loginBoxLayout = new QFormLayout ( ) ;
loginBox - > setLayout ( loginBoxLayout ) ;
2021-11-09 11:06:42 -05:00
2022-02-24 09:10:00 -05:00
profileLayout - > addWidget ( loginBox , 2 , 1 ) ;
2021-11-09 11:06:42 -05:00
2022-02-24 09:10:00 -05:00
encryptArgumentsBox = new QCheckBox ( ) ;
connect ( encryptArgumentsBox , & QCheckBox : : stateChanged , [ = ] ( int ) {
getCurrentProfile ( ) . encryptArguments =
encryptArgumentsBox - > isChecked ( ) ;
2021-11-09 21:13:21 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
loginBoxLayout - > addRow ( " Encrypt Game Arguments " , encryptArgumentsBox ) ;
2021-11-09 21:13:21 -05:00
2022-02-24 09:10:00 -05:00
serverType = new QComboBox ( ) ;
serverType - > insertItem ( 0 , " Square Enix " ) ;
serverType - > insertItem ( 1 , " Sapphire " ) ;
2021-11-09 12:38:18 -05:00
2022-02-24 09:10:00 -05:00
connect ( serverType ,
static_cast < void ( QComboBox : : * ) ( int ) > (
& QComboBox : : currentIndexChanged ) ,
[ = ] ( int index ) {
getCurrentProfile ( ) . isSapphire = index = = 1 ;
2021-11-09 12:42:05 -05:00
2022-02-24 09:10:00 -05:00
reloadControls ( ) ;
this - > core . saveSettings ( ) ;
} ) ;
2021-11-09 11:08:08 -05:00
2022-02-24 09:10:00 -05:00
loginBoxLayout - > addRow ( " Server Lobby " , serverType ) ;
2021-11-09 11:08:08 -05:00
2022-03-16 09:59:27 -04:00
gameLicenseBox = new QComboBox ( ) ;
gameLicenseBox - > insertItem ( 0 , " Windows Standalone " ) ;
gameLicenseBox - > insertItem ( 1 , " Windows Steam " ) ;
gameLicenseBox - > insertItem ( 2 , " macOS " ) ;
connect ( gameLicenseBox ,
static_cast < void ( QComboBox : : * ) ( int ) > (
& QComboBox : : currentIndexChanged ) ,
[ = ] ( int index ) {
getCurrentProfile ( ) . license = ( GameLicense ) index ;
this - > core . saveSettings ( ) ;
} ) ;
loginBoxLayout - > addRow ( " Game License " , gameLicenseBox ) ;
2022-02-24 09:10:00 -05:00
lobbyServerURL = new QLineEdit ( ) ;
connect ( lobbyServerURL , & QLineEdit : : editingFinished , [ = ] {
getCurrentProfile ( ) . lobbyURL = lobbyServerURL - > text ( ) ;
this - > core . saveSettings ( ) ;
} ) ;
loginBoxLayout - > addRow ( " Lobby URL " , lobbyServerURL ) ;
2021-11-09 11:08:08 -05:00
2022-02-24 09:10:00 -05:00
rememberUsernameBox = new QCheckBox ( ) ;
connect ( rememberUsernameBox , & QCheckBox : : stateChanged , [ = ] ( int ) {
getCurrentProfile ( ) . rememberUsername =
rememberUsernameBox - > isChecked ( ) ;
2021-11-09 12:42:05 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
2022-02-25 17:10:35 -05:00
loginBoxLayout - > addRow ( " Remember Username " , rememberUsernameBox ) ;
2021-11-09 11:06:42 -05:00
2022-02-24 09:10:00 -05:00
rememberPasswordBox = new QCheckBox ( ) ;
connect ( rememberPasswordBox , & QCheckBox : : stateChanged , [ = ] ( int ) {
getCurrentProfile ( ) . rememberPassword =
rememberPasswordBox - > isChecked ( ) ;
2021-11-09 12:42:05 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
2022-02-25 17:10:35 -05:00
loginBoxLayout - > addRow ( " Remember Password " , rememberPasswordBox ) ;
2021-11-09 11:06:42 -05:00
2021-11-02 20:04:53 -04:00
# if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
2022-02-24 09:10:00 -05:00
auto wineBox = new QGroupBox ( " Wine Options " ) ;
auto wineBoxLayout = new QFormLayout ( ) ;
wineBox - > setLayout ( wineBoxLayout ) ;
2021-11-02 14:53:46 -04:00
2022-02-24 09:10:00 -05:00
profileLayout - > addWidget ( wineBox , 1 , 2 , 1 , 1 ) ;
2021-11-02 20:04:53 -04:00
2022-02-24 09:10:00 -05:00
winePathLabel = new QLineEdit ( ) ;
winePathLabel - > setReadOnly ( true ) ;
wineBoxLayout - > addRow ( " Wine Executable " , winePathLabel ) ;
2021-11-03 06:18:31 -04:00
2022-02-24 09:10:00 -05:00
wineVersionCombo = new QComboBox ( ) ;
2021-11-03 06:18:31 -04:00
# if defined(Q_OS_MAC)
2022-02-24 09:10:00 -05:00
wineVersionCombo - > insertItem ( 2 , " FFXIV Built-In " ) ;
2021-11-03 06:18:31 -04:00
# endif
2022-02-24 09:10:00 -05:00
wineVersionCombo - > insertItem ( 0 , " System Wine " ) ;
wineVersionCombo - > insertItem ( 1 , " Custom Path... " ) ;
wineBoxLayout - > addWidget ( wineVersionCombo ) ;
selectWineButton = new QPushButton ( " Select Wine Executable " ) ;
wineBoxLayout - > addWidget ( selectWineButton ) ;
connect ( wineVersionCombo ,
static_cast < void ( QComboBox : : * ) ( int ) > (
& QComboBox : : currentIndexChanged ) ,
[ this ] ( int index ) {
getCurrentProfile ( ) . wineVersion = index ;
this - > core . readWineInfo ( getCurrentProfile ( ) ) ;
this - > core . saveSettings ( ) ;
this - > reloadControls ( ) ;
} ) ;
connect ( selectWineButton , & QPushButton : : pressed , [ this ] {
getCurrentProfile ( ) . winePath =
QFileDialog : : getOpenFileName ( this , " Open Wine Executable " ) ;
this - > core . saveSettings ( ) ;
this - > reloadControls ( ) ;
} ) ;
winePrefixDirectory = new QLineEdit ( ) ;
winePrefixDirectory - > setReadOnly ( true ) ;
wineBoxLayout - > addRow ( " Wine Prefix " , winePrefixDirectory ) ;
auto winePrefixButtonLayout = new QHBoxLayout ( ) ;
auto winePrefixButtonContainer = new QWidget ( ) ;
winePrefixButtonContainer - > setLayout ( winePrefixButtonLayout ) ;
wineBoxLayout - > addWidget ( winePrefixButtonContainer ) ;
auto selectPrefixButton = new QPushButton ( " Select Wine Prefix " ) ;
connect ( selectPrefixButton , & QPushButton : : pressed , [ this ] {
getCurrentProfile ( ) . winePrefixPath =
QFileDialog : : getExistingDirectory ( this , " Open Wine Prefix " ) ;
this - > core . saveSettings ( ) ;
this - > reloadControls ( ) ;
} ) ;
winePrefixButtonLayout - > addWidget ( selectPrefixButton ) ;
auto openPrefixButton = new QPushButton ( " Open Wine Prefix " ) ;
connect ( openPrefixButton , & QPushButton : : pressed ,
2022-02-24 09:28:11 -05:00
[ & window , this ] { window . openPath ( getCurrentProfile ( ) . winePrefixPath ) ; } ) ;
2022-02-24 09:10:00 -05:00
winePrefixButtonLayout - > addWidget ( openPrefixButton ) ;
auto enableDXVKhud = new QCheckBox ( " Enable DXVK HUD " ) ;
wineBoxLayout - > addRow ( " Wine Tweaks " , enableDXVKhud ) ;
connect ( enableDXVKhud , & QCheckBox : : stateChanged , [ this ] ( int state ) {
getCurrentProfile ( ) . enableDXVKhud = state ;
this - > core . settings . setValue ( " enableDXVKhud " ,
static_cast < bool > ( state ) ) ;
} ) ;
2021-11-02 20:04:53 -04:00
# endif
2021-11-01 14:35:32 -04:00
# if defined(Q_OS_LINUX)
2022-02-24 09:10:00 -05:00
useEsync = new QCheckBox (
" Use Better Sync Primitives (Esync, Fsync, and Futex2) " ) ;
wineBoxLayout - > addWidget ( useEsync ) ;
auto esyncLabel = new QPushButton ( " ? " ) ;
connect ( esyncLabel , & QPushButton : : pressed , [ esyncLabel ] {
QToolTip : : showText (
esyncLabel - > mapToGlobal ( QPoint ( ) ) ,
" This may improve game performance, but requires a Wine and kernel with the patches included. " ) ;
} ) ;
wineBoxLayout - > addWidget ( esyncLabel ) ;
connect ( useEsync , & QCheckBox : : stateChanged , [ this ] ( int state ) {
getCurrentProfile ( ) . useEsync = state ;
this - > core . saveSettings ( ) ;
} ) ;
useGamescope = new QCheckBox ( " Use Gamescope " ) ;
wineBoxLayout - > addWidget ( useGamescope ) ;
auto gamescopeButtonLayout = new QHBoxLayout ( ) ;
auto gamescopeButtonContainer = new QWidget ( ) ;
gamescopeButtonContainer - > setLayout ( gamescopeButtonLayout ) ;
wineBoxLayout - > addWidget ( gamescopeButtonContainer ) ;
auto gamescopeLabel = new QPushButton ( " ? " ) ;
connect ( gamescopeLabel , & QPushButton : : pressed , [ gamescopeLabel ] {
QToolTip : : showText (
gamescopeLabel - > mapToGlobal ( QPoint ( ) ) ,
" Use the micro-compositor compositor that uses Wayland and XWayland to create a nested session. \n If you primarily use fullscreen mode, this may improve input handling especially on Wayland. " ) ;
} ) ;
gamescopeButtonLayout - > addWidget ( gamescopeLabel ) ;
configureGamescopeButton = new QPushButton ( " Configure... " ) ;
connect ( configureGamescopeButton , & QPushButton : : pressed , [ & ] {
auto gamescopeSettingsWindow = new GamescopeSettingsWindow (
getCurrentProfile ( ) , this - > core , this ) ;
gamescopeSettingsWindow - > show ( ) ;
} ) ;
gamescopeButtonLayout - > addWidget ( configureGamescopeButton ) ;
connect ( useGamescope , & QCheckBox : : stateChanged , [ this ] ( int state ) {
getCurrentProfile ( ) . useGamescope = state ;
this - > core . saveSettings ( ) ;
this - > reloadControls ( ) ;
} ) ;
useGamemode = new QCheckBox ( " Use GameMode " ) ;
wineBoxLayout - > addWidget ( useGamemode ) ;
auto gamemodeLabel = new QPushButton ( " ? " ) ;
connect ( gamemodeLabel , & QPushButton : : pressed , [ gamemodeLabel ] {
QToolTip : : showText (
gamemodeLabel - > mapToGlobal ( QPoint ( ) ) ,
" A special game performance enhancer, which automatically tunes your CPU scheduler among other things. This may improve game performance. " ) ;
} ) ;
wineBoxLayout - > addWidget ( gamemodeLabel ) ;
connect ( useGamemode , & QCheckBox : : stateChanged , [ this ] ( int state ) {
getCurrentProfile ( ) . useGamemode = state ;
this - > core . saveSettings ( ) ;
} ) ;
2021-11-01 14:35:32 -04:00
# endif
2021-11-09 11:44:27 -05:00
2022-02-24 09:10:00 -05:00
auto dalamudBox = new QGroupBox ( " Dalamud Options " ) ;
auto dalamudBoxLayout = new QFormLayout ( ) ;
dalamudBox - > setLayout ( dalamudBoxLayout ) ;
2022-02-23 21:22:56 -05:00
2022-02-24 09:10:00 -05:00
profileLayout - > addWidget ( dalamudBox , 2 , 2 , 1 , 1 ) ;
2022-02-23 21:28:56 -05:00
2022-02-24 09:10:00 -05:00
enableDalamudBox = new QCheckBox ( ) ;
connect ( enableDalamudBox , & QCheckBox : : stateChanged , [ = ] ( int ) {
2022-03-13 19:58:58 -04:00
getCurrentProfile ( ) . dalamud . enabled = enableDalamudBox - > isChecked ( ) ;
2022-02-23 21:22:56 -05:00
2022-02-24 09:10:00 -05:00
this - > core . saveSettings ( ) ;
} ) ;
dalamudBoxLayout - > addRow ( " Enable Dalamud Injection " , enableDalamudBox ) ;
2022-02-23 21:22:56 -05:00
2022-03-13 19:58:58 -04:00
dalamudOptOutBox = new QCheckBox ( ) ;
connect ( dalamudOptOutBox , & QCheckBox : : stateChanged , [ = ] ( int ) {
getCurrentProfile ( ) . dalamud . optOutOfMbCollection = dalamudOptOutBox - > isChecked ( ) ;
this - > core . saveSettings ( ) ;
} ) ;
dalamudBoxLayout - > addRow ( " Opt Out of Automatic Marketboard Collection " , dalamudOptOutBox ) ;
2022-02-24 09:10:00 -05:00
dalamudVersionLabel = new QLabel ( ) ;
dalamudBoxLayout - > addRow ( " Dalamud Version " , dalamudVersionLabel ) ;
2022-02-25 18:08:57 -05:00
dalamudAssetVersionLabel = new QLabel ( ) ;
dalamudBoxLayout - > addRow ( " Dalamud Asset Version " , dalamudAssetVersionLabel ) ;
2022-02-24 09:10:00 -05:00
}
2022-02-23 21:22:56 -05:00
2022-03-09 08:08:03 -05:00
tabWidget - > setCurrentIndex ( defaultTab ) ;
2021-11-09 11:44:27 -05:00
reloadControls ( ) ;
}
void SettingsWindow : : reloadControls ( ) {
2021-11-09 12:06:30 -05:00
if ( currentlyReloadingControls )
return ;
currentlyReloadingControls = true ;
auto oldRow = profileWidget - > currentRow ( ) ;
2021-11-09 11:44:27 -05:00
profileWidget - > clear ( ) ;
2021-11-23 15:34:23 -05:00
for ( const auto & profile : core . profileList ( ) ) {
2021-11-09 11:44:27 -05:00
profileWidget - > addItem ( profile ) ;
}
2021-11-09 12:06:30 -05:00
profileWidget - > setCurrentRow ( oldRow ) ;
2022-02-24 09:10:00 -05:00
closeWhenLaunched - > setChecked ( core . appSettings . closeWhenLaunched ) ;
2021-11-09 13:44:37 -05:00
// deleting the main profile is unsupported behavior
2021-11-23 15:34:23 -05:00
deleteProfileButton - > setEnabled ( core . profileList ( ) . size ( ) > 1 ) ;
2021-11-09 13:44:37 -05:00
2021-11-23 15:34:23 -05:00
ProfileSettings & profile = core . getProfile ( profileWidget - > currentRow ( ) ) ;
2021-11-09 12:10:52 -05:00
nameEdit - > setText ( profile . name ) ;
2021-11-09 13:04:22 -05:00
// game
2021-11-09 12:06:30 -05:00
directXCombo - > setCurrentIndex ( profile . useDX9 ? 1 : 0 ) ;
2021-11-09 12:46:27 -05:00
currentGameDirectory - > setText ( profile . gamePath ) ;
2021-11-09 12:38:18 -05:00
2021-12-02 15:02:59 -05:00
if ( profile . installedMaxExpansion = = - 1 ) {
expansionVersionLabel - > setText ( " No game installed. " ) ;
} else {
QString expacString ;
2021-12-02 15:04:28 -05:00
expacString + = " Boot " ;
expacString + = QString ( " (%1) \n " ) . arg ( profile . bootVersion ) ;
2021-12-02 15:02:59 -05:00
if ( profile . installedMaxExpansion > = 0 ) {
expacString + = " A Realm Reborn " ;
expacString + = QString ( " (%1) \n " ) . arg ( profile . gameVersion ) ;
}
if ( profile . installedMaxExpansion > = 1 ) {
expacString + = " Heavensward " ;
expacString + = QString ( " (%1) \n " ) . arg ( profile . expansionVersions [ 0 ] ) ;
}
if ( profile . installedMaxExpansion > = 2 ) {
expacString + = " Stormblood " ;
expacString + = QString ( " (%1) \n " ) . arg ( profile . expansionVersions [ 1 ] ) ;
}
if ( profile . installedMaxExpansion > = 3 ) {
expacString + = " Shadowbringers " ;
expacString + = QString ( " (%1) \n " ) . arg ( profile . expansionVersions [ 2 ] ) ;
}
if ( profile . installedMaxExpansion > = 4 ) {
expacString + = " Endwalker " ;
expacString + = QString ( " (%1) \n " ) . arg ( profile . expansionVersions [ 3 ] ) ;
}
expansionVersionLabel - > setText ( expacString ) ;
}
2021-11-09 13:04:22 -05:00
// wine
wineVersionCombo - > setCurrentIndex ( profile . wineVersion ) ;
selectWineButton - > setEnabled ( profile . wineVersion = = 1 ) ;
winePathLabel - > setText ( profile . winePath ) ;
winePrefixDirectory - > setText ( profile . winePrefixPath ) ;
2021-11-09 14:17:04 -05:00
# if defined(Q_OS_LINUX)
2021-11-09 13:08:25 -05:00
useEsync - > setChecked ( profile . useEsync ) ;
useGamescope - > setChecked ( profile . useGamescope ) ;
useGamemode - > setChecked ( profile . useGamemode ) ;
2022-02-24 08:35:31 -05:00
useGamemode - > setEnabled ( core . gamemodeAvailable ) ;
useGamescope - > setEnabled ( core . gamescopeAvailable ) ;
configureGamescopeButton - > setEnabled ( profile . useGamescope ) ;
2022-01-27 09:25:23 -05:00
# endif
# ifdef ENABLE_WATCHDOG
2021-12-06 21:15:31 -05:00
enableWatchdog - > setChecked ( profile . enableWatchdog ) ;
2021-11-09 14:17:04 -05:00
# endif
2021-11-09 13:08:25 -05:00
2021-11-09 13:04:22 -05:00
// login
2021-11-09 21:13:21 -05:00
encryptArgumentsBox - > setChecked ( profile . encryptArguments ) ;
2021-11-09 12:38:18 -05:00
serverType - > setCurrentIndex ( profile . isSapphire ? 1 : 0 ) ;
2021-11-09 13:50:32 -05:00
lobbyServerURL - > setEnabled ( profile . isSapphire ) ;
2022-03-16 10:02:28 -04:00
if ( profile . isSapphire ) {
lobbyServerURL - > setText ( profile . lobbyURL ) ;
} else {
lobbyServerURL - > setText ( " neolobby0X.ffxiv.com " ) ;
}
2021-11-09 12:32:18 -05:00
rememberUsernameBox - > setChecked ( profile . rememberUsername ) ;
rememberPasswordBox - > setChecked ( profile . rememberPassword ) ;
2022-03-16 09:59:27 -04:00
gameLicenseBox - > setCurrentIndex ( ( int ) profile . license ) ;
2021-11-09 12:06:30 -05:00
2022-02-23 21:28:56 -05:00
// dalamud
2022-03-13 19:58:58 -04:00
enableDalamudBox - > setChecked ( profile . dalamud . enabled ) ;
2022-02-25 22:25:21 -05:00
if ( core . dalamudVersion . isEmpty ( ) ) {
2022-02-23 21:28:56 -05:00
dalamudVersionLabel - > setText ( " Dalamud is not installed. " ) ;
} else {
2022-02-25 22:25:21 -05:00
dalamudVersionLabel - > setText ( core . dalamudVersion ) ;
2022-02-23 21:28:56 -05:00
}
2021-11-23 14:37:37 -05:00
2022-02-25 22:25:21 -05:00
if ( core . dalamudAssetVersion = = - 1 ) {
2022-02-25 18:08:57 -05:00
dalamudAssetVersionLabel - > setText ( " Dalamud assets are not installed. " ) ;
} else {
2022-02-25 22:25:21 -05:00
dalamudAssetVersionLabel - > setText ( QString : : number ( core . dalamudAssetVersion ) ) ;
2022-02-25 18:08:57 -05:00
}
2022-03-13 19:58:58 -04:00
dalamudOptOutBox - > setChecked ( profile . dalamud . optOutOfMbCollection ) ;
2021-11-09 12:39:28 -05:00
window . reloadControls ( ) ;
2021-11-09 12:06:30 -05:00
currentlyReloadingControls = false ;
2021-11-03 06:31:02 -04:00
}
2021-11-09 12:10:52 -05:00
ProfileSettings & SettingsWindow : : getCurrentProfile ( ) {
2021-11-23 15:34:23 -05:00
return this - > core . getProfile ( profileWidget - > currentRow ( ) ) ;
2022-02-24 09:28:11 -05:00
}