Skip to content

Commit

Permalink
Merge pull request s00500#163 from iangray001/master
Browse files Browse the repository at this point in the history
Fix for s00500#162
  • Loading branch information
iangray001 authored Feb 26, 2022
2 parents e3e5c34 + ab5ac2d commit a958feb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
47 changes: 24 additions & 23 deletions data/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,29 +650,30 @@ function buttonclick(number, isdown) {
}

function padclick(type, number, isdown) {
if(!$("#id" + number + " nav").hasClass("disabled")) {
switch (type) {
case CENTER:
if (isdown) websock.send("pcdown:" + number);
else websock.send("pcup:" + number);
break;
case UP:
if (isdown) websock.send("pfdown:" + number);
else websock.send("pfup:" + number);
break;
case DOWN:
if (isdown) websock.send("pbdown:" + number);
else websock.send("pbup:" + number);
break;
case LEFT:
if (isdown) websock.send("pldown:" + number);
else websock.send("plup:" + number);
break;
case RIGHT:
if (isdown) websock.send("prdown:" + number);
else websock.send("prup:" + number);
break;
}
if($("#id" + number + " nav").hasClass("disabled")) {
return;
}
switch (type) {
case CENTER:
if (isdown) websock.send("pcdown:" + number);
else websock.send("pcup:" + number);
break;
case UP:
if (isdown) websock.send("pfdown:" + number);
else websock.send("pfup:" + number);
break;
case DOWN:
if (isdown) websock.send("pbdown:" + number);
else websock.send("pbup:" + number);
break;
case LEFT:
if (isdown) websock.send("pldown:" + number);
else websock.send("plup:" + number);
break;
case RIGHT:
if (isdown) websock.send("prdown:" + number);
else websock.send("prup:" + number);
break;
}
}

Expand Down
3 changes: 2 additions & 1 deletion data/js/controls.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/ESPUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ void ESPUIClass::updateControl(Control* control, int clientId)
// function like this and it's clients array is private
int tryId = 0;

for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();)
for (size_t count = 0; count < this->ws->count();)
{
if (this->ws->hasClient(tryId))
{
Expand Down Expand Up @@ -1014,7 +1014,7 @@ void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId)
// function like this and it's clients array is private
int tryId = 0;

for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();)
for (size_t count = 0; count < this->ws->count();)
{
if (this->ws->hasClient(tryId))
{
Expand Down
1 change: 1 addition & 0 deletions src/ESPUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class Control
visible(visible),
wide(false),
vertical(false),
enabled(true),
parentControl(parentControl),
next(nullptr)
{
Expand Down

0 comments on commit a958feb

Please sign in to comment.