Timestamp:
Oct 17, 2021, 12:58:51 PM (3 years ago)
Author:
Silier
Message:

There have been quite a bit of number of questions how to change scale of the gui, because this option is hidden from the user.

Use dropdown with values. Implement confirmation box with countdown to revert scale change because buttons can get unable to click.

Differential revision: D3037
Comments by: @vladislavbelov, @Stan, @wraitii, @pieq, @sera
Tested by: @Langbart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/gui/CGUI.cpp

    r25746 r25966  
    4343#include "ps/Profile.h"
    4444#include "ps/Pyrogenesis.h"
     45
    4546#include "ps/XML/Xeromyces.h"
    4647#include "scriptinterface/ScriptContext.h"
     
    155156        //  constant conversions when operating in a
    156157        //  float-based environment.
    157         m_MousePos = CVector2D((float)ev->ev.motion.x / g_GuiScale, (float)ev->ev.motion.y / g_GuiScale);
     158        m_MousePos = CVector2D((float)ev->ev.motion.x / g_);
    158159
    159160        SGUIMessage msg(GUIM_MOUSE_MOTION);
     
    180181    if (ev->ev.type == SDL_MOUSEBUTTONDOWN || ev->ev.type == SDL_MOUSEBUTTONUP)
    181182    {
    182         m_MousePos = CVector2D((float)ev->ev.button.x / g_GuiScale, (float)ev->ev.button.y / g_GuiScale);
     183        m_MousePos = CVector2D((float)ev->ev.button.x / g_);
    183184    }
    184185
     
    421422CSize2D CGUI::GetWindowSize() const
    422423{
    423     return CSize2D{static_cast<float>(g_xres) / g_GuiScale, static_cast<float>(g_yres) / g_GuiScale};
     424    return CSize2D{static_cast<float>(g_xres) / g_};
    424425}
    425426
Note: See TracChangeset for help on using the changeset viewer.