mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 15:10:28 +00:00
Fix conflict
This commit is contained in:
parent
fe04a340db
commit
1b112b9f53
2 changed files with 43 additions and 55 deletions
|
@ -39,9 +39,9 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
|
||||||
CSliderState *s = c->state;
|
CSliderState *s = c->state;
|
||||||
I64 size = (c->win_task->pix_width / 16),
|
I64 size = (c->win_task->pix_width / 16),
|
||||||
size2 = (c->win_task->pix_height / 32),
|
size2 = (c->win_task->pix_height / 32),
|
||||||
|
i,
|
||||||
pos, col,
|
pos, col,
|
||||||
i, bias;
|
bias;
|
||||||
CBGR24 tempColor;
|
|
||||||
|
|
||||||
///////////////////////
|
///////////////////////
|
||||||
// CURRENT SELECTION //
|
// CURRENT SELECTION //
|
||||||
|
@ -50,21 +50,8 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
|
||||||
// current color box preview
|
// current color box preview
|
||||||
dc->color = BLACK;
|
dc->color = BLACK;
|
||||||
GrPrint(dc, 10, 10, "Preview:");
|
GrPrint(dc, 10, 10, "Preview:");
|
||||||
|
|
||||||
// pixel loop for current color preview
|
|
||||||
// for (i = 0; i <= 12; i++)
|
|
||||||
// for (j = 0; j <= 12; j++)
|
|
||||||
// {
|
|
||||||
// tempColor = gr_palette[selected_color];
|
|
||||||
// if (i < border || i > 12 - border || j < border || j > 12 - border)
|
|
||||||
// tempColor = 0x000000;
|
|
||||||
// // DrawPixel(c->win_task->pix_left + 78 + i, t + 7 + j, tempColor);
|
|
||||||
// }
|
|
||||||
tempColor = gr_palette[selected_color];
|
|
||||||
dc->color = tempColor;
|
|
||||||
GrRect(dc, c->win_task->pix_left + 78 , t + 7,c->win_task->pix_left + 78 + 12, t + 7 +12);
|
|
||||||
|
|
||||||
GrPrint(dc, 10, 26, "Current Color: #%d", selected_color);
|
GrPrint(dc, 10, 26, "Current Color: #%d", selected_color);
|
||||||
|
|
||||||
if (selected_color == 15)
|
if (selected_color == 15)
|
||||||
dc->color = LTGRAY;
|
dc->color = LTGRAY;
|
||||||
else if (gr_palette[selected_color] > 0xCCCCCC)
|
else if (gr_palette[selected_color] > 0xCCCCCC)
|
||||||
|
@ -73,7 +60,9 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
|
||||||
dc->color = 15;
|
dc->color = 15;
|
||||||
GrRect(dc, 94, 8, 58, 12);
|
GrRect(dc, 94, 8, 58, 12);
|
||||||
|
|
||||||
|
// #Hex value
|
||||||
dc->color = selected_color;
|
dc->color = selected_color;
|
||||||
|
GrRect(dc, 78, 8, 12, 12);
|
||||||
GrPrint(dc, 95, 10, "#%x%x%x", gr_palette[selected_color].r,
|
GrPrint(dc, 95, 10, "#%x%x%x", gr_palette[selected_color].r,
|
||||||
gr_palette[selected_color].g,
|
gr_palette[selected_color].g,
|
||||||
gr_palette[selected_color].b);
|
gr_palette[selected_color].b);
|
||||||
|
@ -153,32 +142,10 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
|
||||||
|
|
||||||
for (i = 0; i < COLORS_NUM; i++)
|
for (i = 0; i < COLORS_NUM; i++)
|
||||||
{
|
{
|
||||||
// for (j = 0; j <= size; j++)
|
|
||||||
// {
|
|
||||||
// for (k = 0; k <= size; k++)
|
|
||||||
// {
|
|
||||||
// tempColor = gr_palette[i];
|
|
||||||
// // black borders
|
|
||||||
// if (k < border || k > size - border || j < border || j > size - border - 1)
|
|
||||||
// {
|
|
||||||
// if (selected_color == i)
|
|
||||||
// tempColor = 0xFFFFFF;
|
|
||||||
// else
|
|
||||||
// tempColor = 0x000000;
|
|
||||||
// }
|
|
||||||
// // color preview
|
|
||||||
// DrawPixel(c->win_task->pix_left + j + (size * i), c->win_task->pix_bottom - size * 1.5 + k, tempColor);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
tempColor = gr_palette[i];
|
|
||||||
dc->color = tempColor;
|
|
||||||
GrRect(dc, c->win_task->pix_left + i, c->win_task->pix_bottom - size * 1.5, c->win_task->pix_left + (size * i), c->win_task->pix_bottom - size * 1.5);
|
|
||||||
|
|
||||||
// color label and text preview
|
// color label and text preview
|
||||||
// TODO: THIS LOGIC DOESNT WORK ON LIGHT THEMES
|
// TODO: THIS LOGIC DOESNT WORK ON LIGHT THEMES
|
||||||
// if color too light or too dark add bg
|
// if color too light or too dark add bg
|
||||||
|
|
||||||
if (i == 15)
|
if (i == 15)
|
||||||
dc->color = LTGRAY;
|
dc->color = LTGRAY;
|
||||||
else if (gr_palette[i] < gr_palette[15])
|
else if (gr_palette[i] < gr_palette[15])
|
||||||
|
@ -189,23 +156,31 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
|
||||||
dc->color = LTRED;*/
|
dc->color = LTRED;*/
|
||||||
else
|
else
|
||||||
dc->color = 15;
|
dc->color = 15;
|
||||||
|
|
||||||
if (i == selected_color)
|
if (i == selected_color)
|
||||||
dc->color = 0;
|
dc->color = 0;
|
||||||
GrRect(dc, 6, (size2 * 2) + 65 + 16 * i, 80, 18);
|
GrRect(dc, 6, (size2 * 2) + 65 + 16 * i, 80, 18);
|
||||||
GrRect(dc, (size * i), c->win_task->pix_height - (size - size / 2), size, size * 1.5);
|
GrRect(dc, (size * i), c->win_task->pix_height - (size - size / 2), size, size * 1.5);
|
||||||
|
|
||||||
GrRect(dc, 6, (size2 * 2) + 65 + 16 * i, 80, 18);
|
GrRect(dc, 6, (size2 * 2) + 65 + 16 * i, 80, 18);
|
||||||
|
|
||||||
|
|
||||||
if (i == selected_color)
|
if (i == selected_color)
|
||||||
dc->color = 15;
|
dc->color = 15;
|
||||||
else
|
else
|
||||||
dc->color = i;
|
dc->color = i;
|
||||||
|
|
||||||
bias = (size / 2) - 4;
|
bias = (size / 2) - 4;
|
||||||
if (i >= 9)
|
if (i >= 9)
|
||||||
bias = (size / 2) - 8;
|
bias = (size / 2) - 8;
|
||||||
|
|
||||||
GrPrint(dc, bias + (i * size), c->win_task->pix_height - (size * .6) + (size / 4), "%d", i);
|
GrPrint(dc, bias + (i * size), c->win_task->pix_height - (size * .6) + (size / 4), "%d", i);
|
||||||
GrPrint(dc, 10, (size2 * 2) + 70 + 16 * i, "#%d: Test", i);
|
GrPrint(dc, 10, (size2 * 2) + 70 + 16 * i, "#%d: Test", i);
|
||||||
|
// Border for preview box
|
||||||
|
GrRect(dc, (size * i)-2, c->win_task->pix_height - (size*1.5)-1, size+2, size+1);
|
||||||
|
// preview box
|
||||||
|
dc->color = i;
|
||||||
|
GrRect(dc, (size * i), c->win_task->pix_height - (size*1.5), size, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,12 +354,15 @@ public U0 PaletteEditor()
|
||||||
" PreviousColor(,,SC_CURSOR_UP);"
|
" PreviousColor(,,SC_CURSOR_UP);"
|
||||||
" NextColor(,,SC_CURSOR_RIGHT);"
|
" NextColor(,,SC_CURSOR_RIGHT);"
|
||||||
" NextColor(,,SC_CURSOR_DOWN);"
|
" NextColor(,,SC_CURSOR_DOWN);"
|
||||||
|
" RandomColor(,'r');"
|
||||||
|
" RandomPalette(,'R');"
|
||||||
"}"
|
"}"
|
||||||
"About {"
|
"About {"
|
||||||
" Info(,CH_CTRLI);"
|
" Info(,CH_CTRLI);"
|
||||||
"}"
|
"}"
|
||||||
);
|
);
|
||||||
DocClear;
|
DocClear;
|
||||||
|
DocCursor(OFF);
|
||||||
WinBorder(ON);
|
WinBorder(ON);
|
||||||
|
|
||||||
CCtrl *c = SliderNew;
|
CCtrl *c = SliderNew;
|
||||||
|
@ -441,13 +419,20 @@ public U0 PaletteEditor()
|
||||||
if (selected_color == 15)
|
if (selected_color == 15)
|
||||||
selected_color = -1;
|
selected_color = -1;
|
||||||
SelectColor(selected_color + 1, c);
|
SelectColor(selected_color + 1, c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CH_CTRLO:
|
case CH_CTRLO:
|
||||||
current_palette = "";
|
current_palette = "";
|
||||||
current_palette = PaletteSelect;
|
current_palette = PaletteSelect;
|
||||||
break;
|
break;
|
||||||
|
case 'r':
|
||||||
|
gr_palette[selected_color] = ColorGod;
|
||||||
|
LFBFlush;
|
||||||
|
break;
|
||||||
|
case 'R':
|
||||||
|
PaletteGod;
|
||||||
|
break;
|
||||||
case CH_CTRLI:
|
case CH_CTRLI:
|
||||||
PopUpOk("\n\n Use the arrows to select color\n\n # to manually input hex value","\n\n\n\t\tMade by y4my4m\n\n");
|
PopUpOk("\n\n Use the arrows to select color\n\n # to manually input hex value","\n\n\n\t\tMade by y4my4m\n\n");
|
||||||
break;
|
break;
|
||||||
|
@ -483,4 +468,4 @@ public U0 PaletteEditor()
|
||||||
c->win_task->win_right = original_right;
|
c->win_task->win_right = original_right;
|
||||||
c->win_task->win_top = original_top;
|
c->win_task->win_top = original_top;
|
||||||
c->win_task->win_bottom = original_bottom;
|
c->win_task->win_bottom = original_bottom;
|
||||||
}
|
}
|
|
@ -1,15 +1,18 @@
|
||||||
|
CBGR24 ColorGod(Bool instant=TRUE)
|
||||||
public U0 PaletteGodGenerate()
|
{// Generate a random color, seed-based or not
|
||||||
{
|
if (instant)
|
||||||
I64 i;
|
return RandI32 & 0xFFFFFF;
|
||||||
CBGR24 palette;
|
else
|
||||||
|
return GodPick & 0xFFFFFF;
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
{
|
|
||||||
palette = GodPick & 0xFFFFFF;
|
|
||||||
gr_palette[i] = palette;
|
|
||||||
LFBFlush;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PaletteGodGenerate;
|
public U0 PaletteGod(Bool seedUse=FALSE, Bool instant=TRUE)
|
||||||
|
{// Generate a random palette, seed-based or not
|
||||||
|
I64 i;
|
||||||
|
|
||||||
|
if (seedUse) Seed(GodPick);
|
||||||
|
|
||||||
|
for (i=0; i < 16; i++)
|
||||||
|
gr_palette[i] = ColorGod(instant);
|
||||||
|
LFBFlush;
|
||||||
|
}
|
Loading…
Reference in a new issue