-
Notifications
You must be signed in to change notification settings - Fork 383
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
Refactor HTML: Remove unnecessary header tags, improve design, and fix layout bugs #604
base: main
Are you sure you want to change the base?
Refactor HTML: Remove unnecessary header tags, improve design, and fix layout bugs #604
Conversation
…nto enhance-inventory-html
…air/qb-inventory into enhance-inventory-html
if (this.dragStartInventoryType === "player" && targetInventoryType === "other" && isShop !== -1) { | ||
this.inventoryError(this.currentlyDraggingSlot, "player"); | ||
throw new Error("You cannot sell items to this shop."); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If player drag items from player inventory to shop inventory, currently it was swapping the items in inventory, which was confusing.
Added warning when we do this.
|
||
if (this.transferAmount === null) { | ||
if (this.firstBulkPurchase === true) { | ||
this.firstBulkPurchase = false; | ||
this.inventoryError(sourceSlot, "other", true); | ||
console.error("Purchasing items in bulk. Next time there will be no warning..."); | ||
return; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a warning for first-time users when they attempt to make a bulk purchase without specifying the amount. Some players forget to enter the amount, resulting in an unintended bulk purchase.
|
||
const sourceInventory = this.getInventoryByType("other"); | ||
const targetInventory = this.getInventoryByType("player"); | ||
const amountToTransfer = transferAmount !== null ? transferAmount : sourceItem.amount; | ||
if (sourceItem.amount < amountToTransfer) { | ||
this.inventoryError(sourceSlot, "other"); | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the amount checking condition before attempting purchase from lua.
let targetItem = targetInventory[targetSlot]; | ||
if (!targetItem || targetItem.name !== sourceItem.name) { | ||
let foundSlot = Object.keys(targetInventory).find((slot) => targetInventory[slot] && targetInventory[slot].name === sourceItem.name); | ||
if (foundSlot) { | ||
if (foundSlot && sourceItem.unique == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the item is unique, place the item in a new slot.
if (slotElement) { | ||
slotElement.style.backgroundColor = "red"; | ||
slotElement.style.backgroundColor = warning ? "yellow" : "red"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed inventoryError function to show color in correct Inventory and fixed the slot id issue.
@@ -6,7 +6,7 @@ | |||
<title>QB Inventory</title> | |||
<link rel="stylesheet" href="main.css" /> | |||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/style.css" /> | |||
<script src="https://kit.fontawesome.com/d37231be1f.js" crossorigin="anonymous"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the 403 Forbidden script.
width: 4%; | ||
width: 6%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increased width for amount field for better visibility.
.input-container input::-webkit-outer-spin-button, | ||
.input-container input::-webkit-inner-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hide the input number spinner from input field.
Description
403 Forbidden fontawesome script.
Amount overflow issue.
Checklist