mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
crafting guide wip and stash for next version
This commit is contained in:
@@ -63,10 +63,6 @@ class UIItemCatBar(
|
||||
object : UIItemImageButton(
|
||||
inventoryUI,
|
||||
catIcons.get(iconIndexX, iconIndexY),
|
||||
activeBackCol = Color(0),
|
||||
backgroundCol = Color(0),
|
||||
highlightBackCol = Color(0),
|
||||
activeBackBlendMode = BlendMode.NORMAL,
|
||||
initialX = posX + iconPosX,
|
||||
initialY = posY + iconPosY,
|
||||
highlightable = true
|
||||
@@ -105,10 +101,6 @@ class UIItemCatBar(
|
||||
UIItemImageButton(
|
||||
inventoryUI,
|
||||
iconIndex[index],
|
||||
activeBackCol = Color(0),
|
||||
backgroundCol = Color(0),
|
||||
highlightBackCol = Color(0),
|
||||
activeBackBlendMode = BlendMode.NORMAL,
|
||||
initialX = iconPosX,
|
||||
initialY = posY + iconPosY,
|
||||
inactiveCol = if (index == 0 || index == 3) Color.WHITE else Color(0xffffff7f.toInt()),
|
||||
|
||||
@@ -37,6 +37,7 @@ class UIItemHorizontalFadeSlide(
|
||||
private var rightUI: UICanvas = uisOnRight.firstOrNull() ?: NullUI
|
||||
|
||||
override val uis: List<UICanvas>; get() = listOf(leftUI, centreUI, rightUI)
|
||||
val allUIs : List<UICanvas>; get() = uisOnLeft + uisOnCentre + uisOnRight
|
||||
|
||||
fun setLeftUIto(index: Int) {
|
||||
leftUI = uisOnLeft[index]
|
||||
@@ -50,38 +51,61 @@ class UIItemHorizontalFadeSlide(
|
||||
|
||||
init {
|
||||
// re-position the uis according to the initial choice of currentPosition
|
||||
uisOnLeft.forEachIndexed { index, it ->
|
||||
uisOnLeft.forEach {
|
||||
it.posX = getOffX(0)
|
||||
it.initialX = getOffX(0)
|
||||
it.opacity = getOpacity(0)
|
||||
it.posY = 0
|
||||
it.initialY = 0
|
||||
it.opacity = getOpacity(0)
|
||||
}
|
||||
uisOnCentre.forEachIndexed { index, it ->
|
||||
uisOnCentre.forEach {
|
||||
it.posX = getOffX(1)
|
||||
it.initialX = getOffX(1)
|
||||
it.opacity = getOpacity(1)
|
||||
it.posY = 0
|
||||
it.initialY = 0
|
||||
it.opacity = getOpacity(1)
|
||||
}
|
||||
uisOnRight.forEachIndexed { index, it ->
|
||||
uisOnRight.forEach {
|
||||
it.posX = getOffX(2)
|
||||
it.initialX = getOffX(2)
|
||||
it.opacity = getOpacity(2)
|
||||
it.posY = 0
|
||||
it.initialY = 0
|
||||
it.opacity = getOpacity(2)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTransition(currentPosition: Float, uis: List<UICanvas>) {
|
||||
uis.forEachIndexed { index, it ->
|
||||
it.posX = getOffX(index)
|
||||
override fun onTransition(currentPosition: Float) {
|
||||
uisOnLeft.forEach {
|
||||
it.posX = getOffX(0)
|
||||
it.opacity = getOpacity(0)
|
||||
it.posY = it.initialY
|
||||
it.opacity = getOpacity(index)
|
||||
}
|
||||
uisOnCentre.forEach {
|
||||
it.posX = getOffX(1)
|
||||
it.opacity = getOpacity(1)
|
||||
it.posY = it.initialY
|
||||
}
|
||||
uisOnRight.forEach {
|
||||
it.posX = getOffX(2)
|
||||
it.opacity = getOpacity(2)
|
||||
it.posY = it.initialY
|
||||
}
|
||||
|
||||
INGAME.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
override fun show() {
|
||||
uisOnLeft.forEach { it.show() }
|
||||
uisOnCentre.forEach { it.show() }
|
||||
uisOnRight.forEach { it.show() }
|
||||
}
|
||||
|
||||
override fun hide() {
|
||||
uisOnLeft.forEach { it.hide() }
|
||||
uisOnCentre.forEach { it.hide() }
|
||||
uisOnRight.forEach { it.hide() }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
uisOnLeft.forEach { it.tryDispose() }
|
||||
uisOnCentre.forEach { it.tryDispose() }
|
||||
|
||||
@@ -19,18 +19,18 @@ open class UIItemImageButton(
|
||||
/** Colour when mouse is over */
|
||||
val activeCol: Color = Toolkit.Theme.COL_MOUSE_UP,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_ACTIVECOL,
|
||||
val activeBackCol: Color = Color(0),//UIItemTextButtonList.DEFAULT_BACKGROUND_ACTIVECOL,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackBlendMode: String = BlendMode.NORMAL,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightCol: Color = Toolkit.Theme.COL_SELECTED,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_HIGHLIGHTCOL,
|
||||
val highlightBackCol: Color = Color(0),//UIItemTextButtonList.DEFAULT_BACKGROUND_HIGHLIGHTCOL,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightBackBlendMode: String = BlendMode.NORMAL,
|
||||
/** Colour on normal status */
|
||||
val inactiveCol: Color = Toolkit.Theme.COL_LIST_DEFAULT,
|
||||
val backgroundCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUNDCOL,
|
||||
val backgroundCol: Color = Color(0),//UIItemTextButtonList.DEFAULT_BACKGROUNDCOL,
|
||||
val backgroundBlendMode: String = BlendMode.NORMAL,
|
||||
|
||||
initialX: Int,
|
||||
|
||||
@@ -46,7 +46,7 @@ open class UIItemTransitionContainer(
|
||||
transitionRequested = false
|
||||
transitionTimer = 0f
|
||||
currentPosition = target.toFloat()
|
||||
onTransition(currentPosition, uis)
|
||||
onTransition(currentPosition)
|
||||
}
|
||||
|
||||
override fun update(delta: Float) {
|
||||
@@ -54,7 +54,7 @@ open class UIItemTransitionContainer(
|
||||
uis.forEachIndexed { index, ui -> if (timeToUpdate(index)) ui.update(delta) }
|
||||
}
|
||||
|
||||
open fun onTransition(currentPosition: Float, uis: List<UICanvas>) {}
|
||||
open fun onTransition(currentPosition: Float) {}
|
||||
|
||||
open val currentUI: UICanvas
|
||||
get() = uis[currentPosition.roundToInt()]
|
||||
@@ -78,7 +78,7 @@ open class UIItemTransitionContainer(
|
||||
currentPosition = transitionReqTarget
|
||||
}
|
||||
|
||||
onTransition(currentPosition, uis)
|
||||
onTransition(currentPosition)
|
||||
}
|
||||
|
||||
uis.forEachIndexed { index, ui ->
|
||||
|
||||
Reference in New Issue
Block a user