Skip to content

Commit

Permalink
Simplify sidebar UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozar committed Oct 18, 2024
1 parent e895890 commit 8062bfb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions library/game_data.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const ADD_CART: int = 3
const CART_LENGTH_SHORT: int = 4
const CART_LENGTH_LONG: int = 7

const MIN_TURN_COUNTER: int = 0
const MAX_TURN_COUNTER: int = 99999
const MIN_TURN_COUNTER: int = 1
const MAX_TURN_COUNTER: int = 99

const MAX_DELIVERY: int = 10
const MAX_SERVICE: int = 2
Expand Down
12 changes: 4 additions & 8 deletions scene/sidebar/footnote_label.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var _ref_RandomNumber: RandomNumber

func init_gui() -> void:
_set_font(false)
text = "%s\n%s\n%s\n%s" % [
_get_version(), _get_help(), _get_debug(), _get_seed()
text = "%s\n%s\n%s" % [
_get_version(), _get_menu(), _get_seed()
]


Expand All @@ -19,12 +19,8 @@ func _get_version() -> String:
return "%s%s" % [wizard, version]


func _get_help() -> String:
return "Help: C"


func _get_debug() -> String:
return "Debug: V"
func _get_menu() -> String:
return "Menu: C|V"


func _get_seed() -> String:
Expand Down
11 changes: 5 additions & 6 deletions scene/sidebar/state_label.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class_name StateLabel
extends CustomLabel


const TURN: String = "Turn: %s"
const PROGRESS: String = "$%s|$%s|+%s"
const PROGRESS: String = "+%s.%s|$%s.%s"

const YOU_WIN: String = "You win.\n[Space]"
const YOU_LOSE: String = "You lose.\n[Space]"
Expand All @@ -25,18 +24,18 @@ func init_gui() -> void:


func update_gui() -> void:
var turn: String = TURN % _turn_counter
var progress: String = PROGRESS % [
_ref_PcAction.cash, _ref_PcAction.account, _ref_PcAction.delivery
_turn_counter, _ref_PcAction.delivery,
_ref_PcAction.cash, _ref_PcAction.account,
]
var first_item: String = _ref_PcAction.first_item_text
var state: String = _ref_PcAction.state_text
var end_game: String = ""

if game_over:
end_game = YOU_WIN if player_win else YOU_LOSE
text = "%s\n\n%s\n%s\n%s\n\n%s" % [
turn, progress, first_item, state, end_game
text = "%s\n\n%s\n%s\n%s" % [
progress, first_item, state, end_game
]


Expand Down

0 comments on commit 8062bfb

Please sign in to comment.