Skip to content

Commit

Permalink
Implemented vertical position adjustment for button text
Browse files Browse the repository at this point in the history
  • Loading branch information
Iniquitatis committed Jun 9, 2021
1 parent e6e2da4 commit 1dc8883
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 70 deletions.
1 change: 1 addition & 0 deletions Make.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def preprocess_text_file(in_path, out_path, theme, scale):
"CUI_DLG_VERT_OFFSET": stringize(theme["dialogue_vertical_offset"]),
"CUI_DLG_LINE_SPACING": stringize(theme["dialogue_line_spacing"]),
"CUI_BTN_HEIGHT_ADJUSTMENT": stringize(theme["button_height_adjustment"]),
"CUI_BTN_TEXT_VERT_OFFSET": stringize(theme["button_text_vertical_offset"]),
"CUI_PRM_COLOR": modulate_colors(prm_color["h"], prm_color["s"], prm_color["l"]),
"CUI_SCD_COLOR": modulate_colors(scd_color["h"], scd_color["s"], scd_color["l"]),
"CUI_SCALE": stringize(scale),
Expand Down
5 changes: 3 additions & 2 deletions Source/common/theme/comfy_ui/definitions.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ define comfy_ui.quick_button_text.selected_color = "CUI_SCD_COLOR(255, 255, 2
define comfy_ui.quick_button_text.insensitive_color = "CUI_SCD_COLOR(170, 102, 102)"
define comfy_ui.quick_button_text.outlines = []

define comfy_ui.button.height_adjustment = CUI_BTN_HEIGHT_ADJUSTMENT()

define comfy_ui.button_text.vertical_offset = CUI_BTN_TEXT_VERT_OFFSET()
define comfy_ui.button_text.idle_color = "CUI_PRM_COLOR(56, 56, 56)"
define comfy_ui.button_text.hover_color = "CUI_PRM_COLOR(255, 170, 153)"
define comfy_ui.button_text.selected_color = "CUI_PRM_COLOR(187, 85, 136)"
Expand All @@ -75,8 +78,6 @@ define comfy_ui.poem_game_text.color = "CUI_PRM_COLOR(56, 56, 56)"
define comfy_ui.poem_game_text.outlines = []
define comfy_ui.poem_game_text.hover_outlines = [(3, "CUI_PRM_COLOR(255, 238, 255)", 0, 0), (2, "CUI_PRM_COLOR(255, 204, 255)", 0, 0), (1, "CUI_PRM_COLOR(255, 170, 255)", 0, 0)]

define comfy_ui.button_height_adjustment = CUI_BTN_HEIGHT_ADJUSTMENT()

define comfy_ui.choice_button_spacing = 22

define comfy_ui.input_caret_color = "CUI_SCD_COLOR(187, 85, 153)"
5 changes: 3 additions & 2 deletions Source/common/theme/comfy_ui/fonts.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@ init 999 style confirm_prompt_text:
# Choice menu
################################################################################
init 999 style choice_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style choice_button_text:
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
5 changes: 3 additions & 2 deletions Source/mas/theme/comfy_ui/definitions.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ define comfy_ui.quick_button_text.dark.selected_color = "CUI_SCD_COLOR(255,
define comfy_ui.quick_button_text.dark.insensitive_color = "CUI_SCD_COLOR(170, 102, 102)"
define comfy_ui.quick_button_text.dark.outlines = []

define comfy_ui.button.height_adjustment = CUI_BTN_HEIGHT_ADJUSTMENT()

define comfy_ui.button_text.vertical_offset = CUI_BTN_TEXT_VERT_OFFSET()
define comfy_ui.button_text.light.idle_color = "CUI_PRM_COLOR(56, 56, 56)"
define comfy_ui.button_text.light.hover_color = "CUI_PRM_COLOR(255, 170, 153)"
define comfy_ui.button_text.light.selected_color = "CUI_PRM_COLOR(187, 85, 136)"
Expand Down Expand Up @@ -129,8 +132,6 @@ define comfy_ui.fancy_check_button_text.dark.idle_color = "CUI_PRM_COLOR
define comfy_ui.fancy_check_button_text.dark.hover_color = "CUI_PRM_COLOR(235, 173, 185)"
define comfy_ui.fancy_check_button_text.dark.selected_color = "CUI_PRM_COLOR(235, 173, 185)"

define comfy_ui.button_height_adjustment = CUI_BTN_HEIGHT_ADJUSTMENT()

define comfy_ui.scrollable_menu_button_spacing = 6
define comfy_ui.choice_button_spacing = 12
define comfy_ui.talk_button_spacing = 16
Expand Down
142 changes: 78 additions & 64 deletions Source/mas/theme/comfy_ui/fonts.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,21 @@ init 999 style confirm_prompt_text_dark:
# Choice menu
################################################################################
init 999 style choice_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style choice_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style choice_button_text:
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style choice_button_text_dark:
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
Expand All @@ -249,134 +251,146 @@ init 999 style choice_button_text_dark:
# Scrollable menu
################################################################################
init 999 style scrollable_menu_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style scrollable_menu_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style scrollable_menu_button_text:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style scrollable_menu_button_text_dark:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size



################################################################################
# Two-pane scrollable menu
################################################################################
init 999 style twopane_scrollable_menu_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style twopane_scrollable_menu_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style twopane_scrollable_menu_button_text:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style twopane_scrollable_menu_button_text_dark:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size



################################################################################
# Talk choice menu
################################################################################
init 999 style talk_choice_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style talk_choice_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style talk_choice_button_text:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style talk_choice_button_text_dark:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size



################################################################################
# Hotkey button menu
################################################################################
init 999 style hkb_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style hkb_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style hkb_button_text:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style hkb_button_text_dark:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size



################################################################################
# Island buttons
################################################################################
init 999 style island_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style island_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style island_button_text:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style island_button_text_dark:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size



################################################################################
# Extras menu
################################################################################
init 999 style mas_adjustable_button:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style mas_adjustable_button_dark:
top_padding (5 + int(math.floor(float(comfy_ui.button_height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button_height_adjustment) / 2.0)))
top_padding (5 + int(math.floor(float(comfy_ui.button.height_adjustment) / 2.0)))
bottom_padding (5 + int(math.ceil (float(comfy_ui.button.height_adjustment) / 2.0)))

init 999 style mas_adjustable_button_text:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size

init 999 style mas_adjustable_button_text_dark:
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
yoffset comfy_ui.button_text.vertical_offset
font comfy_ui.common.font
kerning comfy_ui.common.font_kerning
size comfy_ui.common.font_size
1 change: 1 addition & 0 deletions Themes/Chocolate.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -1,
"dialogue_line_spacing": 2,
"button_height_adjustment": 1,
"button_text_vertical_offset": 0,
"primary_color": { "h": 24, "s": 0.35, "l": 0.0 },
"secondary_color": { "h": 24, "s": 0.4, "l": -0.04 }
}
1 change: 1 addition & 0 deletions Themes/Classic.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -1,
"dialogue_line_spacing": 2,
"button_height_adjustment": 1,
"button_text_vertical_offset": 0,
"primary_color": { "h": null, "s": null, "l": null },
"secondary_color": { "h": null, "s": null, "l": null }
}
1 change: 1 addition & 0 deletions Themes/Cold.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -3,
"dialogue_line_spacing": -1,
"button_height_adjustment": -4,
"button_text_vertical_offset": 1,
"primary_color": { "h": 245, "s": 0.13, "l": 0.0 },
"secondary_color": { "h": 225, "s": 0.6, "l": 0.0 }
}
1 change: 1 addition & 0 deletions Themes/Default.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -3,
"dialogue_line_spacing": -1,
"button_height_adjustment": -4,
"button_text_vertical_offset": 1,
"primary_color": { "h": null, "s": null, "l": null },
"secondary_color": { "h": null, "s": null, "l": null }
}
1 change: 1 addition & 0 deletions Themes/Mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -3,
"dialogue_line_spacing": -1,
"button_height_adjustment": -4,
"button_text_vertical_offset": 1,
"primary_color": { "h": 150, "s": 0.33, "l": 0.0 },
"secondary_color": { "h": 138, "s": 0.58, "l": 0.0 }
}
1 change: 1 addition & 0 deletions Themes/Mystique.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -1,
"dialogue_line_spacing": 2,
"button_height_adjustment": 1,
"button_text_vertical_offset": 0,
"primary_color": { "h": 285, "s": 0.6, "l": 0.0 },
"secondary_color": { "h": 270, "s": 1.0, "l": 0.0 }
}
1 change: 1 addition & 0 deletions Themes/Peach.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -3,
"dialogue_line_spacing": -1,
"button_height_adjustment": -4,
"button_text_vertical_offset": 1,
"primary_color": { "h": 25, "s": 0.55, "l": 0.0 },
"secondary_color": { "h": 12, "s": 0.8, "l": 0.0 }
}
1 change: 1 addition & 0 deletions Themes/Starry.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -3,
"dialogue_line_spacing": -1,
"button_height_adjustment": -4,
"button_text_vertical_offset": 1,
"primary_color": { "h": 60, "s": 0.8, "l": 0.0 },
"secondary_color": { "h": 60, "s": 1.0, "l": 0.0 }
}
1 change: 1 addition & 0 deletions Themes/Strawberry.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dialogue_vertical_offset": -3,
"dialogue_line_spacing": -1,
"button_height_adjustment": -4,
"button_text_vertical_offset": 1,
"primary_color": { "h": 3, "s": 0.85, "l": 0.0 },
"secondary_color": { "h": 124, "s": 0.75, "l": 0.0 }
}

0 comments on commit 1dc8883

Please sign in to comment.