| 1735 | } |
| 1736 | |
| 1737 | void PortMenu::InitElement() { |
| 1738 | if (!mMenuElementsInitialized) { |
| 1739 | AddMenuElements(); |
| 1740 | } |
| 1741 | |
| 1742 | Ship::Menu::InitElement(); |
| 1743 | disabledMap = { |
| 1744 | { DISABLE_FOR_NO_VSYNC, |
| 1745 | { [](disabledInfo&) -> bool { return !Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync(); }, |
| 1746 | "Disabling VSync not supported" } }, |
| 1747 | { DISABLE_FOR_NO_WINDOWED_FULLSCREEN, |
| 1748 | { [](disabledInfo&) -> bool { |
| 1749 | return !Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen(); |
| 1750 | }, |
| 1751 | "Windowed Fullscreen not supported" } }, |
| 1752 | { DISABLE_FOR_NO_MULTI_VIEWPORT, |
| 1753 | { [](disabledInfo&) -> bool { |
| 1754 | return !Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports(); |
| 1755 | }, |
| 1756 | "Multi-viewports not supported" } }, |
| 1757 | { DISABLE_FOR_NOT_DIRECTX, |
| 1758 | { [](disabledInfo&) -> bool { |
| 1759 | return Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != |
| 1760 | Ship::WindowBackend::FAST3D_DXGI_DX11; |
| 1761 | }, |
| 1762 | "Available only on DirectX" } }, |
| 1763 | { DISABLE_FOR_DIRECTX, |
| 1764 | { [](disabledInfo&) -> bool { |
| 1765 | return Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == |
| 1766 | Ship::WindowBackend::FAST3D_DXGI_DX11; |
| 1767 | }, |
| 1768 | "Not available on DirectX" } }, |
| 1769 | { DISABLE_FOR_MATCH_REFRESH_RATE_ON, |
| 1770 | { [](disabledInfo&) -> bool { return CVarGetInteger(CVAR_SETTING("MatchRefreshRate"), 0); }, |
| 1771 | "Match Refresh Rate is enabled" } }, |
| 1772 | { DISABLE_FOR_ADVANCED_RESOLUTION_ON, |
| 1773 | { [](disabledInfo&) -> bool { return CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled", 0); }, |
| 1774 | "Advanced Resolution enabled" } }, |
| 1775 | { DISABLE_FOR_VERTICAL_RES_TOGGLE_ON, |
| 1776 | { [](disabledInfo&) -> bool { |
| 1777 | return CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".VerticalResolutionToggle", 0); |
| 1778 | }, |
| 1779 | "Vertical Resolution Toggle enabled" } }, |
| 1780 | { DISABLE_FOR_LOW_RES_MODE_ON, |
| 1781 | { [](disabledInfo&) -> bool { return CVarGetInteger(CVAR_LOW_RES_MODE, 0); }, "N64 mode enabled" } }, |
| 1782 | { DISABLE_FOR_ADVANCED_RESOLUTION_OFF, |
| 1783 | { [](disabledInfo&) -> bool { return !CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled", 0); }, |
| 1784 | "Advanced Resolution is disabled" } }, |
| 1785 | { DISABLE_FOR_VERTICAL_RESOLUTION_OFF, |
| 1786 | { [](disabledInfo&) -> bool { |
| 1787 | return !CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".VerticalResolutionToggle", 0); |
| 1788 | }, |
| 1789 | "Vertical Resolution Toggle is off" } }, |
| 1790 | }; |
| 1791 | } |
| 1792 | |
| 1793 | void PortMenu::UpdateElement() { |
| 1794 | Ship::Menu::UpdateElement(); |
nothing calls this directly
no outgoing calls
no test coverage detected