diff --git a/Graphics/dan_select/box/clear_mark/0.png b/Graphics/dan_select/box/clear_mark/0.png new file mode 100644 index 0000000..e9a9df2 --- /dev/null +++ b/Graphics/dan_select/box/clear_mark/0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:108925ad487038a40cb711be11c751b31205a2e9527e97f2dec4410503fe5cb6 +size 9041 diff --git a/Graphics/dan_select/box/clear_mark/1.png b/Graphics/dan_select/box/clear_mark/1.png new file mode 100644 index 0000000..9748fbf --- /dev/null +++ b/Graphics/dan_select/box/clear_mark/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ce42b15149894471e7644a836613106a9302004211a084b6144ef66d11be07f +size 9298 diff --git a/Graphics/dan_select/box/texture.json b/Graphics/dan_select/box/texture.json index b73f101..2261e48 100644 --- a/Graphics/dan_select/box/texture.json +++ b/Graphics/dan_select/box/texture.json @@ -14,5 +14,9 @@ "arrow_l": { "x": -95, "y": 60 + }, + "clear_mark": { + "x": -39, + "y": 24 } } \ No newline at end of file diff --git a/Graphics/dan_select/yellow_box/clear_mark/0.png b/Graphics/dan_select/yellow_box/clear_mark/0.png new file mode 100644 index 0000000..9e35191 --- /dev/null +++ b/Graphics/dan_select/yellow_box/clear_mark/0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:433af3c4eef82636a70592e1bebaa44d9b8f88da5abe240fe55e06535d659110 +size 56935 diff --git a/Graphics/dan_select/yellow_box/clear_mark/1.png b/Graphics/dan_select/yellow_box/clear_mark/1.png new file mode 100644 index 0000000..2111988 --- /dev/null +++ b/Graphics/dan_select/yellow_box/clear_mark/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15c702977afc97112aff1d435e87040ea3262ecd66fcfb9ca4dfa769311b23ff +size 59385 diff --git a/Graphics/dan_select/yellow_box/difficulty_ura.png b/Graphics/dan_select/yellow_box/difficulty_ura.png new file mode 100644 index 0000000..3d877ad --- /dev/null +++ b/Graphics/dan_select/yellow_box/difficulty_ura.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2153f77e11087fcb078ae38527fa83bef29791e3700e30cc87fec4405a66d0f +size 70 diff --git a/Graphics/dan_select/yellow_box/texture.json b/Graphics/dan_select/yellow_box/texture.json index 84f75c0..e1d1939 100644 --- a/Graphics/dan_select/yellow_box/texture.json +++ b/Graphics/dan_select/yellow_box/texture.json @@ -199,5 +199,10 @@ "exam_gauge_box": { "x": 0, "y": 0 - } + }, + "clear_mark": { + "x": 100, + "y": 505 + }, + "difficulty_ura": {} } diff --git a/Scripts/dan_select/dan_select.lua b/Scripts/dan_select/dan_select.lua index ad285d3..838aa75 100644 --- a/Scripts/dan_select/dan_select.lua +++ b/Scripts/dan_select/dan_select.lua @@ -72,3 +72,32 @@ local function draw_cursor(self, pos, now_ms, moved_ms) end if HAS_CLIPS then DanSelect.draw_cursor = draw_cursor end + +-- The course's clear stamp (yellow_box/clear_mark) sits over the dan plate and Don, as the +-- cabinet's stamp_detail does (it is above don_1p). The parent draws it with the box, under +-- both, so it is held back there and drawn with the title, which the engine draws after +-- the chara and the nameplate. +local parent_open, parent_title = DanSelect.draw_dan_open, DanSelect.draw_title +local held_stamp -- shared: the boxes and the title can be drawn through different instances +if parent_open then + function DanSelect:draw_dan_open(box) + local stamp = tex.get_texture("dan_select/yellow_box/clear_mark") + if not stamp or box.clear_mark <= 0 then return parent_open(self, box) end + local draw = tex.draw_texture + tex.draw_texture = function(id, p) + if id == stamp then return end + return draw(id, p) + end + local ok, err = pcall(parent_open, self, box) + tex.draw_texture = draw + if not ok then error(err, 0) end + held_stamp = { id = stamp, frame = box.clear_mark - 1, fade = box.open_fade.attribute } + end + + function DanSelect:draw_title() + if parent_title then parent_title(self) end + local s = held_stamp + held_stamp = nil + if s then tex.draw_texture(s.id, { frame = s.frame, fade = s.fade }) end + end +end