Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLHy0424 committed Sep 7, 2024
1 parent 323ae1e commit 8ec0a36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ struct Data{
eventFlag{mouseEvent.dwEventFlags},ui{ui},argv{argv}{}
~Data(){}
};
using call=bool(*)(Data);
using callback=bool(*)(Data);
struct Text{
cstr text;
Color color;
COORD pos;
call fn;
callback fn;
void *argv;
Text():
text{},color{Color{0,0}},pos{},fn{nullptr}{}
Text(cstr text,Color color,call fn,void *argv):
Text(cstr text,Color color,callback fn,void *argv):
text{text},color{color},pos{},fn{fn},argv{argv}{}
~Text(){}
auto operator==(const COORD &mousePosition)const{
Expand Down Expand Up @@ -179,7 +179,7 @@ class CUI{
CUI():
height{},width{}{}
~CUI(){}
auto push(cstr text,call fn=nullptr,void *argv=nullptr,i16 colorHighlight=CON_BLUE,i16 colorDef=CON_WHITE)->CUI&{
auto push(cstr text,callback fn=nullptr,void *argv=nullptr,i16 colorHighlight=CON_BLUE,i16 colorDef=CON_WHITE)->CUI&{
lineData.push_back(Text{text,Color{colorDef,(fn==nullptr)?(colorDef):(colorHighlight)},fn,argv});
return *this;
}
Expand Down

0 comments on commit 8ec0a36

Please sign in to comment.