Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
charmap.qc File Reference
#include "charmap.qh"
#include "inputbox.qh"
Include dependency graph for charmap.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string charmap_cellToChar (entity me, vector cell)
entity makeXonoticCharmap (entity controlledInputBox)
void XonoticCharmap_cellDraw (entity me, vector cell, vector cellPos)
bool XonoticCharmap_cellIsValid (entity me, vector cell)
void XonoticCharmap_cellSelect (entity me, vector cell)
void XonoticCharmap_configureXonoticCharmap (entity me, entity controlledInputBox)
void XonoticCharmap_focusLeave (entity me)
float XonoticCharmap_keyDown (entity me, float key, float ascii, float shift)
void XonoticCharmap_resizeNotify (entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)

Variables

string CHARMAP

Function Documentation

◆ charmap_cellToChar()

string charmap_cellToChar ( entity me,
vector cell )

Definition at line 22 of file charmap.qc.

23{
24 string character = substring(CHARMAP, cell.y * me.columns + cell.x, 1);
25
26 if(character != " ")
27 return character;
28 else
29 return "";
30}
string CHARMAP
Definition charmap.qc:5
string substring(string s, float start, float length)

References CHARMAP, entity(), substring(), and vector.

Referenced by XonoticCharmap_cellDraw(), XonoticCharmap_cellIsValid(), and XonoticCharmap_cellSelect().

◆ makeXonoticCharmap()

entity makeXonoticCharmap ( entity controlledInputBox)

Definition at line 32 of file charmap.qc.

33{
35 me.configureXonoticCharmap(me, controlledInputBox);
36 return me;
37}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticFirstRunDialog_fill(), and XonoticProfileTab_fill().

◆ XonoticCharmap_cellDraw()

void XonoticCharmap_cellDraw ( entity me,
vector cell,
vector cellPos )

Definition at line 94 of file charmap.qc.

95{
96 draw_CenterText(cellPos + me.charOffset, charmap_cellToChar(me, cell), me.realFontSize, SKINCOLOR_CHARMAP_CHAR, SKINALPHA_CHARMAP_CHAR, 0);
97}
string charmap_cellToChar(entity me, vector cell)
Definition charmap.qc:22
void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
Definition draw.qc:298

References charmap_cellToChar(), draw_CenterText(), entity(), and vector.

◆ XonoticCharmap_cellIsValid()

bool XonoticCharmap_cellIsValid ( entity me,
vector cell )

Definition at line 87 of file charmap.qc.

88{
89 if(charmap_cellToChar(me, cell) == "")
90 return false;
91 return true;
92}

References charmap_cellToChar(), entity(), and vector.

◆ XonoticCharmap_cellSelect()

void XonoticCharmap_cellSelect ( entity me,
vector cell )

Definition at line 76 of file charmap.qc.

77{
78 string character = charmap_cellToChar(me, cell);
79 if(character != "")
80 {
81 me.inputBox.enterText(me.inputBox, character);
82 if(me.inputBox.applyButton)
83 me.inputBox.applyButton.disabled = false;
84 }
85}

References charmap_cellToChar(), entity(), and vector.

◆ XonoticCharmap_configureXonoticCharmap()

void XonoticCharmap_configureXonoticCharmap ( entity me,
entity controlledInputBox )

Definition at line 39 of file charmap.qc.

40{
41 me.inputBox = controlledInputBox;
42 me.configureXonoticPicker(me);
43}

References entity().

◆ XonoticCharmap_focusLeave()

void XonoticCharmap_focusLeave ( entity me)

Definition at line 99 of file charmap.qc.

100{
101 me.inputBox.saveCvars(me.inputBox);
102}

References entity().

◆ XonoticCharmap_keyDown()

float XonoticCharmap_keyDown ( entity me,
float key,
float ascii,
float shift )

Definition at line 69 of file charmap.qc.

70{
71 if(SUPER(XonoticCharmap).keyDown(me, key, ascii, shift))
72 return 1;
73 return me.inputBox.keyDown(me.inputBox, key, ascii, shift);
74}
#define SUPER(cname)
Definition oo.qh:231

References entity(), and SUPER.

◆ XonoticCharmap_resizeNotify()

void XonoticCharmap_resizeNotify ( entity me,
vector relOrigin,
vector relSize,
vector absOrigin,
vector absSize )

Definition at line 45 of file charmap.qc.

46{
47 SUPER(XonoticCharmap).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
48
49 float maxFontWidth = SKINFONTSIZE_NORMAL / absSize.x;
50 float maxFontHeight = SKINFONTSIZE_NORMAL / absSize.y;
51
52 if((me.realCellSize.x * absSize.x) > (me.realCellSize.y * absSize.y))
53 {
54 me.realFontSize_x = me.realCellSize.y * absSize.y / absSize.x;
55 me.realFontSize_y = me.realCellSize.y;
56 }
57 else
58 {
59 me.realFontSize_x = me.realCellSize.x;
60 me.realFontSize_y = me.realCellSize.x * absSize.x / absSize.y;
61 }
62
63 if(me.realFontSize.x > maxFontWidth || me.realFontSize.y > maxFontHeight)
64 me.realFontSize = eX * maxFontWidth + eY * maxFontHeight;
65
66 me.charOffset = eX * me.realCellSize.x / 2 + eY * ((me.realCellSize.y - me.realFontSize.y) / 2);
67}
const vector eY
Definition vector.qh:45
const vector eX
Definition vector.qh:44

References entity(), eX, eY, SUPER, and vector.

Variable Documentation

◆ CHARMAP

string CHARMAP
Initial value:
=
"★◆■▮▰▬◣◤◥◢◀▲▶▼"
"🌍🌎🌏🚀🌌👽🔫⌖❇❈←↑→↓"
"☠☣☢⚛⚡⚙🔥❌⚠⛔❰❱❲❳"
"😃😊😁😄😆😎😈😇😉😛😝😘❤ "
"😐😒😕😮😲😞😟😠😣😭😵😴 "
"\xEE\x83\xA1\xEE\x83\xA2\xEE\x83\xA3\xEE\x83\xA4\xEE\x83\xA5\xEE\x83\xA6\xEE\x83\xA7"
"\xEE\x83\xA8\xEE\x83\xA9\xEE\x83\xAA\xEE\x83\xAB\xEE\x83\xAC\xEE\x83\xAD\xEE\x83\xAE"
"\xEE\x83\xAF\xEE\x83\xB0\xEE\x83\xB1\xEE\x83\xB2\xEE\x83\xB3\xEE\x83\xB4\xEE\x83\xB5"
"\xEE\x83\xB6\xEE\x83\xB7\xEE\x83\xB8\xEE\x83\xB9\xEE\x83\xBA\xEE\x80\x90\xEE\x80\x91"
"\xEE\x82\xB0\xEE\x82\xB1\xEE\x82\xB2\xEE\x82\xB3\xEE\x82\xB4\xEE\x82\xB5\xEE\x82\xB6"
"\xEE\x82\xB7\xEE\x82\xB8\xEE\x82\xB9\xEE\x82\xA1\xEE\x82\xBF\xEE\x82\xA6\xEE\x82\xA5"
"\xEE\x83\x81\xEE\x83\x82\xEE\x83\x83\xEE\x83\x84\xEE\x83\x85\xEE\x83\x86\xEE\x83\x87"
"\xEE\x83\x88\xEE\x83\x89\xEE\x83\x8A\xEE\x83\x8B\xEE\x83\x8C\xEE\x83\x8D\xEE\x83\x8E"
"\xEE\x83\x8F\xEE\x83\x90\xEE\x83\x91\xEE\x83\x92\xEE\x83\x93\xEE\x83\x94\xEE\x83\x95"
"\xEE\x83\x96\xEE\x83\x97\xEE\x83\x98\xEE\x83\x99\xEE\x83\x9A\xEE\x81\x9B\xEE\x81\x9D"

Definition at line 5 of file charmap.qc.

Referenced by charmap_cellToChar().