Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to move up to 9999 items instead of 999 #192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/game/inventry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5071,22 +5071,23 @@ void draw_amount(int value, int inventoryWindowType)
unsigned char* windowBuffer = win_get_buf(mt_wid);

if (inventoryWindowType == INVENTORY_WINDOW_TYPE_MOVE_ITEMS) {
rect.ulx = 153;
rect.ulx = 147;
rect.uly = 45;
rect.lrx = 195;
rect.lrx = 199;
rect.lry = 69;

int ranks[3];
ranks[2] = value % 10;
ranks[1] = value / 10 % 10;
ranks[0] = value / 100 % 10;
int ranks[4];
ranks[3] = value % 10;
ranks[2] = value / 10 % 10;
ranks[1] = value / 100 % 10;
ranks[0] = value / 1000 % 10;

windowBuffer += rect.uly * windowWidth + rect.ulx;

for (int index = 0; index < 3; index++) {
for (int index = 0; index < 4; index++) {
unsigned char* src = data + 14 * ranks[index];
buf_to_buf(src, 14, 24, 336, windowBuffer, windowWidth);
windowBuffer += 14;
windowBuffer += 13;
}
} else {
rect.ulx = 133;
Expand All @@ -5113,8 +5114,8 @@ static int do_move_timer(int inventoryWindowType, Object* item, int max)
int min;
if (inventoryWindowType == INVENTORY_WINDOW_TYPE_MOVE_ITEMS) {
value = 1;
if (max > 999) {
max = 999;
if (max > 9999) {
max = 9999;
}
min = 1;
} else {
Expand Down Expand Up @@ -5180,7 +5181,7 @@ static int do_move_timer(int inventoryWindowType, Object* item, int max)
value = 0;
}

value = 10 * value % 1000 + number;
value = 10 * value % 10000 + number;
v5 = true;

draw_amount(value, inventoryWindowType);
Expand Down