parent
c964a8f4ab
commit
9d145daf98
@ -81,7 +81,7 @@ void Editor_create()
|
|||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
Emgui_create("foo");
|
Emgui_create("foo");
|
||||||
id = Emgui_loadFontBitmap(g_minecraftiaFont, g_minecraftiaFontSize, EMGUI_FONT_MEMORY, 32, 128, g_minecraftiaFontLayout);
|
id = Emgui_loadFontBitmap(g_minecraftiaFont, g_minecraftiaFontSize, EMGUI_LOCATION_MEMORY, 32, 128, g_minecraftiaFontLayout);
|
||||||
memset(&s_editorData, 0, sizeof(s_editorData));
|
memset(&s_editorData, 0, sizeof(s_editorData));
|
||||||
|
|
||||||
RemoteConnection_createListner();
|
RemoteConnection_createListner();
|
||||||
@ -224,12 +224,20 @@ static void drawStatus()
|
|||||||
Emgui_setDefaultFont();
|
Emgui_setDefaultFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool flip = true;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Editor_update()
|
void Editor_update()
|
||||||
{
|
{
|
||||||
Emgui_begin();
|
Emgui_begin();
|
||||||
|
|
||||||
|
Emgui_radioButtonImage("/Users/emoon/code/rocket/ogl_editor/data/images/arrow_left.png", 0,
|
||||||
|
"/Users/emoon/code/rocket/ogl_editor/data/images/arrow_right.png", 0,
|
||||||
|
EMGUI_LOCATION_FILE, Emgui_color32(255, 255, 255, 255), 10, 10, &flip);
|
||||||
|
|
||||||
|
rlog(R_INFO, "%d\n", flip);
|
||||||
|
|
||||||
drawStatus();
|
drawStatus();
|
||||||
|
|
||||||
TrackView_render(&s_editorData.trackViewInfo, &s_editorData.trackData);
|
TrackView_render(&s_editorData.trackViewInfo, &s_editorData.trackData);
|
||||||
|
|||||||
@ -66,8 +66,8 @@ static bool drawColorButton(uint32_t color, int x, int y, int size)
|
|||||||
|
|
||||||
struct TrackInfo
|
struct TrackInfo
|
||||||
{
|
{
|
||||||
const TrackViewInfo* viewInfo;
|
TrackViewInfo* viewInfo;
|
||||||
const TrackData* trackData;
|
TrackData* trackData;
|
||||||
int selectLeft;
|
int selectLeft;
|
||||||
int selectRight;
|
int selectRight;
|
||||||
int selectTop;
|
int selectTop;
|
||||||
@ -83,15 +83,15 @@ struct TrackInfo
|
|||||||
static int renderTrackName(const struct TrackInfo* info, struct sync_track* track, int startX, bool folded)
|
static int renderTrackName(const struct TrackInfo* info, struct sync_track* track, int startX, bool folded)
|
||||||
{
|
{
|
||||||
int size = min_track_size;
|
int size = min_track_size;
|
||||||
|
int text_size;
|
||||||
|
int x_adjust = 0;
|
||||||
|
int spacing = folded ? 0 : 30;
|
||||||
|
|
||||||
if (!track)
|
if (!track)
|
||||||
return folded ? 1 : size;
|
return folded ? 1 : size;
|
||||||
|
|
||||||
int text_size;
|
|
||||||
int x_adjust = 0;
|
|
||||||
|
|
||||||
Emgui_setFont(info->viewInfo->smallFontId);
|
Emgui_setFont(info->viewInfo->smallFontId);
|
||||||
text_size = (Emgui_getTextSize(track->name) & 0xffff) + 4;
|
text_size = (Emgui_getTextSize(track->name) & 0xffff) + spacing;
|
||||||
|
|
||||||
// if text is smaller than min size we center the text
|
// if text is smaller than min size we center the text
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ static int renderTrackName(const struct TrackInfo* info, struct sync_track* trac
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Emgui_drawText(track->name, (startX + 3) + x_adjust, info->startY - font_size * 2, Emgui_color32(0xff, 0xff, 0xff, 0xff));
|
Emgui_drawText(track->name, (startX + 3) + x_adjust + 16, info->startY - font_size * 2, Emgui_color32(0xff, 0xff, 0xff, 0xff));
|
||||||
}
|
}
|
||||||
|
|
||||||
Emgui_setDefaultFont();
|
Emgui_setDefaultFont();
|
||||||
@ -174,7 +174,7 @@ static void renderText(const struct TrackInfo* info, struct sync_track* track, i
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static int renderChannel(const struct TrackInfo* info, int startX, int editRow, int trackIndex)
|
static int renderChannel(struct TrackInfo* info, int startX, int editRow, int trackIndex)
|
||||||
{
|
{
|
||||||
int y, y_offset;
|
int y, y_offset;
|
||||||
int text_size = 0;
|
int text_size = 0;
|
||||||
@ -184,7 +184,15 @@ static int renderChannel(const struct TrackInfo* info, int startX, int editRow,
|
|||||||
uint32_t borderColor = Emgui_color32(40, 40, 40, 255);
|
uint32_t borderColor = Emgui_color32(40, 40, 40, 255);
|
||||||
struct sync_track* track = 0;
|
struct sync_track* track = 0;
|
||||||
const uint32_t color = info->trackData->colors[trackIndex];
|
const uint32_t color = info->trackData->colors[trackIndex];
|
||||||
const bool folded = info->trackData->folded[trackIndex];
|
bool folded;
|
||||||
|
|
||||||
|
Emgui_radioButtonImage("/Users/emoon/code/rocket/ogl_editor/data/images/arrow_right.png", 0,
|
||||||
|
"/Users/emoon/code/rocket/ogl_editor/data/images/arrow_left.png", 0,
|
||||||
|
EMGUI_LOCATION_FILE, Emgui_color32(255, 255, 255, 255),
|
||||||
|
startX + 6, info->startY - (font_size + 5),
|
||||||
|
&info->trackData->folded[trackIndex]);
|
||||||
|
|
||||||
|
folded = info->trackData->folded[trackIndex];
|
||||||
|
|
||||||
if (info->trackData->syncData.tracks)
|
if (info->trackData->syncData.tracks)
|
||||||
track = info->trackData->syncData.tracks[trackIndex];
|
track = info->trackData->syncData.tracks[trackIndex];
|
||||||
@ -199,7 +207,7 @@ static int renderChannel(const struct TrackInfo* info, int startX, int editRow,
|
|||||||
|
|
||||||
Emgui_drawBorder(borderColor, borderColor, startX, info->startY - font_size * 4, size, info->endSizeY);
|
Emgui_drawBorder(borderColor, borderColor, startX, info->startY - font_size * 4, size, info->endSizeY);
|
||||||
|
|
||||||
if (drawColorButton(color, startX + 4, info->startY - font_size * 3, size))
|
if (drawColorButton(color, startX + 4, info->startY - ((font_size * 3) + 2), size))
|
||||||
{
|
{
|
||||||
printf("Yah!\n");
|
printf("Yah!\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user