Compare commits

..

No commits in common. "d9755a31fee2c8d003e32c46f9e4fc793884527b" and "819e144410baf5bacf7409259d622aee0c810e59" have entirely different histories.

18 changed files with 115 additions and 81 deletions

2
.gitmodules vendored
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

2
third-party/SDL vendored

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

2
third-party/corrade vendored

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

2
third-party/curl vendored

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

2
third-party/efsw vendored

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

2
third-party/imgui vendored

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

2
third-party/libzip vendored

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

2
third-party/magnum vendored

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

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