Skip to content

Commit

Permalink
增加了隐藏的UI
Browse files Browse the repository at this point in the history
  • Loading branch information
GengGode committed Sep 20, 2021
1 parent 29de78d commit ac8451e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
16 changes: 15 additions & 1 deletion GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void GenshinImpactNaturalLaw::ShowEvent()
//this->raise();
//WidgetsSetting->hide();

setting.sync();
setting.load();
uiShowImage();
}

Expand Down Expand Up @@ -321,17 +321,31 @@ void GenshinImpactNaturalLaw::ChangedUIShowSate()
if (nowIsShowState)
{
ui.GrayBackGround_TabPage_Rect->hide();
ui.GrayBackGround_Right_Rect->hide();

ui.pushButton->hide();
ui.label_Page_Rect->hide();
ui.tabWidget->hide();

for (int i = 0; i < LinkeButtonList.size(); i++)
{
LinkeButtonList[i]->hide();
}
}
else
{
ui.GrayBackGround_TabPage_Rect->show();
ui.GrayBackGround_Right_Rect->show();

ui.pushButton->show();
ui.label_Page_Rect->show();
ui.tabWidget->show();

for (int i = 0; i < LinkeButtonList.size(); i++)
{
LinkeButtonList[i]->show();
}

}
nowIsShowState = !nowIsShowState;
}
Expand Down
23 changes: 22 additions & 1 deletion GenshinImpactNaturalLaw/SettingData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SettingData::SettingData()

SettingData::~SettingData()
{
sync();
//sync();
}

SettingData & SettingData::operator=(const SettingData & setting)
Expand All @@ -47,6 +47,27 @@ SettingData & SettingData::operator=(const SettingData & setting)
return *this;
}

void SettingData::load()
{
is_auto_run = IniSettingFile->value("General/is_auto_run").toBool();
is_start_pupowindows = IniSettingFile->value("General/is_start_pupowindows").toBool();
is_start_module = IniSettingFile->value("General/is_start_module").toBool();
is_exit_ismini = IniSettingFile->value("General/is_exit_ismini").toBool();

launcher_install_path = IniSettingFile->value("Launcher/launcher_install_path").toString();
game_dynamic_bg_name = IniSettingFile->value("Launcher/game_dynamic_bg_name").toString();

game_install_path = IniSettingFile->value("Game/game_install_path").toString();
game_start_name = IniSettingFile->value("Game/game_start_name").toString();

is_first_exit = IniSettingFile->value("Module/is_first_exit").toBool();
mods_number = IniSettingFile->value("Module/mods_number").toInt();
for (int i = 0; i < mods_number; i++)
{
is_start_mods_list.push_back(IniSettingFile->value("Module/mods_" + QString::number(i)).toBool());
}
}

void SettingData::sync()
{
IniSettingFile->setValue("General/is_auto_run", is_auto_run);
Expand Down
2 changes: 2 additions & 0 deletions GenshinImpactNaturalLaw/SettingData.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class SettingData
~SettingData();
SettingData& operator=(const SettingData& setting);


void load();
void sync();

bool tryGetGamePath();
Expand Down

0 comments on commit ac8451e

Please sign in to comment.