Skip to content

Commit

Permalink
Used a fixed offset for Filter Wipes and Refresh items to prevent aut…
Browse files Browse the repository at this point in the history
…oresize feedback loop.

View button now opens log in default browser, hidden while the log is uploaded.
Reduced auto refresh timer to 1 min.
  • Loading branch information
nbarrios committed Nov 25, 2020
1 parent 5ebacee commit 1bb001c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '0.9.{build}'
version: '0.9.3.{build}'

branches:
only:
Expand Down
27 changes: 21 additions & 6 deletions arcdps_uploader/Uploader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ uintptr_t Uploader::imgui_tick()
static ImVec2 log_size(450, 258);
ImGui::AlignFirstTextHeightToWidgets();
ImGui::TextUnformatted("Recent Logs");
ImGui::SameLine(ImGui::GetContentRegionAvailWidth() - 170.f);
ImGui::SameLine(450.f - 170.f);
ImGui::Checkbox("Filter Wipes", &success_only);
ImGui::SameLine(ImGui::GetContentRegionAvailWidth() - 54.f);
ImGui::SameLine(450.f - 54.f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.f, 3.f));
if (ImGui::Button("Refresh")) {
start_async_refresh_log_list();
}
ImGui::PopStyleVar();

ImGui::BeginChild("List", log_size, true, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar);
ImGui::BeginChild("List", log_size, true, ImGuiWindowFlags_NoScrollbar);

ImGui::Columns(3, "mycolumns");
float last_col = log_size.x - ImGui::CalcTextSize("View").x * 1.9f;
Expand Down Expand Up @@ -177,15 +177,30 @@ uintptr_t Uploader::imgui_tick()
ImGui::Selectable(display.c_str(), &selected[i], ImGuiSelectableFlags_SpanAllColumns);
ImGui::PopID();
ImGui::PopStyleColor();
ImGui::SetItemAllowOverlap();
ImGui::NextColumn();
ImGui::Text(s.human_time.c_str());
ImGui::NextColumn();
ImGui::SmallButton("View");
if (s.uploaded) {
ImGui::PushID(s.filename.c_str());
if (ImGui::SmallButton("View"))
{
if (!s.permalink.empty()) {
int sz = MultiByteToWideChar(CP_UTF8, 0, s.permalink.c_str(), (int)s.permalink.size(), 0, 0);
std::wstring wstr(sz, 0);
MultiByteToWideChar(CP_UTF8, 0, s.permalink.c_str(), (int)s.permalink.size(), &wstr[0], sz);
ShellExecute(0, 0, wstr.c_str(), 0, 0, SW_SHOW);
}
}
ImGui::PopID();
}
/*
if (ImGui::IsItemHovered() && s.uploaded) {
ImGui::BeginTooltip();
create_log_table(s);
ImGui::EndTooltip();
}
*/
ImGui::NextColumn();

if (logs.size() < 9 && i == logs.size() - 1) {
Expand All @@ -194,7 +209,7 @@ uintptr_t Uploader::imgui_tick()
log_size.y = ImGui::GetCursorPosY();
}
}
ImGui::Columns(1);
ImGui::Columns();
ImGui::EndChild();

if (ImGui::Button("Copy Selected"))
Expand Down Expand Up @@ -793,7 +808,7 @@ void Uploader::poll_async_refresh_log_list() {

auto now = std::chrono::system_clock::now();
auto diff = now - refresh_time;
if (diff > std::chrono::minutes(2)) {
if (diff > std::chrono::minutes(1)) {
start_async_refresh_log_list();
refresh_time = now;
}
Expand Down
2 changes: 1 addition & 1 deletion arcdps_uploader/arcdps_uploader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ arcdps_exports* mod_init() {
/* for arcdps */
exports.size = sizeof(arcdps_exports);
exports.out_name = "uploader";
exports.out_build = "0.9.0";
exports.out_build = "0.9.3";
exports.sig = 0x92485179;
exports.wnd_nofilter = mod_wnd;
exports.combat = mod_combat;
Expand Down

0 comments on commit 1bb001c

Please sign in to comment.