Commit 02121635 authored by nanahira's avatar nanahira

Revert "drag cardtext"

This reverts commit fd4c3855.
parent 26991ae0
...@@ -132,9 +132,6 @@ public: ...@@ -132,9 +132,6 @@ public:
void RefreshCardCountDisplay(); void RefreshCardCountDisplay();
irr::gui::IGUIElement* panel{ nullptr }; irr::gui::IGUIElement* panel{ nullptr };
bool is_dragging_cardtext{ false };
int dragging_cardtext_start_pos{ 0 };
int dragging_cardtext_start_y{ 0 };
std::vector<int> ancard; std::vector<int> ancard;
int hovered_controler{ 0 }; int hovered_controler{ 0 };
int hovered_location{ 0 }; int hovered_location{ 0 };
......
...@@ -2137,46 +2137,6 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2137,46 +2137,6 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
} }
break; break;
} }
case irr::EET_MOUSE_INPUT_EVENT: {
switch(event.MouseInput.Event) {
case irr::EMIE_LMOUSE_PRESSED_DOWN: {
IGUIElement* root = mainGame->env->getRootGUIElement();
position2di mousepos = position2di(event.MouseInput.X, event.MouseInput.Y);
if(root->getElementFromPoint(mousepos) == mainGame->stText) {
if(!mainGame->scrCardText->isVisible()) {
break;
}
is_dragging_cardtext = true;
dragging_cardtext_start_pos = mainGame->scrCardText->getPos();
dragging_cardtext_start_y = event.MouseInput.Y;
return true;
}
break;
}
case irr::EMIE_LMOUSE_LEFT_UP: {
is_dragging_cardtext = false;
break;
}
case irr::EMIE_MOUSE_MOVED: {
if(is_dragging_cardtext) {
if(!mainGame->scrCardText->isVisible()) {
is_dragging_cardtext = false;
break;
}
int step = mainGame->guiFont->getDimension(L"A").Height + mainGame->guiFont->getKerningHeight();
int pos = dragging_cardtext_start_pos + (dragging_cardtext_start_y - event.MouseInput.Y) / step;
int max = mainGame->scrCardText->getMax();
if(pos < 0) pos = 0;
if(pos > max) pos = max;
mainGame->scrCardText->setPos(pos);
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->guiFont, mainGame->showingtext, pos);
}
break;
}
default: break;
}
break;
}
default: break; default: break;
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment