X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fcharmap.qc;h=28f67d9f5b5bd1f163f10589a754b773c1720e81;hb=1ff1288152dd20786853bed28c9d9aad1f21c8a5;hp=48e72b7bdedb588c0886795a774ee4ef4cfbdaf0;hpb=24c1f7843893c868d4bd47aa8df2c4a6be231c5d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/charmap.qc b/qcsrc/menu/xonotic/charmap.qc index 48e72b7bd..28f67d9f5 100644 --- a/qcsrc/menu/xonotic/charmap.qc +++ b/qcsrc/menu/xonotic/charmap.qc @@ -1,24 +1,6 @@ -#ifdef INTERFACE -CLASS(XonoticCharmap) EXTENDS(XonoticPicker) - METHOD(XonoticCharmap, configureXonoticCharmap, void(entity, entity)) - METHOD(XonoticCharmap, focusLeave, void(entity)) - METHOD(XonoticCharmap, resizeNotify, void(entity, vector, vector, vector, vector)) - METHOD(XonoticCharmap, keyDown, float(entity, float, float, float)) - ATTRIB(XonoticCharmap, inputBox, entity, NULL) - ATTRIB(XonoticCharmap, realFontSize, vector, '0 0 0') - - ATTRIB(XonoticCharmap, rows, float, 10) - ATTRIB(XonoticCharmap, columns, float, 14) - - METHOD(XonoticCharmap, cellSelect, void(entity, vector)) - METHOD(XonoticCharmap, cellIsValid, bool(entity, vector)) - METHOD(XonoticCharmap, cellDraw, void(entity, vector, vector, float)) - METHOD(XonoticCharmap, charOffset, vector) -ENDCLASS(XonoticCharmap) -entity makeXonoticCharmap(entity controlledInputBox); -#endif - -#ifdef IMPLEMENTATION +#include "charmap.qh" + +#include "inputbox.qh" string CHARMAP = "★◆■▮▰▬◣◤◥◢◀▲▶▼" @@ -50,7 +32,7 @@ string charmap_cellToChar(entity me, vector cell) entity makeXonoticCharmap(entity controlledInputBox) { entity me; - me = spawnXonoticCharmap(); + me = NEW(XonoticCharmap); me.configureXonoticCharmap(me, controlledInputBox); return me; } @@ -96,7 +78,11 @@ void XonoticCharmap_cellSelect(entity me, vector cell) { string character = charmap_cellToChar(me, cell); if(character != "") + { me.inputBox.enterText(me.inputBox, character); + if(me.inputBox.applyButton) + me.inputBox.applyButton.disabled = false; + } } bool XonoticCharmap_cellIsValid(entity me, vector cell) @@ -106,7 +92,7 @@ bool XonoticCharmap_cellIsValid(entity me, vector cell) return true; } -void XonoticCharmap_cellDraw(entity me, vector cell, vector cellPos, float highlightedTime) +void XonoticCharmap_cellDraw(entity me, vector cell, vector cellPos) { draw_CenterText(cellPos + me.charOffset, charmap_cellToChar(me, cell), me.realFontSize, SKINCOLOR_CHARMAP_CHAR, SKINALPHA_CHARMAP_CHAR, 0); } @@ -115,4 +101,3 @@ void XonoticCharmap_focusLeave(entity me) { me.inputBox.saveCvars(me.inputBox); } -#endif