mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
uicrafting: reset scroll when opening
This commit is contained in:
@@ -22,7 +22,7 @@ object Calculate {
|
|||||||
* TODO Newtons as unit?
|
* TODO Newtons as unit?
|
||||||
*/
|
*/
|
||||||
@JvmStatic fun pickaxePower(actor: ActorWithBody, material: Material?): Float {
|
@JvmStatic fun pickaxePower(actor: ActorWithBody, material: Material?): Float {
|
||||||
return (4.0 * (material?.forceMod?.toDouble() ?: 0.15) * (actor.avStrength / 1000.0)).toFloat()
|
return (6.0 * (material?.forceMod?.toDouble() ?: 0.15) * (actor.avStrength / 1000.0)).toFloat()
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic fun hatchetPower(actor: ActorWithBody, material: Material?): Float {
|
@JvmStatic fun hatchetPower(actor: ActorWithBody, material: Material?): Float {
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class ActorInventory() : FixtureInventory() {
|
|||||||
val swingDmgToFrameDmg = App.UPDATE_RATE.toDouble() / actor.actorValue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
val swingDmgToFrameDmg = App.UPDATE_RATE.toDouble() / actor.actorValue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
||||||
|
|
||||||
// damage the item
|
// damage the item
|
||||||
newItem.durability -= (baseDamagePerSwing * swingDmgToFrameDmg).toFloat()
|
newItem.durability -= (baseDamagePerSwing * swingDmgToFrameDmg / 1.5f).toFloat()
|
||||||
if (newItem.durability <= 0) {
|
if (newItem.durability <= 0) {
|
||||||
remove(newItem, 1)
|
remove(newItem, 1)
|
||||||
|
|
||||||
|
|||||||
@@ -356,6 +356,7 @@ class UICrafting(val full: UIInventoryFull?) : UICanvas(
|
|||||||
fun resetUI() {
|
fun resetUI() {
|
||||||
// reset spinner
|
// reset spinner
|
||||||
resetSpinner()
|
resetSpinner()
|
||||||
|
|
||||||
// reset selected recipe status
|
// reset selected recipe status
|
||||||
recipeClicked = null
|
recipeClicked = null
|
||||||
filterPlayerListUsing(recipeClicked)
|
filterPlayerListUsing(recipeClicked)
|
||||||
@@ -364,6 +365,10 @@ class UICrafting(val full: UIInventoryFull?) : UICanvas(
|
|||||||
playerThings.removeFromForceHighlightList(oldSelectedItems)
|
playerThings.removeFromForceHighlightList(oldSelectedItems)
|
||||||
itemListIngredients.rebuild(FILTER_CAT_ALL)
|
itemListIngredients.rebuild(FILTER_CAT_ALL)
|
||||||
|
|
||||||
|
// reset scroll
|
||||||
|
itemListCraftable.itemPage = 0
|
||||||
|
playerThings.itemList.itemPage = 0
|
||||||
|
|
||||||
refreshCraftButtonStatus()
|
refreshCraftButtonStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user