Skip to content

Commit

Permalink
Bestiary scrollbar image and debug text improvements.
Browse files Browse the repository at this point in the history
- Undoublesized scrollbar image.
- Traced back debug printing to hittable.cfg and made the debug message much clearer.
- Made widget_carousel only fire on_change when the value has actually changed, not just when it might have changed.
  • Loading branch information
DDR0 committed Jun 28, 2015
1 parent e9e0554 commit d205018
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/object_prototypes/base/hittable.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ properties: {
#-- bestiary description --#
title: "string :: fold(map(reverse(split(type, '_')), (cap_map[value[0]] or (string<-value[0])) + value[1:]), a + ' ' + b)
where cap_map = {a:'A',b:'B',c:'C','d':'D',e:'E',f:'F',g:'G',h:'H',i:'I',j:'J',k:'K',l:'L',m:'M',n:'N',o:'O',p:'P',q:'Q',r:'R',s:'S',t:'T',u:'U',v:'V',w:'W',x:'X',y:'Y',z:'Z'}",
description: "string :: 'No description found for\n ${dump(type+q[.cfg])}'",
description: "string :: dump('no desc for: ${type}.cfg ', 'Error, no description for ${type}.\nPlease define a description property.\nReported from hittable.cfg:description.')",
taste: "string :: ''", //Possibly optional, not everything can be tasted?


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ properties: {
on_change: def(string enemy_name) -> commands
bestiary_note_display.set_text(
obj.title+'\n'
+ '(taxonomy: '+obj.taxonomy+')\n\n'
+ '(taxonomy: '+obj.taxonomy+')\n \n'
+ obj.description+'\n'
+ if(/*obj is in tasted*/true and obj.taste, 'Tasting Notes: '+obj.taste+'\n', '')
) where obj = obj hittable <- object(enemy_name),
Expand Down
16 changes: 9 additions & 7 deletions data/objects/effects/gui_components/widget_carousel.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
min_relative_x: {type: "int", init: "relative_x - 30"},
carousel_size: "int <- size(display) and sort(display, a.x > b.x)[0].x - 60",
previous_centered_value: {type: "string", init: "''"},
center_at: "def(percent)->commands [
set(relative_x, min_relative_x-percent*carousel_size),
on_change(sort(display, abs(a.x - focus_point) < abs(b.x - focus_point))[0].object)
if(current_centered_value != previous_centered_value, [
on_change(current_centered_value),
set(previous_centered_value, current_centered_value),
]) where current_centered_value = sort(display, abs(a.x - focus_point) < abs(b.x - focus_point))[0].object
where focus_point = lib.math.interpolate(sort(display, a.x < b.x)[0].x, percent, sort(display, a.x > b.x)[0].x) //find the min, max, and then where we are between those two
]",
nearest: "widget <- widgets[0]",
Expand Down Expand Up @@ -72,8 +77,7 @@
animation: {
id: "normal",
image: 'gui/pause-menu/scrollbar-bits.png',
x:0, y:0, w:200, h:25,
scale: 1,
x:0, y:0, w:100, h:11,
}
},{
id: "slider",
Expand Down Expand Up @@ -110,13 +114,11 @@
animation: [{
id: "normal",
image: 'gui/pause-menu/scrollbar-bits.png',
x:0, y:25, w:50, h:25,
scale: 1,
x:0, y:16, w:25, h:11,
},{
id: "active",
image: 'gui/pause-menu/scrollbar-bits.png',
x:0, y:50, w:50, h:25,
scale: 1,
x:0, y:32, w:25, h:11,
}],
}],
}
Binary file modified images/gui/pause-menu/scrollbar-bits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d205018

Please sign in to comment.