From 1c7c5142f00c1b17b59f1450de4e219bea52ebfc Mon Sep 17 00:00:00 2001 From: Azumgi Date: Sat, 3 Feb 2018 23:05:39 +0300 Subject: [PATCH] Search bar, ui scaling and probably something else --- vmf_source/gui/search_bar_icon.dds | Bin 0 -> 9344 bytes vmf_source/gui/search_bar_icon.texture | 18 ++ vmf_source/materials/search_bar_icon.material | 14 ++ vmf_source/resource_packages/vmf.package | 1 + .../scripts/mods/vmf/modules/keybindings.lua | 6 +- .../mods/vmf/modules/vmf_options_view.lua | 217 ++++++++++++++++-- 6 files changed, 238 insertions(+), 18 deletions(-) create mode 100644 vmf_source/gui/search_bar_icon.dds create mode 100644 vmf_source/gui/search_bar_icon.texture create mode 100644 vmf_source/materials/search_bar_icon.material diff --git a/vmf_source/gui/search_bar_icon.dds b/vmf_source/gui/search_bar_icon.dds new file mode 100644 index 0000000000000000000000000000000000000000..5d5503398db80ed6e45ec31f77314023f8e8c333 GIT binary patch literal 9344 zcmdT}*=iI)6m2086@UPzwPPMu(y_zIRcV&9A8YPkR^H=_V zDTWNUhVeN`n&#)ve=5H#|N7NzHj|v_LjM%l3>*V40oQ?Rz(t@2Yyf(Jyxe8>p9ej4 zU>x`c{LH{-v_AlL0keQIwfVT`!uEOK9gwA2YJY*TM}Tg?XDfEwdf0mjNV@XYKLpqE z|KtN>JFmWw{-3}*T(S>iC26<)+gp+kM+3A^q0cQ~6xad`w6G23S>QfkYn7e{(JyAq zQ-@@W_0-M%vLDE@y9Rx@ulo47C!_&fS+>|d2Y3xg_Quh+6bRw6`|vDy>*3{E+5NT8 z7d$rZppE`%xl@ew?PEI%a8uK4-~-^A`w7%n0Iha2ZV5Qv11=lSQD5Y27!i2Cpnfr6 zG!!lQe!KLuZk^Ij7sgEryqA@nK0j{@wyr2`r5N|!!O8q(p_0?5f0M%&=l>0$$&;8z zy4IBYyHAIcov3on0`EuTwGNJm*LDR>w?Wg3Y*dy zsof86k>i@SnN z&Aniwz{R_3sGdCim`8mSY%<5l!^OTmz*h&~57ey!^73W%-|n!*_wN~?$$_R}+#`YW z2I{l)}@Q&11fZO=X^TZXW zj2*tuj04kGQy#{6*EzsCe!tP&y^Ic?B~t=F^TZh6RAzwZv0#Hfa2@jAlNj%e8A&^N zW8EJ)SBycc-redBoL*O&qzLIxx`cem&&+vN=_YlUi zw7>iKPGFpgx1uGr_-vKc7IPhVukn5ND9eX)5!Yc6xcKcPmezaV;+c}g7c-U^i#*>Z z0_;kD3Q)^P z3;R(H0n8(_axwlrLs~Dp{tWurw%h4h%7<+Ie2yJUG3UUSx7dEP^E!ma692XkbM9ht z@$9zeTY7Hib!Y_o(9Z8eJ ui_resolution_width_fragments() and h > ui_resolution_height_fragments() and vmf:get("auto_hd_ui_scaling")) then + local max_scaling_factor = 4 + + local width_scale = math_min(w / ui_resolution_width_fragments(), max_scaling_factor) -- Changed to allow scaling up to quadruple the original max scale (1 -> 4) + local height_scale = math_min(h / ui_resolution_height_fragments(), max_scaling_factor) -- Changed to allow scaling up to quadruple the original max scale (1 -> 4) + + raw_set(_G, "vmf_hd_ui_scaling_enabled", true) + return math_min(width_scale, height_scale) + else + raw_set(_G, "vmf_hd_ui_scaling_enabled", false) + return func(...) + end +end) + local options_widgets = { { ["setting_name"] = "open_vmf_options", ["widget_type"] = "keybind", ["text"] = "Open menu hotkey", ["tooltip"] = "Probably keybind", - ["default_value"] = {"f4"}, + ["default_value"] = {"f5"}, ["action"] = "open_vmf_options" + }, + { + ["setting_name"] = "auto_hd_ui_scaling", + ["widget_type"] = "checkbox", + ["text"] = "Automatic HD UI Scaling", + ["tooltip"] = "Automatic HD UI Scaling" .. "\n\n" .. + "Automatically scale UI when resolution exceeds 1080p.", + ["default_value"] = true } }