MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetObjColor

Function GetObjColor

Source/GUI/dimgui/dimgui.cpp:315–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313#endif
314
315static vec4 GetObjColor(Object* obj) {
316 vec4 color(1.0f);
317 switch (obj->GetType()) {
318 case _env_object:
319 color = vec4(0.8f, 0.8f, 1.0f, 1.0f);
320 break;
321 case _movement_object:
322 color = vec4(1.0f, 0.8f, 0.8f, 1.0f);
323 break;
324 case _hotspot_object:
325 color = vec4(1.0f, 1.0f, 0.8f, 1.0f);
326 break;
327 case _decal_object:
328 color = vec4(0.8f, 1.0f, 0.8f, 1.0f);
329 break;
330 default:
331 color = vec4(0.9f, 0.9f, 0.9f, 1.0f);
332 break;
333 }
334 if (obj->exclude_from_save) {
335 color[3] *= 0.5f;
336 }
337 return color;
338}
339
340static int ParseDetails(const char* str, float* results) {
341 // example str: "min:0,max:2,step:0.001,text_mult:100"

Callers 2

DrawImGuiFunction · 0.85

Calls 2

vec4Class · 0.50
GetTypeMethod · 0.45

Tested by

no test coverage detected