Compare commits

...

5 commits

Author SHA1 Message Date
d9755a31fe
Application: update layout in the frame editor.
That table for the joint sliders was ugly as fuck. I'm glad to be
rid of it.
2023-11-29 13:51:36 +01:00
bf7f6d24f3
Application: adapt to ImGui changes. 2023-11-29 13:12:18 +01:00
df9e6bcd17
CMakeLists: change how libcurl is found. 2023-11-29 13:00:31 +01:00
90fd22225f
ProfileManager: adapt to Corrade changes. 2023-11-29 13:00:05 +01:00
5af4ad0e66
Update submodules.
libzip also changed its branch name from master to main, so adapt to
that too.
2023-11-29 12:58:52 +01:00
18 changed files with 81 additions and 115 deletions

2
.gitmodules vendored
View file

@ -21,7 +21,7 @@
[submodule "libzip"]
path = third-party/libzip
url = https://github.com/nih-at/libzip
branch = master
branch = main
[submodule "efsw"]
path = third-party/efsw
url = https://github.com/SpartanJ/efsw

View file

@ -58,7 +58,7 @@ Application::drawManager() {
if(ImGui::BeginChild("##ProfileInfo",
{ImGui::GetContentRegionAvail().x * 0.60f, 0.0f},
true, ImGuiWindowFlags_MenuBar))
ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{
if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Profile information");
@ -85,7 +85,7 @@ Application::drawManager() {
ImGui::SameLine();
if(ImGui::BeginChild("##MASSManager", {0.0f, 0.0f},
true, ImGuiWindowFlags_MenuBar))
ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{
if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("M.A.S.S. management");

View file

@ -52,7 +52,7 @@ Application::drawMassViewer() {
if(ImGui::BeginChild("##MassInfo",
{0.0f, 0.0f},
true, ImGuiWindowFlags_MenuBar))
ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{
if(ImGui::BeginMenuBar()) {
if(ImGui::BeginTable("##MassViewerMenuTable", 4)) {
@ -303,7 +303,9 @@ Application::drawCustomStyle(GameObjects::CustomStyle& style) {
DCSResult return_value = DCS_Fail;
if(!ImGui::BeginChild("##CustomStyle", {0.0f, 244.0f}, true, ImGuiWindowFlags_MenuBar)) {
if(!ImGui::BeginChild("##CustomStyle", {}, ImGuiChildFlags_Border|ImGuiChildFlags_AutoResizeY,
ImGuiWindowFlags_MenuBar))
{
ImGui::EndChild();
return DCS_Fail;
}

View file

@ -34,7 +34,7 @@ Application::drawArmour() {
_currentMass->getBulletLauncherAttachments();
}
if(!ImGui::BeginChild("##ArmourParts", {0.0f, 0.0f}, true)) {
if(!ImGui::BeginChild("##ArmourParts", {}, ImGuiChildFlags_Border)) {
ImGui::EndChild();
return;
}

View file

@ -36,11 +36,13 @@ Application::drawFrameInfo() {
if(ImGui::BeginChild("##JointSliders",
{(ImGui::GetContentRegionAvail().x / 2.0f) - (ImGui::GetStyle().WindowPadding.x / 2.0f),
(ImGui::GetContentRegionAvail().y / 1.75f) - (ImGui::GetStyle().WindowPadding.y / 2.0f)},
true, ImGuiWindowFlags_MenuBar))
0.0f},
ImGuiChildFlags_Border|ImGuiChildFlags_AutoResizeY, ImGuiWindowFlags_MenuBar))
{
if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Joint sliders");
drawHelpMarker("In-game values are multiplied by 100. For example, 0.500 here is equal to 50 in-game.",
static_cast<float>(windowSize().x()) / 4.0f);
ImGui::EndMenuBar();
}
@ -51,7 +53,7 @@ Application::drawFrameInfo() {
if(ImGui::BeginChild("##FrameStyles",
{(ImGui::GetContentRegionAvail().x / 2.0f) - (ImGui::GetStyle().WindowPadding.x / 2.0f), 0.0f},
true, ImGuiWindowFlags_MenuBar))
ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{
if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Frame styles");
@ -67,7 +69,7 @@ Application::drawFrameInfo() {
ImGui::SameLine();
if(ImGui::BeginChild("##EyeFlare", {0.0f, 0.0f}, true, ImGuiWindowFlags_MenuBar)) {
if(ImGui::BeginChild("##EyeFlare", {}, ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar)) {
if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Eye flare colour");
drawHelpMarker("Right-click the picker for more options.", 250.0f);
@ -88,98 +90,53 @@ Application::drawJointSliders() {
return;
}
ImGui::TextWrapped("In-game values are multiplied by 100.\nFor example, 0.500 here is equal to 50 in-game.");
ImGui::BeginGroup();
drawAlignedText("Neck:");
drawAlignedText("Body:");
drawAlignedText("Shoulders:");
drawAlignedText("Hips:");
drawAlignedText("Arms:");
drawAlignedText("Legs:");
ImGui::EndGroup();
if(ImGui::BeginTable("##JointSliderTable", 2, ImGuiTableFlags_Borders)) {
ImGui::TableSetupColumn("##SliderLabel", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("##Sliders", ImGuiTableColumnFlags_WidthStretch);
ImGui::SameLine();
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
drawAlignedText("Neck");
ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(-1.0f);
ImGui::BeginGroup();
ImGui::PushItemWidth(-1.0f);
if(ImGui::SliderFloat("##NeckSlider", &_currentMass->jointSliders().neck, 0.0f, 1.0f)) {
_jointsDirty = true;
}
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
drawAlignedText("Body");
ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(-1.0f);
if(ImGui::SliderFloat("##BodySlider", &_currentMass->jointSliders().body, 0.0f, 1.0f)) {
_jointsDirty = true;
}
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
drawAlignedText("Shoulders");
ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(-1.0f);
if(ImGui::SliderFloat("##ShouldersSlider", &_currentMass->jointSliders().shoulders, 0.0f, 1.0f)) {
_jointsDirty = true;
}
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
drawAlignedText("Hips");
ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(-1.0f);
if(ImGui::SliderFloat("##HipsSlider", &_currentMass->jointSliders().hips, 0.0f, 1.0f)) {
_jointsDirty = true;
}
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
drawAlignedText("Arms");
ImGui::TableSetColumnIndex(1);
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2{2.0f, 1.0f});
if(ImGui::BeginTable("##UpperLowerArmsLayoutTable", 2)) {
ImGui::TableSetupColumn("##UpperArms", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("##LowerArms", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(-1.0f);
ImGui::PushMultiItemsWidths(2, ImGui::CalcItemWidth());
if(ImGui::SliderFloat("##UpperArmsSlider", &_currentMass->jointSliders().upperArms, 0.0f, 1.0f, "Upper: %.3f")) {
_jointsDirty = true;
}
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(-1.0f);
ImGui::PopItemWidth();
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
if(ImGui::SliderFloat("##LowerArmsSlider", &_currentMass->jointSliders().lowerArms, 0.0f, 1.0f, "Lower: %.3f")) {
_jointsDirty = true;
}
ImGui::EndTable();
}
ImGui::PopStyleVar();
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
drawAlignedText("Legs");
ImGui::TableSetColumnIndex(1);
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2{2.0f, 1.0f});
if(ImGui::BeginTable("##UpperLowerLegsLayoutTable", 2)) {
ImGui::TableSetupColumn("##UpperLegs", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("##LowerLegs", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(-1.0f);
ImGui::PopItemWidth();
ImGui::PushMultiItemsWidths(2, ImGui::CalcItemWidth());
if(ImGui::SliderFloat("##UpperLegsSlider", &_currentMass->jointSliders().upperLegs, 0.0f, 1.0f, "Upper: %.3f")) {
_jointsDirty = true;
}
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(-1.0f);
ImGui::PopItemWidth();
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
if(ImGui::SliderFloat("##LowerLegsSlider", &_currentMass->jointSliders().lowerLegs, 0.0f, 1.0f, "Lower: %.3f")) {
_jointsDirty = true;
}
ImGui::EndTable();
}
ImGui::PopStyleVar();
ImGui::EndTable();
}
ImGui::PopItemWidth();
ImGui::PopItemWidth();
ImGui::EndGroup();
if(!_jointsDirty) {
ImGui::BeginDisabled();
@ -218,9 +175,14 @@ Application::drawFrameStyles() {
ImGui::PushID(i);
if(ImGui::BeginCombo("##Style", getStyleName(_currentMass->frameStyles()[i], _currentMass->frameCustomStyles()).data())) {
ImGui::PushItemWidth(-1.0f);
if(ImGui::BeginCombo("##Style",
getStyleName(_currentMass->frameStyles()[i], _currentMass->frameCustomStyles()).data()))
{
for(const auto& style : GameData::style_names) {
if(ImGui::Selectable(getStyleName(style.first, _currentMass->frameCustomStyles()).data(), _currentMass->frameStyles()[i] == style.first)) {
if(ImGui::Selectable(getStyleName(style.first, _currentMass->frameCustomStyles()).data(),
_currentMass->frameStyles()[i] == style.first))
{
_currentMass->frameStyles()[i] = style.first;
_stylesDirty = true;
}
@ -228,6 +190,7 @@ Application::drawFrameStyles() {
ImGui::EndCombo();
}
ImGui::PopItemWidth();
ImGui::PopID();
}

View file

@ -506,7 +506,7 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
}
}
if(ImGui::BeginChild("##PartDetails", {0.0f, 0.0f}, true)) {
if(ImGui::BeginChild("##PartDetails", {}, ImGuiChildFlags_Border)) {
ImGui::TextUnformatted("Styles:");
for(std::int32_t i = 0; i < 4; i++) {

View file

@ -305,7 +305,7 @@ Application::drawBackupListPopup() {
ImGui::EndTable();
}
ImGui::PushTextWrapPos(ImGui::GetWindowContentRegionWidth());
ImGui::PushTextWrapPos(ImGui::GetContentRegionAvail().x);
ImGui::TextUnformatted("Hover over a company name to see which files are included in the backup.");
ImGui::PopTextWrapPos();

View file

@ -86,9 +86,10 @@ Application::drawAbout() {
ImGui::Separator();
if(ImGui::CollapsingHeader("Licence")) {
ImGui::TextWrapped("This application is made available under the terms of the GNU General Public License, version 3, the full text of which is available below:");
ImGui::TextWrapped("This application is made available under the terms of the GNU General Public License,"
"version 3, the full text of which is available below:");
if(ImGui::BeginChild("##GPL", {0.0f, float(windowSize().y()) * 0.3f}, true)) {
if(ImGui::BeginChild("##GPL", {0.0f, float(windowSize().y()) * 0.3f}, ImGuiChildFlags_Border)) {
static auto licence = _rs.getRaw("COPYING");
ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[1]);
ImGui::TextUnformatted(licence.begin(), licence.end());

View file

@ -26,8 +26,8 @@ if(CORRADE_TARGET_WINDOWS)
endif()
find_package(Magnum REQUIRED GL Sdl2Application)
find_package(MagnumIntegration REQUIRED ImGui)
find_package(CURL REQUIRED HTTPS)
if(SAVETOOL_USE_SYSTEM_LIBS)
find_package(CURL REQUIRED HTTPS)
find_package(libzip REQUIRED)
find_package(efsw REQUIRED)
endif()

View file

@ -142,7 +142,7 @@ ProfileManager::backupProfile(std::size_t index, bool backup_builds) {
auto& profile = _profiles[index];
auto filename = Utility::format("{}_{}{:.2d}{:.2d}_{:.2d}{:.2d}{:.2d}.backup.mbst",
Utility::String::replaceAll(profile.companyName().data(), " ", "_").c_str(),
Utility::String::replaceAll(profile.companyName().data(), " ", "_").data(),
time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
time->tm_hour, time->tm_min, time->tm_sec);

2
third-party/SDL vendored

@ -1 +1 @@
Subproject commit f032e8c19165aeee6f9b47e82fb56809d4aeae1e
Subproject commit 01346723455a37c1cd14bba28ebeffe268002bcd

2
third-party/corrade vendored

@ -1 +1 @@
Subproject commit 183b375b73fa3e819a6b41dbcc0cf2f06773d2b4
Subproject commit 4922edf269ce77efe073f6b750a34892e1f3c30d

2
third-party/curl vendored

@ -1 +1 @@
Subproject commit 864090ca39c3c9fe994104ed23d29c37caa61a8e
Subproject commit a4ed3e766a68ff7517ee9cf3cb71c7255e8ee9b0

2
third-party/efsw vendored

@ -1 +1 @@
Subproject commit 19398b80bc5161b9a890035d1de47244165c2f17
Subproject commit bc85bafae7d7b641e326ed5d01bfffd5eb0352f5

2
third-party/imgui vendored

@ -1 +1 @@
Subproject commit f617fe7890f78bc300e7a068a1c2acc9e9ce1e97
Subproject commit 7965494ff323c8a3232ac1233a08b984e3c981ae

2
third-party/libzip vendored

@ -1 +1 @@
Subproject commit bdc03ab23b703fcc516436d6ebcbfb6ac4484033
Subproject commit 0b6ebe6fad8adb1ec95bb5529c5af2185d40c2cf

2
third-party/magnum vendored

@ -1 +1 @@
Subproject commit 0d31f7461b31698ea5bf92ec66ff5056a6ad7360
Subproject commit b91b0b24cde81a4eb9029cb2202b3a652c9bd0e9

@ -1 +1 @@
Subproject commit 35c05fda3e243b696e2b3a3dcd230c819ca108e0
Subproject commit bb8a4a870f217fc9ac15ff0ddc145974be49a5e7