This commit is contained in:
y4my4my4m 2021-11-10 03:28:53 -05:00
parent 5e5dfee446
commit fb495798a6
7 changed files with 104 additions and 6 deletions

View file

@ -47,7 +47,7 @@ U0 DrawCtrlSlider(CDC *dc,CCtrl *c)
GrRect(dc, c->left+SLIDER_BORDER,
c->top+SLIDER_BORDER,
SLIDER_SPACING*4+2-2*SLIDER_BORDER,
SLIDER_SPACING*2+SLIDER_RANGE-2*SLIDER_BORDER);
SLIDER_SPACING*2+SLIDER_RANGE-2*SLIDER_BORDER);
//slider
dc->color=BLACK;
@ -58,7 +58,7 @@ U0 DrawCtrlSlider(CDC *dc,CCtrl *c)
GrLine(dc, c->left+i*SLIDER_SPACING+i-1,
c->top+SLIDER_SPACING,
c->left+i*SLIDER_SPACING+i-1,
c->top+SLIDER_SPACING+SLIDER_RANGE-1);
r c->top+SLIDER_SPACING+SLIDER_RANGE-1);
}
//values
@ -156,7 +156,7 @@ U0 PELoad(Bool prompt)
//FileExtRemove(file_path);
//StrLastRemove(file_path, "/", file_name);
//StrFirstRemove(file_name+1, StrLen(file_name), without_first_ch);
//StrFirstRemove(file_name+1, StrLen(file_name), without_first_ch);
//ToUpper(*upper_case);
U8 file = FileRead(file_path);

View file

@ -0,0 +1 @@
0xFFFFFF, 0x867ADE, 0x00CC55, 0x5A878B, 0xB80000, 0xCC44CC, 0xDD8855, 0xBBBBBB, 0x777777, 0x0088FF, 0xAAFF66, 0xAAFFEE, 0xFF7777, 0xCA94E8, 0xEEEE77, 0x483AAA

View file

@ -1,2 +1 @@
0xE2E8EB, 0x5BD2D4, 0x47515D, 0xB46D29, 0xB34F4B, 0xCB711F, 0xFFEF2F, 0x3D272F, 0xA161C, 0xE24594, 0xA1CE97, 0x6DB4BE, 0xFF575B, 0xB1AA9E, 0xD4B475, 0xE2331

0xE2E8EB, 0x5BD2D4, 0x496076, 0x307AFF, 0xD86D22, 0xFFD91F, 0xFFEF2F, 0x4F8A97, 0xA161C, 0xE24594, 0xA1CE97, 0x6DB4BE, 0xFF575B, 0xB1AA9E, 0xD53368, 0xE2331

View file

@ -0,0 +1 @@
0x000000, 0x0000AA, 0x00AA00, 0x00AAAA, 0xAA0000, 0xAA00AA, 0xAA5500, 0xAAAAAA, 0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF

View file

@ -0,0 +1 @@
0xE8E8E9, 0x374B88, 0x6C84FC, 0x297582, 0x63D64E, 0x397AFF, 0xB7822F, 0x25256E, 0x712, 0xFF2A76, 0xA1CE97, 0x6DB4BE, 0x9FA6FF, 0xCA94E8, 0xFFCC00, 0x132C

View file

@ -1,2 +1,2 @@
#include "~/PaletteEditor/Load.CC";
#include "~/PaletteEditor/Load.CC";
PaletteEditor;

96
src/Home/PaletteSelect.CC Executable file
View file

@ -0,0 +1,96 @@
I64 selected = 1;
I64 dir_length = 5;
U8 files[5];// = 1,2,3,4,5;
U0 PaletteChange()
{
DocClear;
CDirEntry *tmpde1 = NULL, *tmpde2;
U8 *st;
I64 csize = 0xFFFF, c = 0xFFFF, res = 0;
U8 files[0];
tmpde1 = FilesFind("~/PaletteEditor/Palettes/*.CC");
if (tmpde1)
{
if(selected > 6) selected = 6;
if(selected < 1) selected = 1;
// Free(st);
st = MAllocIdent(tmpde1->full_name);
StrLastRemove(st, "/");
if (!st[2])
StrCopy(st + 2, "/");
//Find max columns
// tmpde2 = tmpde1;
// while (tmpde2)
// {
// if (tmpde2->size > csize)
// csize = tmpde2->size;
// if (tmpde2->clus > c)
// c = tmpde2->clus;
// tmpde2 = tmpde2->next;
// }
// csize = Bsr(csize) / 4 + 1;
// c = Bsr(c) / 4 + 1;
while (tmpde1)
{
tmpde2 = tmpde1->next;
// files[res] = tmpde1-name;
res++;
// dir_length++;
FileExtRemove(tmpde1);
if (selected==res) "$$GREEN$$%s\n",tmpde1->name;
else "$$BLACK$$%s\n",tmpde1->name;
DirEntryDel(tmpde1);
tmpde1 = tmpde2;
}
// Free(st);
}
// I64 i;
// for(i=0;i<dir_length;i++)
// {
// //if (selected==res) "$$GREEN$$%s\n",files[i];
// "$$WHITE$$%s\n",files[i];
// }
}
public U0 PaletteSelect()
{
I64 arg1,arg2,ch=0;
// this is terrible, shouldnt rescan everytime you select...
// i guess it'll update the treelist tho lmao
PaletteChange;
try {
while(TRUE) {
switch(MessageScan(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP)) {
case MESSAGE_KEY_DOWN:
ch=arg1;
switch(ch){
case CH_CTRLZ: selected--; PaletteChange; break;
case CH_CTRLX: selected++; PaletteChange; break;
case CH_ESC:
case CH_SHIFT_ESC:
throw;
}
break;
}
Refresh;
}
}
catch
PutExcept;
}
PaletteSelect;