This commit is contained in:
y4my4my4m 2023-05-24 03:18:38 +09:00
parent 934a6c8b69
commit dd34198592
3 changed files with 45 additions and 8 deletions

View file

@ -1,6 +1,42 @@
U0 (*old_wall_paper)(CTask *task);
CDoc *wallpaper_doc;
RegDefault("Wallpapers/Current", "1;\n");
RegExe("Wallpapers/Current");
U0 WallPaperSet(I8 direction) {
CDirEntry *tmpde1;
// read the current wallpaper index from the registry
I64 current = RegExe("Wallpapers/Current");
I64 max = 0;
// SysLog("Reading current wallpaper index from registry: %d\n", current);
// search the wallpapers directory for .DD files
tmpde1 = FilesFind("~/Wallpapers/1024/*.DD", 1);
if (tmpde1) {
do {
max++;
tmpde1 = tmpde1->next;
} while (tmpde1);
}
// move to the next/previous wallpaper
current += direction;
if (current < 1)
current = max; // wrap around to the end
if (current > max)
current = 1; // wrap around to the start
// write the new current index back to the registry
RegWrite("Wallpapers/Current", "%d;\n", current);
// SysLog("Current: %d\n", current);
// Change the wallpaper
Sys("WallPaperDolDocInit(\"~/Wallpapers/1024/%d.DD\");\n", current);
}
U0 WallPaperDolDocInit(I64 filepath="::/Home/Wallpapers/Default.DD")
{
if (Fs != sys_task)

View file

@ -705,6 +705,7 @@ U0 Telnet(U8 *host=NULL, U16 port=TELNET_PORT) {
term.window_width = 80;
term.window_height = 25;
term.doc = Fs->display_doc;
// IsEditableText(term.doc->cur_entry);
term.waiting_for_input = TRUE;
term.sock_ready = 0;
I64 art_path = "::/Home/Net/Programs/Telnet/Art/TelnetSplash.ans";

View file

@ -38,15 +38,15 @@
U0 TelnetRequest(I64 sock, U8 option_code)
{
U8 request[3];
request[0] = IAC;
request[1] = WILL;
request[2] = option_code;
// U0 TelnetRequest(I64 sock, U8 option_code)
// {
// U8 request[3];
// request[0] = IAC;
// request[1] = WILL;
// request[2] = option_code;
TCPSocketSend(sock, request, 3);
}
// TCPSocketSend(sock, request, 3);
// }
U0 SendWindowSize(I64 sock, U16 cols, U16 rows)
{