mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-30 20:13:31 +00:00
22 lines
713 B
C++
22 lines
713 B
C++
#include "KeyOption.h"
|
|
#include <client/Minecraft.h>
|
|
|
|
KeyOption::KeyOption(Minecraft* minecraft, OptionId optId)
|
|
: Touch::TButton((int)optId, Keyboard::getKeyName(minecraft->options.getIntValue(optId))) {}
|
|
|
|
|
|
void KeyOption::mouseClicked(Minecraft* minecraft, int x, int y, int buttonNum) {
|
|
selected = isInside(x, y);
|
|
msg = (selected)? "..." : Keyboard::getKeyName(minecraft->options.getIntValue((OptionId)id));
|
|
}
|
|
|
|
void KeyOption::keyPressed(Minecraft* minecraft, int key) {
|
|
if (!selected) return;
|
|
|
|
if (key != Keyboard::KEY_ESCAPE) {
|
|
minecraft->options.set((OptionId)id, key);
|
|
}
|
|
|
|
selected = false;
|
|
msg = Keyboard::getKeyName(minecraft->options.getIntValue((OptionId)id));
|
|
} |