mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
renaming Toolkit.Theme colour variables
This commit is contained in:
@@ -23,8 +23,8 @@ object Toolkit : Disposable {
|
||||
|
||||
val COL_LIST_DEFAULT = Color.WHITE
|
||||
val COL_INACTIVE = Color.LIGHT_GRAY
|
||||
val COL_ACTIVE = Color(0xfff066_ff.toInt()) // yellow
|
||||
val COL_HIGHLIGHT = Color(0x00f8ff_ff) // cyan
|
||||
val COL_SELECTED = Color(0x00f8ff_ff) // cyan, HIGHLY SATURATED
|
||||
val COL_MOUSE_UP = Color(0xfff066_ff.toInt()) // yellow (all yellows are of low saturation according to the colour science)
|
||||
val COL_DISABLED = Color(0xaaaaaaff.toInt())
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ open class UIItemImageButton(
|
||||
var image: TextureRegion,
|
||||
|
||||
/** Colour when mouse is over */
|
||||
val activeCol: Color = Toolkit.Theme.COL_ACTIVE,
|
||||
val activeCol: Color = Toolkit.Theme.COL_MOUSE_UP,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_ACTIVECOL,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackBlendMode: String = BlendMode.NORMAL,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightCol: Color = Toolkit.Theme.COL_HIGHLIGHT,
|
||||
val highlightCol: Color = Toolkit.Theme.COL_SELECTED,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_HIGHLIGHTCOL,
|
||||
/** Colour when clicked/selected */
|
||||
|
||||
@@ -79,7 +79,7 @@ class UIItemInlineRadioButtons(
|
||||
// mouseover borders and text
|
||||
if (mouseOnSelection > -1 && mouseOnSelection != selection) {
|
||||
val xpos = getCellX(mouseOnSelection)
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, xpos - 1, posY - 1, cellWidth + 2, height + 2)
|
||||
val text = labelfuns[mouseOnSelection]()
|
||||
val tw = App.fontGame.getWidth(text)
|
||||
@@ -88,7 +88,7 @@ class UIItemInlineRadioButtons(
|
||||
|
||||
// selection borders and text
|
||||
val xpos = getCellX(selection)
|
||||
batch.color = Toolkit.Theme.COL_HIGHLIGHT
|
||||
batch.color = Toolkit.Theme.COL_SELECTED
|
||||
Toolkit.drawBoxBorder(batch, xpos - 1, posY - 1, cellWidth + 2, height + 2)
|
||||
val text = labelfuns[selection]()
|
||||
val tw = App.fontGame.getWidth(text)
|
||||
|
||||
@@ -22,10 +22,10 @@ class UIItemList<Item: UIItem>(
|
||||
val defaultSelection: Int? = null, // negative: INVALID, positive: valid, null: no select
|
||||
|
||||
// copied directly from UIItemTextButton
|
||||
val activeCol: Color = Toolkit.Theme.COL_ACTIVE,
|
||||
val activeCol: Color = Toolkit.Theme.COL_MOUSE_UP,
|
||||
val activeBackCol: Color = Color(0),
|
||||
val activeBackBlendMode: String = BlendMode.NORMAL,
|
||||
val highlightCol: Color = Toolkit.Theme.COL_HIGHLIGHT,
|
||||
val highlightCol: Color = Toolkit.Theme.COL_SELECTED,
|
||||
val highlightBackCol: Color = Color(0xb0b0b0_ff.toInt()),
|
||||
val highlightBackBlendMode: String = BlendMode.MULTIPLY,
|
||||
val inactiveCol: Color = Toolkit.Theme.COL_INACTIVE,
|
||||
|
||||
@@ -125,30 +125,30 @@ class UIItemSpinner(
|
||||
}
|
||||
|
||||
// left button border
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_ACTIVE else Toolkit.Theme.COL_INACTIVE
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_INACTIVE
|
||||
Toolkit.drawBoxBorder(batch, posX - 1, posY - 1, buttonW + 2, height + 2)
|
||||
|
||||
// right button border
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_ACTIVE else Toolkit.Theme.COL_INACTIVE
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_INACTIVE
|
||||
Toolkit.drawBoxBorder(batch, posX + width - buttonW - 1, posY - 1, buttonW + 2, height + 2)
|
||||
|
||||
// text area border (again)
|
||||
if (mouseOnButton == 3) {
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, posX + buttonW + 2, posY - 1, width - 2*buttonW - 4, height + 2)
|
||||
}
|
||||
}
|
||||
|
||||
// left button icon
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_ACTIVE else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_MOUSE_UP else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.draw(labels.get(9,2), posX + (buttonW - labels.tileW) / 2f, posY + (height - labels.tileH) / 2f)
|
||||
|
||||
// right button icon
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_ACTIVE else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_MOUSE_UP else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.draw(labels.get(10,2), posX + width - buttonW + (buttonW - labels.tileW) / 2f, posY + (height - labels.tileH) / 2f)
|
||||
|
||||
// draw text
|
||||
|
||||
@@ -23,13 +23,13 @@ open class UIItemTextButton(
|
||||
val readFromLang: Boolean = false,
|
||||
|
||||
/** Colour when mouse is over */
|
||||
val activeCol: Color = Toolkit.Theme.COL_ACTIVE,
|
||||
val activeCol: Color = Toolkit.Theme.COL_MOUSE_UP,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_ACTIVECOL,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackBlendMode: String = BlendMode.NORMAL,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightCol: Color = Toolkit.Theme.COL_HIGHLIGHT,
|
||||
val highlightCol: Color = Toolkit.Theme.COL_SELECTED,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_HIGHLIGHTCOL,
|
||||
/** Colour when clicked/selected */
|
||||
|
||||
@@ -31,13 +31,13 @@ class UIItemTextButtonList(
|
||||
|
||||
// copied directly from UIItemTextButton
|
||||
/** Colour when mouse is over */
|
||||
val activeCol: Color = Toolkit.Theme.COL_ACTIVE,
|
||||
val activeCol: Color = Toolkit.Theme.COL_MOUSE_UP,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_ACTIVECOL,
|
||||
/** Colour when mouse is over */
|
||||
val activeBackBlendMode: String = BlendMode.NORMAL,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightCol: Color = Toolkit.Theme.COL_HIGHLIGHT,
|
||||
val highlightCol: Color = Toolkit.Theme.COL_SELECTED,
|
||||
/** Colour when clicked/selected */
|
||||
val highlightBackCol: Color = UIItemTextButtonList.DEFAULT_BACKGROUND_HIGHLIGHTCOL,
|
||||
/** Colour when clicked/selected */
|
||||
|
||||
@@ -519,21 +519,21 @@ class UIItemTextLineInput(
|
||||
|
||||
// text area border (pop-up for isActive)
|
||||
if (isActive) {
|
||||
batch.color = Toolkit.Theme.COL_HIGHLIGHT
|
||||
batch.color = Toolkit.Theme.COL_SELECTED
|
||||
Toolkit.drawBoxBorder(batch, posX - 1, posY - 1, width + 2, height + 2) // this is a full border, not a text area
|
||||
}
|
||||
|
||||
// button border
|
||||
if (mouseUpOnPasteButton) {
|
||||
batch.color = if (mouseDown) Toolkit.Theme.COL_HIGHLIGHT else Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = if (mouseDown) Toolkit.Theme.COL_SELECTED else Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, btn2PosX - 1, posY - 1, WIDTH_ONEBUTTON + 2, height + 2)
|
||||
}
|
||||
else if (mouseUpOnIMEButton) {
|
||||
batch.color = if (mouseDown) Toolkit.Theme.COL_HIGHLIGHT else Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = if (mouseDown) Toolkit.Theme.COL_SELECTED else Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, btn1PosX - 1, posY - 1, WIDTH_ONEBUTTON + 2, height + 2)
|
||||
}
|
||||
else if (mouseUpOnTextArea && !isActive) {
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, inputPosX - 1, posY - 1, fbo.width + 2 * UI_TEXT_MARGIN+ 2, height + 2)
|
||||
}
|
||||
|
||||
@@ -558,10 +558,10 @@ class UIItemTextLineInput(
|
||||
|
||||
// draw icon
|
||||
// IME button
|
||||
batch.color = if (mouseUpOnIMEButton && mouseDown || imeOn) Toolkit.Theme.COL_ACTIVE else if (mouseUpOnIMEButton) Toolkit.Theme.COL_HIGHLIGHT else Toolkit.Theme.COL_INACTIVE
|
||||
batch.color = if (mouseUpOnIMEButton && mouseDown || imeOn) Toolkit.Theme.COL_MOUSE_UP else if (mouseUpOnIMEButton) Toolkit.Theme.COL_SELECTED else Toolkit.Theme.COL_INACTIVE
|
||||
batch.draw(imeButton, btn1PosX + 2f, posY + 2f)
|
||||
// paste button
|
||||
batch.color = if (mouseUpOnPasteButton && mouseDown) Toolkit.Theme.COL_ACTIVE else if (mouseUpOnPasteButton) Toolkit.Theme.COL_HIGHLIGHT else Toolkit.Theme.COL_INACTIVE
|
||||
batch.color = if (mouseUpOnPasteButton && mouseDown) Toolkit.Theme.COL_MOUSE_UP else if (mouseUpOnPasteButton) Toolkit.Theme.COL_SELECTED else Toolkit.Theme.COL_INACTIVE
|
||||
batch.draw(labels.get(8,2), btn2PosX + 2f, posY + 2f)
|
||||
|
||||
// state of the candidates are concurrently changing, so we buffer them
|
||||
@@ -588,7 +588,7 @@ class UIItemTextLineInput(
|
||||
batch.color = candidatesBackCol
|
||||
Toolkit.fillArea(batch, candidatePosX, candidatePosY, candidateWinW + 4, candidateWinH)
|
||||
// candidate view border
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, candidatePosX - 1, candidatePosY - 1, candidateWinW + 6, candidateWinH + 2)
|
||||
|
||||
// candidate texts
|
||||
@@ -613,7 +613,7 @@ class UIItemTextLineInput(
|
||||
batch.color = candidatesBackCol
|
||||
Toolkit.fillArea(batch, candidatePosX, candidatePosY, candidateWinW, candidateWinH)
|
||||
// candidate view border
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, candidatePosX - 1, candidatePosY - 1, candidateWinW + 2, candidateWinH + 2)
|
||||
|
||||
val previewTextWidth = textWidths[0]
|
||||
|
||||
@@ -156,30 +156,30 @@ class UIItemTextSelector(
|
||||
}
|
||||
|
||||
// left button border
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_ACTIVE else Toolkit.Theme.COL_INACTIVE
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_INACTIVE
|
||||
Toolkit.drawBoxBorder(batch, posX - 1, posY - 1, buttonW + 2, height + 2)
|
||||
|
||||
// right button border
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_ACTIVE else Toolkit.Theme.COL_INACTIVE
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_INACTIVE
|
||||
Toolkit.drawBoxBorder(batch, posX + width - buttonW - 1, posY - 1, buttonW + 2, height + 2)
|
||||
|
||||
// text area border (again)
|
||||
if (!paletteShowing && mouseOnButton == 3) {
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, posX + buttonW + 2, posY - 1, width - 2*buttonW - 4, height + 2)
|
||||
}
|
||||
}
|
||||
|
||||
// left button icon
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_ACTIVE else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.color = if (mouseOnButton == 1 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 1) Toolkit.Theme.COL_MOUSE_UP else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.draw(labels.get(16,0), posX + (buttonW - labels.tileW) / 2f, posY + (height - labels.tileH) / 2f)
|
||||
|
||||
// right button icon
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_ACTIVE else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.color = if (mouseOnButton == 2 && mousePushed) Toolkit.Theme.COL_SELECTED
|
||||
else if (mouseOnButton == 2) Toolkit.Theme.COL_MOUSE_UP else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
batch.draw(labels.get(17,0), posX + width - buttonW + (buttonW - labels.tileW) / 2f, posY + (height - labels.tileH) / 2f)
|
||||
|
||||
// draw text
|
||||
@@ -202,13 +202,13 @@ class UIItemTextSelector(
|
||||
batch.color = palCursorCol
|
||||
Toolkit.drawBoxBorder(batch, posX + buttonW + 2, posY - 1, width - 2*buttonW - 4, height + 2)
|
||||
// palette border
|
||||
batch.color = Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = Toolkit.Theme.COL_MOUSE_UP
|
||||
Toolkit.drawBoxBorder(batch, palX-1, palY-1, palW+2, palH+2)
|
||||
|
||||
// palette items
|
||||
labelCache.forEachIndexed { index, s ->
|
||||
batch.color = if (index == selection) Toolkit.Theme.COL_HIGHLIGHT
|
||||
else if (index == mouseOnPaletteItem) Toolkit.Theme.COL_ACTIVE
|
||||
batch.color = if (index == selection) Toolkit.Theme.COL_SELECTED
|
||||
else if (index == mouseOnPaletteItem) Toolkit.Theme.COL_MOUSE_UP
|
||||
else UIItemTextLineInput.TEXTINPUT_COL_TEXT
|
||||
val t = labelCache[index]
|
||||
val tw = App.fontGame.getWidth(t)
|
||||
|
||||
Reference in New Issue
Block a user