Revision | 17 (tree) |
---|---|
Time | 2008-02-26 17:24:21 |
Author | ![]() |
送信フォームに自動レスアンカー。メニューにLAN切断追加。
@@ -35,7 +35,7 @@ | ||
35 | 35 | |
36 | 36 | int tateFlag = 0; |
37 | 37 | int sel = 0; |
38 | -const char* userAgent = "Monazilla/1.00 (Compatible; PSP; ja) owata\(^o^)/0.5.0"; | |
38 | +const char* userAgent = "Monazilla/1.00 (Compatible; PSP; ja) owata\(^o^)/0.5.1"; | |
39 | 39 | const char* logDir = "log"; |
40 | 40 | char cookie[128] = {0}; |
41 | 41 | char keyWords[128]; |
@@ -325,6 +325,11 @@ | ||
325 | 325 | return rMenu; |
326 | 326 | } |
327 | 327 | |
328 | +/***************************** | |
329 | +アナログパッドで横スクロール | |
330 | +xReverseを-1にするとスクロール方向が反転する | |
331 | +設定ファイル実装時に設定項目とする予定 | |
332 | +*****************************/ | |
328 | 333 | int psp2chPadSet(int scrollX) |
329 | 334 | { |
330 | 335 | static int xReverse = 1; |
@@ -478,7 +483,7 @@ | ||
478 | 483 | setColor("MENU_WIN_TEXT", menuWinColor.text, GRAY); |
479 | 484 | setColor("MENU_WIN_BG", menuWinColor.bg, BLACK); |
480 | 485 | setColor("MENU_WIN_S_TEXT", menuWinColor.s_text, WHITE); |
481 | - setColor("MENU_WIN_S_BG", menuWinColor.s_bg, RGB(0x33, 0x33, 0x33)); | |
486 | + setColor("MENU_WIN_S_BG", menuWinColor.s_bg, BLUE); | |
482 | 487 | free(buf); |
483 | 488 | return; |
484 | 489 | } |
@@ -564,7 +569,7 @@ | ||
564 | 569 | menuWinColor.text = GRAY; |
565 | 570 | menuWinColor.bg = BLACK; |
566 | 571 | menuWinColor.s_text = WHITE; |
567 | - menuWinColor.s_bg = RGB(0x33, 0x33, 0x33); | |
572 | + menuWinColor.s_bg = BLUE; | |
568 | 573 | } |
569 | 574 | |
570 | 575 | /*********************************** |
@@ -50,9 +50,11 @@ | ||
50 | 50 | S_2CH_URL_ANCHOR urlAnchor[50]; |
51 | 51 | S_2CH_RES_ANCHOR resAnchor[50]; |
52 | 52 | S_2CH_ID_ANCHOR idAnchor[40]; |
53 | +S_2CH_NUM_ANCHOR numAnchor[40]; | |
53 | 54 | int urlAnchorCount = 0; |
54 | 55 | int resAnchorCount = 0; |
55 | 56 | int idAnchorCount = 0; |
57 | +int numAnchorCount = 0; | |
56 | 58 | |
57 | 59 | static char jmpHost[32], jmpDir[32], jmpTitle[32]; |
58 | 60 | static int jmpDat; |
@@ -86,7 +88,7 @@ | ||
86 | 88 | char *p, *q; |
87 | 89 | static char* menuStr = ""; |
88 | 90 | int i, j, tmp; |
89 | - static int resMenu = -1, urlMenu = -1, idMenu = -1; | |
91 | + static int resMenu = -1, urlMenu = -1, idMenu = -1, numMenu = -1; | |
90 | 92 | int lineEnd, rMenu; |
91 | 93 | |
92 | 94 | if (tateFlag) |
@@ -248,6 +250,10 @@ | ||
248 | 250 | sceCtrlPeekBufferPositive(&oldPad, 1); |
249 | 251 | return 0; |
250 | 252 | } |
253 | + if (numMenu >= 0 && message[0] == '\0') | |
254 | + { | |
255 | + sprintf(message, ">>%d\n", numAnchor[numMenu].num + 1); | |
256 | + } | |
251 | 257 | if (psp2chForm(host, dir, dat, resList[0].title, message) == 1) |
252 | 258 | { |
253 | 259 | free(message); |
@@ -400,6 +406,20 @@ | ||
400 | 406 | idMenu = -1; |
401 | 407 | } |
402 | 408 | } |
409 | + // 番号の場所か | |
410 | + for (i = 0; i < 40; i++) | |
411 | + { | |
412 | + if (cursorY/LINE_PITCH+res.start == numAnchor[i].line && | |
413 | + cursorX > numAnchor[i].x1 && cursorX < numAnchor[i].x2) | |
414 | + { | |
415 | + numMenu = i; | |
416 | + break; | |
417 | + } | |
418 | + else | |
419 | + { | |
420 | + numMenu = -1; | |
421 | + } | |
422 | + } | |
403 | 423 | if (resMenu >= 0) |
404 | 424 | { |
405 | 425 | menuStr = " ○ : レス表\示 △ : レスに移動"; |
@@ -412,6 +432,10 @@ | ||
412 | 432 | { |
413 | 433 | menuStr = " ○ : ID抽出 □ : NGID登録"; |
414 | 434 | } |
435 | + else if (numMenu >= 0) | |
436 | + { | |
437 | + menuStr = " ○ : レスをする"; | |
438 | + } | |
415 | 439 | else if (rMenu) |
416 | 440 | { |
417 | 441 | // お気に入りリストにあるかチェック |
@@ -638,7 +662,7 @@ | ||
638 | 662 | else |
639 | 663 | { |
640 | 664 | dL = 16; |
641 | - dS = 8; | |
665 | + dS = 2; | |
642 | 666 | } |
643 | 667 | if (tateFlag) |
644 | 668 | { |
@@ -1283,6 +1307,9 @@ | ||
1283 | 1307 | pgCursorX = startX; |
1284 | 1308 | if (--(*skip) == 0) |
1285 | 1309 | { |
1310 | + numAnchor[numAnchorCount].x1 = pgCursorX; | |
1311 | + numAnchor[numAnchorCount].line = *drawLine; | |
1312 | + numAnchor[numAnchorCount].num = resList[re].num; | |
1286 | 1313 | pgFillvram(c.bg, startX, pgCursorY, endX-startX, LINE_PITCH); |
1287 | 1314 | line = psp2chDrawResStr(str, c, line, lineEnd, startX, endX, drawLine); |
1288 | 1315 | break; |
@@ -1291,9 +1318,18 @@ | ||
1291 | 1318 | } |
1292 | 1319 | else |
1293 | 1320 | { |
1321 | + numAnchor[numAnchorCount].x1 = pgCursorX; | |
1322 | + numAnchor[numAnchorCount].line = *drawLine; | |
1323 | + numAnchor[numAnchorCount].num = resList[re].num; | |
1294 | 1324 | pgFillvram(c.bg, startX, pgCursorY, endX-startX, LINE_PITCH); |
1295 | 1325 | line = psp2chDrawResStr(str, c, line, lineEnd, startX, endX, drawLine); |
1296 | 1326 | } |
1327 | + numAnchor[numAnchorCount].x2 = pgCursorX; | |
1328 | + numAnchorCount++; | |
1329 | + if (numAnchorCount >= 40) | |
1330 | + { | |
1331 | + numAnchorCount = 0; | |
1332 | + } | |
1297 | 1333 | sprintf(buf, "名前:"); |
1298 | 1334 | str = buf; |
1299 | 1335 | c.text = hc.name1; |
@@ -1395,7 +1431,7 @@ | ||
1395 | 1431 | c.text = hc.id1; |
1396 | 1432 | for (i = 0, j = 0; i < res.count; i++) |
1397 | 1433 | { |
1398 | - if (resList[i].id && (strcmp(resList[i].id, resList[re].id) == 0)) | |
1434 | + if (resList[i].id && resList[i].id[0] != '?' && (strcmp(resList[i].id, resList[re].id) == 0)) | |
1399 | 1435 | { |
1400 | 1436 | if (++j == ID_COUNT) |
1401 | 1437 | { |
@@ -1685,6 +1721,8 @@ | ||
1685 | 1721 | { |
1686 | 1722 | idAnchor[i].x1 = 0; |
1687 | 1723 | idAnchor[i].x2 = 0; |
1724 | + numAnchor[i].x1 = 0; | |
1725 | + numAnchor[i].x2 = 0; | |
1688 | 1726 | } |
1689 | 1727 | line = 0; |
1690 | 1728 | while (line <= lineEnd) |
@@ -51,6 +51,13 @@ | ||
51 | 51 | char id[12]; |
52 | 52 | } S_2CH_ID_ANCHOR; |
53 | 53 | |
54 | +typedef struct { | |
55 | + int x1; | |
56 | + int x2; | |
57 | + int line; | |
58 | + int num; | |
59 | +} S_2CH_NUM_ANCHOR; | |
60 | + | |
54 | 61 | int psp2chFavoriteRes(int ret); |
55 | 62 | int psp2chThreadRes(int ret); |
56 | 63 | int psp2chJumpRes(int ret); |
@@ -39,7 +39,7 @@ | ||
39 | 39 | #define MENU_ITEM (4) |
40 | 40 | int psp2chMenu(int pixelsX, int pixelsY) |
41 | 41 | { |
42 | - const char* menuList[] = {"NG設定"}; | |
42 | + const char* menuList[] = {"NG 設定", "LAN 切断"}; | |
43 | 43 | static char* menuStr = ""; |
44 | 44 | int lineEnd; |
45 | 45 | static S_2CH_SCREEN menu; |
@@ -57,7 +57,7 @@ | ||
57 | 57 | scrX = MENU_WIDTH; |
58 | 58 | scrY = MENU_HEIGHT; |
59 | 59 | lineEnd = MENU_ITEM; |
60 | - menu.count = 1; | |
60 | + menu.count = 2; | |
61 | 61 | printBuf = winPixels; |
62 | 62 | while (running) |
63 | 63 | { |
@@ -75,6 +75,7 @@ | ||
75 | 75 | psp2chMenuNG(pixelsX, pixelsY); |
76 | 76 | break; |
77 | 77 | case 1: |
78 | + sceNetApctlDisconnect(); | |
78 | 79 | break; |
79 | 80 | } |
80 | 81 | printBuf = pixels; |
@@ -192,7 +193,8 @@ | ||
192 | 193 | } |
193 | 194 | |
194 | 195 | /**************** |
195 | -NGファイルがあればバッファを確保し読み込んで返す | |
196 | +NGファイルがあればバッファを確保し | |
197 | +ファイル内容を読み込んで返す | |
196 | 198 | ****************/ |
197 | 199 | char* psp2chGetNGBuf(const char* file, char* buf) |
198 | 200 | { |