| 446 | } |
| 447 | |
| 448 | bool imguiButton(const char* text, bool enabled) |
| 449 | { |
| 450 | g_state.widgetId++; |
| 451 | unsigned int id = (g_state.areaId<<16) | g_state.widgetId; |
| 452 | |
| 453 | int x = g_state.widgetX; |
| 454 | int y = g_state.widgetY - BUTTON_HEIGHT; |
| 455 | int w = g_state.widgetW; |
| 456 | int h = BUTTON_HEIGHT; |
| 457 | g_state.widgetY -= BUTTON_HEIGHT + DEFAULT_SPACING; |
| 458 | |
| 459 | bool over = enabled && inRect(x, y, w, h); |
| 460 | bool res = buttonLogic(id, over); |
| 461 | |
| 462 | addGfxCmdRoundedRect((float)x, (float)y, (float)w, (float)h, (float)BUTTON_HEIGHT/2-1, imguiRGBA(128,128,128, isActive(id)?196:96)); |
| 463 | if (enabled) |
| 464 | addGfxCmdText(x+BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200)); |
| 465 | else |
| 466 | addGfxCmdText(x+BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200)); |
| 467 | |
| 468 | return res; |
| 469 | } |
| 470 | |
| 471 | bool imguiItem(const char* text, bool enabled, unsigned int color, bool forceHot) |
| 472 | { |
no test coverage detected