Added any keybind detection to PGE and began implementing menu helper innterfaces

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
Nic0Nic0Nii
2024-02-05 21:30:27 +00:00
co-authored by AMay
parent d576e6143e
commit ef63a07f5c
13 changed files with 140 additions and 38 deletions
@@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Portions of this software are copyright � 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
@@ -39,8 +39,12 @@ All rights reserved.
#include "Menu.h"
#include "MenuLabel.h"
using A=Attribute;
void Menu::InitializeNewKeybindInputWindow(){
Menu*newKeybindWindow=CreateMenu(NEW_INPUT,CENTERED,vf2d{192,96});
newKeybindWindow->ADD("New Keybind Label",MenuLabel)(geom2d::rect<float>{{0.f,24.f},{192.f,24.f}},"Press a new key for {}",2.f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END;
newKeybindWindow->B(A::IS_KEYBOARD)=true;
newKeybindWindow->S(A::KEYBIND)="";
newKeybindWindow->ADD("New Keybind Label",MenuLabel)(geom2d::rect<float>{{0.f,24.f},{192.f,96.f}},"Press a new key for '{}'\n\nPress Esc to cancel.",1.5f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END;
}