Skip to content

Commit

Permalink
Preferences: Reimplement orb color options
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Feb 18, 2016
1 parent d8268c0 commit 38ddbb9
Show file tree
Hide file tree
Showing 9 changed files with 479 additions and 55 deletions.
4 changes: 2 additions & 2 deletions data/advanced_preferences.cfg
Expand Up @@ -176,13 +176,13 @@
type=custom
[/advanced_preference]

#ifdef __UNUSED__
[advanced_preference]
field=orb_color
name= _ "Customize orb colors (unimplemented)"
name= _ "Customize orb colors"
type=custom
[/advanced_preference]

#ifdef __UNUSED__
[advanced_preference]
field=joystick_support_enabled
name= _ "Joystick support"
Expand Down
48 changes: 1 addition & 47 deletions data/core/team-colors.cfg
Expand Up @@ -13,28 +13,13 @@
rgb=FF0000,FFFFFF,000000,FF0000
name= _ "Red"
[/color_range]
[color_range]
id=orb_3red
rgb=FF0000,FFFFFF,000000,FF0000
name= _ "Red"
[/color_range]

[color_range]
id=orb_lightred
rgb=D1620D,FFFFFF,000000,FF0000
name= _ "Light Red"
[/color_range]
[color_range]
id=lightred
rgb=D1620D,FFFFFF,000000,FF0000
name= _ "Light Red"
[/color_range]

[color_range]
id=orb_darkred
rgb=8A0808,FFFFFF,000000,FF0000
name= _ "Dark Red"
[/color_range]
[color_range]
id=darkred
rgb=8A0808,FFFFFF,000000,FF0000
Expand All @@ -46,17 +31,7 @@
rgb=2E419B,FFFFFF,0F0F0F,0000FF
name= _ "Blue"
[/color_range]
[color_range]
id=orb_6blue
rgb=2E419B,FFFFFF,0F0F0F,0000FF
name= _ "Blue"
[/color_range]

[color_range]
id=orb_5lightblue
rgb=00A4FF,FFFFFF,000A21,00A4FF
name= _ "Light blue"
[/color_range]
[color_range]
id=lightblue
rgb=00A4FF,FFFFFF,000A21,00A4FF
Expand All @@ -69,11 +44,6 @@
name= _ "Green"
[/color_range]

[color_range]
id=orb_1brightgreen
rgb=8CFF00,EBFFBF,2D4001,8CFF00
name= _ "Bright green"
[/color_range]
[color_range]
id=brightgreen
rgb=8CFF00,EBFFBF,2D4001,8CFF00
Expand All @@ -92,12 +62,6 @@
name= _ "Black"
[/color_range]

[color_range]
id=orb_6black
rgb=5A5A5A,FFFFFF,000000,000000
name= _ "Black"
[/color_range]

[color_range]
id=brown
rgb=945027,FFFFFF,000000,AA4600
Expand All @@ -111,7 +75,7 @@
[/color_range]

[color_range]
id=orb_2brightorange
id=brightorange
rgb=FFC600,FFF7E6,792A00,FFC600
name= _ "Bright orange"
[/color_range]
Expand All @@ -121,11 +85,6 @@
rgb=E1E1E1,FFFFFF,1E1E1E,FFFFFF
name= _ "White"
[/color_range]
[color_range]
id=orb_7white
rgb=E1E1E1,FFFFFF,1E1E1E,FFFFFF
name= _ "White"
[/color_range]

[color_range]
id=teal
Expand All @@ -138,11 +97,6 @@
rgb=FFF35A,FFF8D2,994F13,FFF35A
name= _ "Gold"
[/color_range]
[color_range]
id=orb_8gold
rgb=FFF35A,FFF8D2,994F13,FFF35A
name= _ "Gold"
[/color_range]

# The following team colors are an extended palette meant specifically to recolor the background of terrain type icons
# Each color range is named after the terrain type it corresponds to.
Expand Down
10 changes: 5 additions & 5 deletions data/game_config.cfg
Expand Up @@ -47,11 +47,11 @@
footprint_teleport_exit="footsteps/teleport-out.png"

[colors]
enemy_orb_color="orb_6black"
unmoved_orb_color="orb_1brightgreen"
ally_orb_color="orb_5lightblue"
partial_orb_color="orb_2brightorange"
moved_orb_color="orb_3red"
enemy_orb_color="black"
unmoved_orb_color="brightgreen"
ally_orb_color="lightblue"
partial_orb_color="brightorange"
moved_orb_color="red"
[/colors]

[images]
Expand Down
112 changes: 112 additions & 0 deletions data/gui/default/widget/toggle_button_orb.cfg
@@ -0,0 +1,112 @@
#textdomain wesnoth-lib
###
### Definition of a selectable orb button.
###

#define _GUI_ICON SIZE STATE
[image]
x = 0
y = 0
w = {SIZE}
h = {SIZE}
name = "('buttons/misc/orb{STATE}.png" + <<~RC(magenta>{icon})')>>
[/image]
#enddef
#define _GUI_RESOLUTION RESOLUTION SIZE
[resolution]
{RESOLUTION}
min_width = {SIZE}
min_height = {SIZE}
default_width = {SIZE}
default_height = {SIZE}
max_width = {SIZE}
max_height = {SIZE}
text_extra_width = 0
text_font_size = 0
[state]
[enabled]
[draw]
{_GUI_ICON ({SIZE}) ()}
[/draw]
[/enabled]
[disabled]
[draw]
{_GUI_ICON ({SIZE}) ()}
[/draw]
[/disabled]
[focused]
[draw]
{_GUI_ICON ({SIZE}) (-active)}
[/draw]
[/focused]
[/state]
###
### Selected
###
[state]
[enabled]
[draw]
[image]
x = 0
y = 0
w = {SIZE}
h = {SIZE}
name = "buttons/button_square/button_square_30-pressed.png"
[/image]
{_GUI_ICON ({SIZE}) (-pressed)}
[/draw]
[/enabled]
[disabled]
[draw]
[image]
x = 0
y = 0
w = {SIZE}
h = {SIZE}
name = "buttons/button_square/button_square_30-pressed.png"
[/image]
{_GUI_ICON ({SIZE}) (-pressed)}
[/draw]
[/disabled]
[focused]
[draw]
[image]
x = 0
y = 0
w = {SIZE}
h = {SIZE}
name = "buttons/button_square/button_square_30-active-pressed.png"
[/image]
{_GUI_ICON ({SIZE}) (-active)}
[/draw]
[/focused]
[/state]
[/resolution]
#enddef
[toggle_button_definition]
id = "orb"
description = "This toggle button is meant to be used in the select orbs dialog."
{_GUI_RESOLUTION ({GUI_NORMAL__RESOLUTION}) 30 }
[/toggle_button_definition]
#undef _GUI_RESOLUTION
#undef _GUI_ICON
136 changes: 136 additions & 0 deletions data/gui/default/window/select_orb_colors.cfg
@@ -0,0 +1,136 @@

#define _GUI_ORB_CELL PURPOSE COLOR
[column]
border = "all"
border_size = 5
[toggle_button]
id = "orb_{PURPOSE}_{COLOR}"
definition = "orb"
icon = "{COLOR}"
[/toggle_button]
[/column]
#enddef

#define _GUI_ORB_ROW PURPOSE
[grid]
id = "orb_{PURPOSE}_selection"
[row]
{_GUI_ORB_CELL {PURPOSE} brightgreen}
{_GUI_ORB_CELL {PURPOSE} brightorange}
{_GUI_ORB_CELL {PURPOSE} red}
{_GUI_ORB_CELL {PURPOSE} lightblue}
{_GUI_ORB_CELL {PURPOSE} black}
{_GUI_ORB_CELL {PURPOSE} blue}
{_GUI_ORB_CELL {PURPOSE} white}
{_GUI_ORB_CELL {PURPOSE} gold}
{_GUI_ORB_CELL {PURPOSE} darkred}
{_GUI_ORB_CELL {PURPOSE} lightred}
[/row]
[/grid]
#enddef

#define _GUI_ORB_GROUP PURPOSE LABEL
[row]
[column]
horizontal_alignment = "left"
border = "all"
border_size = 5
[toggle_button]
id = "orb_{PURPOSE}_show"
definition = "default"
label = {LABEL}
[/toggle_button]
[/column]
[/row]
[row]
[column]
horizontal_alignment = "left"
{_GUI_ORB_ROW {PURPOSE}}
[/column]
[/row]
#enddef

[window]
id = "select_orb_colors"
description = "Select the colors of orbs displayed on units for various purposes."

[resolution]
definition = "default"

click_dismiss = "true"
maximum_width = 600
maximum_height = 480

[tooltip]
id = "tooltip_large"
[/tooltip]
[helptip]
id = "tooltip_large"
[/helptip]

[grid]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "title"
label = _ "Choose Orb/Minimap Colors"
[/label]
[/column]
[/row]
{_GUI_ORB_GROUP unmoved (_"Show unmoved orb")}
{_GUI_ORB_GROUP partial (_"Show partial moved orb")}
{_GUI_ORB_GROUP moved (_"Show moved orb")}
{_GUI_ORB_GROUP ally (_"Show ally orb")}
{_GUI_ORB_GROUP enemy (_"Show enemy orb")}
[row]
[column]
horizontal_grow = "true"
[grid]
[row]
[column]
horizontal_alignment = "left"
grow_factor = 1
border = "all"
border_size = 5
[button]
id = "orb_defaults"
definition = "default"
label = _ "Defaults"
[/button]
[/column]
[column]
horizontal_alignment = "right"
grow_factor = 0
border = "all"
border_size = 5
[button]
id = "ok"
definition = "default"
label = _ "OK"
[/button]
[/column]
[column]
horizontal_alignment = "right"
grow_factor = 0
border = "all"
border_size = 5
[button]
id = "cancel"
definition = "default"
label = _ "Cancel"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/resolution]
[/window]

#undef _GUI_ORB_GROUP
#undef _GUI_ORB_ROW
#undef _GUI_ORB_CELL

0 comments on commit 38ddbb9

Please sign in to comment.