Closed rsn8887 closed 5 years ago
Doesn't compile. Remove the || charflag
SourceX/miniwin/misc_msg.cpp:193:20: error: 'charflag' was not declared in this scope
if (invflag || charflag) {
^~~~~~~~
SourceX/miniwin/misc_msg.cpp:193:20: note: suggested alternative: 'chrflag'
if (invflag || charflag) {
^~~~~~~~
chrflag
make: *** [makefile:302: obj/misc_msg.o] Error 1
Also, I just noticed that if the d-pad buttons are pressed while the quest log is open, it will move your character around.
We will need to add another conditional check for if the quest log flag is true (questlog)
to return in the walkInDir
function.
Thanks.
When in a dialog with a townsperson, the dpad moves dialog selection but also moves the character by the way. So there are more controls fixes required than just this.
Should be fixed now, thanks again.
In plrctrls.cpp at line 574 try changing
} else if (chrflag) {
if (ticks - statuptimer >= 400) {
statuptimer = ticks;
for (int i = 0; i < 4; i++) {
if (MouseX >= attribute_inc_rects2[i][0]
&& MouseX <= attribute_inc_rects2[i][0] + attribute_inc_rects2[i][2]
&& MouseY >= attribute_inc_rects2[i][1]
&& MouseY <= attribute_inc_rects2[i][3] + attribute_inc_rects2[i][1]) {
chrbtn[i] = 1;
chrbtnactive = TRUE;
ReleaseChrBtns();
}
}
}
}
to
} else if (chrflag) {
if (ticks - statuptimer >= 400) {
statuptimer = ticks;
CheckChrBtns();
}
}
This needs to be tested, I am only guessing.
Ok I made the change (needs testing).
Please wait on the merge till testing is done. I will test this later tonight.
@rsn8887 In the file plrctrls.cpp in function keyboardExpansion() line 571 this section needs to be replaced:
} else if (chrflag) {
if (ticks - statuptimer >= 400) {
statuptimer = ticks;
if (!chrbtnactive && plr[myplr]._pStatPts) {
CheckChrBtns();
for (int i = 0; i < 4; i++) {
if (MouseX >= attribute_inc_rects2[i][0]
&& MouseX <= attribute_inc_rects2[i][0] + attribute_inc_rects2[i][2]
&& MouseY >= attribute_inc_rects2[i][1]
&& MouseY <= attribute_inc_rects2[i][3] + attribute_inc_rects2[i][1]) {
chrbtn[i] = 1;
chrbtnactive = TRUE;
ReleaseChrBtns();
}
}
}
if (plr[myplr]._pStatPts == 0)
HideCursor();
}
}
In the diablo.cpp file on line 1361 case 'c':
this section needs to be replaced with
if(!stextflag) {
questlog = FALSE;
chrflag = chrflag == 0;
if (newCurHidden) {
SetCursor_(CURSOR_HAND);
newCurHidden = false;
}
if(!chrflag || invflag) {
if(MouseX > 160 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX - 160, MouseY);
MouseX = MouseX - 160;
MouseY = MouseY;
}
} else {
if (!chrbtnactive && plr[myplr]._pStatPts) {
int x = attribute_inc_rects2[0][0] + (attribute_inc_rects2[0][2] / 2);
int y = attribute_inc_rects2[0][1] + (attribute_inc_rects2[0][3] / 2);
SetCursorPos(x, y);
MouseX = x;
MouseY = y;
} else {
if(MouseX < 480 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX + 160, MouseY);
MouseX = MouseX + 160;
MouseY = MouseY;
}
}
}
}
return;
This should make it so that when you open char info it will automatically snap to the first button, when you use up all the skill points the cursor will disappear and the "+LEVEL UP" icon will disappear as well. I tested this on my end and it worked, so when you make the commit let me know and I'll test it on your code.
Ok I made the changes. Ready to test. I will test it now.
Ok I fixed the right click action in inventory, too.
All seems to work now.
looks good here too. merged
Closes #12 Closes #13 Closes #14