| 98 | } |
| 99 | |
| 100 | void menuselect(void *menu, int sel) |
| 101 | { |
| 102 | gmenu &m = *(gmenu *)menu; |
| 103 | sel = normalizemenuselection(sel, m.items.length()); |
| 104 | if(m.items.inrange(sel)) |
| 105 | { |
| 106 | int oldsel = m.menusel; |
| 107 | m.menusel = sel; |
| 108 | if(m.allowinput) |
| 109 | { |
| 110 | if(sel!=oldsel) |
| 111 | { |
| 112 | if(m.items.inrange(oldsel)) m.items[oldsel]->focus(false); |
| 113 | if(!m.items[sel]->greyedout) m.items[sel]->focus(true); |
| 114 | audiomgr.playsound(S_MENUSELECT, SP_HIGHEST); |
| 115 | if(m.persistentselection) |
| 116 | { |
| 117 | defformatstring(val)("%d", sel); |
| 118 | alias(persistentmenuselectionalias(m.name), val); |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | void drawarrow(int dir, int x, int y, int size, float r = 1.0f, float g = 1.0f, float b = 1.0f) |
| 126 | { |
no test coverage detected