revert b17ef7f938
(couldn't figure out better fix for the new PSTN bug), fix annoyance with clicking on save comments changing pages
This commit is contained in:
parent
02a4c17d72
commit
ba43e4d238
@ -384,13 +384,17 @@ void PreviewView::OnMouseWheel(int x, int y, int d)
|
|||||||
|
|
||||||
void PreviewView::OnMouseUp(int x, int y, unsigned int button)
|
void PreviewView::OnMouseUp(int x, int y, unsigned int button)
|
||||||
{
|
{
|
||||||
if(commentsPanel->GetScrollLimit() == 1)
|
//if mouse is on the scrollwheel or farther right, and you are at the top of bottom of a page, change pages
|
||||||
|
if (x > Position.X+commentsPanel->Position.X+commentsPanel->Size.X-6)
|
||||||
|
{
|
||||||
|
if (commentsPanel->GetScrollLimit() == 1)
|
||||||
c->NextCommentPage();
|
c->NextCommentPage();
|
||||||
if(commentsPanel->GetScrollLimit() == -1)
|
if (commentsPanel->GetScrollLimit() == -1)
|
||||||
{
|
{
|
||||||
if (c->PrevCommentPage())
|
if (c->PrevCommentPage())
|
||||||
prevPage = true;
|
prevPage = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
|
void PreviewView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
|
||||||
|
@ -167,7 +167,7 @@ int Element_PSTN::update(UPDATE_FUNC_ARGS)
|
|||||||
//#TPT-Directive ElementHeader Element_PSTN static int CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
|
//#TPT-Directive ElementHeader Element_PSTN static int CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
|
||||||
int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
|
int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
|
||||||
{
|
{
|
||||||
int posX, posY, r, spaces = 0, currentPos = 0, num = 0;
|
int posX, posY, r, spaces = 0, currentPos = 0;
|
||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
for(posX = stackX, posY = stackY; currentPos < maxSize + amount && currentPos < XRES-1; posX += directionX, posY += directionY) {
|
for(posX = stackX, posY = stackY; currentPos < maxSize + amount && currentPos < XRES-1; posX += directionX, posY += directionY) {
|
||||||
@ -176,7 +176,7 @@ int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int dir
|
|||||||
}
|
}
|
||||||
r = sim->pmap[posY][posX];
|
r = sim->pmap[posY][posX];
|
||||||
if (sim->IsWallBlocking(posX, posY, 0) || (block && (r&0xFF) == block))
|
if (sim->IsWallBlocking(posX, posY, 0) || (block && (r&0xFF) == block))
|
||||||
return num;
|
return spaces;
|
||||||
if(!r) {
|
if(!r) {
|
||||||
spaces++;
|
spaces++;
|
||||||
tempParts[currentPos++] = -1;
|
tempParts[currentPos++] = -1;
|
||||||
@ -186,9 +186,8 @@ int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int dir
|
|||||||
if(spaces < maxSize && currentPos < maxSize && (!retract || ((r&0xFF) == PT_FRME) && posX == stackX && posY == stackY))
|
if(spaces < maxSize && currentPos < maxSize && (!retract || ((r&0xFF) == PT_FRME) && posX == stackX && posY == stackY))
|
||||||
tempParts[currentPos++] = r>>8;
|
tempParts[currentPos++] = r>>8;
|
||||||
else
|
else
|
||||||
return num;
|
return spaces;
|
||||||
}
|
}
|
||||||
num++;
|
|
||||||
}
|
}
|
||||||
if (spaces)
|
if (spaces)
|
||||||
return currentPos;
|
return currentPos;
|
||||||
|
Loading…
Reference in New Issue
Block a user