Skip to content
This repository was archived by the owner on Sep 2, 2019. It is now read-only.

Commit a56ce70

Browse files
committed
Update font settings. Runtime font loading. etc..
1 parent 105fa07 commit a56ce70

File tree

17 files changed

+617
-345
lines changed

17 files changed

+617
-345
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ dist/*
1212
*.7z
1313
textures/out/*
1414
src/version
15-
prebuilt/*
15+
prebuilt/*
16+
/test/config.bat

dist/dist.bat

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ SET OWNER=ZCube
99
SET REPO=ACTWebSocketOverlay
1010

1111
echo ==========================================================================================
12-
@py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_nonssl_%version%.zip
13-
REM @py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_lua_nonssl_%version%.zip
14-
@py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_ffxiv_nonssl_%version%.zip
15-
REM @py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_ffxiv_lua_nonssl_%version%.zip
12+
REM @py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_nonssl_%version%.zip
13+
@py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_lua_nonssl_%version%.zip
14+
REM @py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_ffxiv_nonssl_%version%.zip
15+
@py -2 github_uploader.py %GITHUB_TOKEN% %OWNER% %REPO% %tag% ACTWebSocketOverlay_ffxiv_lua_nonssl_%version%.zip
1616
echo ==========================================================================================
1717

1818
:SetVariables
@@ -22,12 +22,11 @@ if exist "%LOCALAPPDATA%\Dropbox\info.json" SET DROP_INFO=%LOCALAPPDATA%\Dropbox
2222
for /f "tokens=*" %%a in ( 'powershell -NoProfile -ExecutionPolicy Bypass -Command "( ( Get-Content -Raw -Path %DROP_INFO% | ConvertFrom-Json ).personal.path)" ' ) do set dropBoxRoot=%%a
2323
echo %dropBoxRoot%
2424

25-
REM lua has problems. on dx9
2625
if not exist "%dropBoxRoot%\share" mkdir "%dropBoxRoot%\share"
2726
if %errorlevel% neq 0 exit /b %errorlevel%
28-
xcopy /hrkysd "%CD%\ACTWebSocketOverlay_nonssl_latest.zip" /exclude:exclude_files.txt "%dropBoxRoot%\share\ACTWebSocketOverlay_latest.zip"
27+
xcopy /hrkysd "%CD%\ACTWebSocketOverlay_lua_nonssl_latest.zip" /exclude:exclude_files.txt "%dropBoxRoot%\share\ACTWebSocketOverlay_latest.zip"
2928
if %errorlevel% neq 0 exit /b %errorlevel%
30-
xcopy /hrkysd "%CD%\ACTWebSocketOverlay_ffxiv_nonssl_latest.zip" /exclude:exclude_files.txt "%dropBoxRoot%\share\ACTWebSocketOverlay_ffxiv_latest.zip"
29+
xcopy /hrkysd "%CD%\ACTWebSocketOverlay_lua_ffxiv_nonssl_latest.zip" /exclude:exclude_files.txt "%dropBoxRoot%\share\ACTWebSocketOverlay_ffxiv_latest.zip"
3130
if %errorlevel% neq 0 exit /b %errorlevel%
3231
copy /y "%CD%\..\src\version" "%dropBoxRoot%\share\ACTWebSocketOverlay_version"
3332
if %errorlevel% neq 0 exit /b %errorlevel%

src/awio/AWIOOverlay.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class AWIOOverlay : public OverlayContextBase
8484
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.3, 0.3, 0.3, background_opacity * global_opacity));
8585
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0, 0.0, 0.0, 0.0f));
8686
ImGui::PushStyleColor(ImGuiCol_Text, ColorWithAlpha(preference_storage.color_map["TitleText"], text_opacity * global_opacity));
87-
ImGui::Begin("AWIO", nullptr, options->windows_default_sizes["AWIO"], -1,
87+
ImGui::Begin("AWIO", nullptr, options->GetDefaultSize("AWIO",ImVec2(500,200)), -1,
8888
ImGuiWindowFlags_NoTitleBar | (use_input ? NULL : ImGuiWindowFlags_NoInputs));
8989
options->windows_default_sizes["AWIO"] = ImGui::GetWindowSize();
9090

@@ -97,6 +97,7 @@ class AWIOOverlay : public OverlayContextBase
9797
auto resize_img = images->find("resize");
9898
if (cog_img != images->end() && resize_img != images->end())
9999
{
100+
double scale = (io.Fonts->Fonts[0]->FontSize* io.FontGlobalScale) / cog_img->second.height / 1.5f;
100101
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImVec4(0,0,0,0));
101102
float icon_color_change = (cosf(GetTickCount() / 500.0f) + 1.0f) / 2.0f;
102103
ImVec4 color = ColorWithAlpha(preference_storage.color_map["TitleText"], text_opacity * global_opacity);
@@ -106,21 +107,21 @@ class AWIOOverlay : public OverlayContextBase
106107
auto p = ImGui::GetCursorPos();
107108
ImGui::BeginChild("Btn",
108109
//ImVec2(100,100),
109-
ImVec2((cog_img->second.width + resize_img->second.width + 36) * io.FontGlobalScale / 6, (cog_img->second.height + 18) * io.FontGlobalScale / 6),
110+
ImVec2((cog_img->second.width + 18) * scale, (cog_img->second.height + 18) * scale),
110111
false,
111112
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse);
112-
if (ImGui::ImageButton(texture, ImVec2(resize_img->second.width * io.FontGlobalScale / 6, resize_img->second.height * io.FontGlobalScale / 6), resize_img->second.uv0, resize_img->second.uv1, 2, ImVec4(0, 0, 0, 0), color))
113+
if (ImGui::ImageButton(texture, ImVec2(resize_img->second.width * scale, resize_img->second.height * scale), resize_img->second.uv0, resize_img->second.uv1, 2, ImVec4(0, 0, 0, 0), color))
113114
{
114115
options->movable = !options->movable;
115116
}
116117
ImGui::EndChild();
117-
ImGui::SameLine((cog_img->second.width + 18) * io.FontGlobalScale / 6);
118+
ImGui::SameLine((cog_img->second.width + 18) * scale);
118119
ImGui::BeginChild("Btn1",
119120
//ImVec2(100,100),
120-
ImVec2((cog_img->second.width + resize_img->second.width + 36) * io.FontGlobalScale / 6, (cog_img->second.height + 18) * io.FontGlobalScale / 6),
121+
ImVec2((resize_img->second.width + 36) * scale, (cog_img->second.height + 18) * scale),
121122
false,
122123
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse);
123-
if (ImGui::ImageButton(texture, ImVec2(cog_img->second.width * io.FontGlobalScale / 6, cog_img->second.height * io.FontGlobalScale / 6), cog_img->second.uv0, cog_img->second.uv1, 2, ImVec4(0, 0, 0, 0), color))
124+
if (ImGui::ImageButton(texture, ImVec2(cog_img->second.width * scale, cog_img->second.height * scale), cog_img->second.uv0, cog_img->second.uv1, 2, ImVec4(0, 0, 0, 0), color))
124125
{
125126
options->show_preferences = !options->show_preferences;
126127
}

0 commit comments

Comments
 (0)