mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-31 03:39:57 +02:00
Add copy-paste to the font editor
This commit is contained in:
@@ -293,7 +293,7 @@ FontEditor::FontEditor(ByteString _header):
|
||||
CharNumberAction(FontEditor *_v): v(_v) {}
|
||||
void TextChangedCallback(ui::Textbox *)
|
||||
{
|
||||
unsigned int number = v->currentCharTextbox->GetText().ToNumber<unsigned int>(true);
|
||||
unsigned int number = v->currentCharTextbox->GetText().ToNumber<unsigned int>(Format::Hex(), true);
|
||||
if(number <= 0x10FFFF)
|
||||
v->currentChar = number;
|
||||
}
|
||||
@@ -600,6 +600,14 @@ void FontEditor::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bo
|
||||
else
|
||||
ui::Engine::Ref().ConfirmExit();
|
||||
break;
|
||||
case 'c':
|
||||
clipboardWidth = fontWidths[currentChar];
|
||||
clipboardPixels = fontPixels[currentChar];
|
||||
break;
|
||||
case 'v':
|
||||
fontWidths[currentChar] = clipboardWidth;
|
||||
fontPixels[currentChar] = clipboardPixels;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -53,6 +53,9 @@ private:
|
||||
int grid;
|
||||
int rulers;
|
||||
|
||||
unsigned char clipboardWidth;
|
||||
std::array<std::array<char, MAX_WIDTH>, FONT_H> clipboardPixels;
|
||||
|
||||
void UpdateCharNumber();
|
||||
void PrevChar();
|
||||
void NextChar();
|
||||
|
Reference in New Issue
Block a user