OSDN Git Service

・スレタイの特定ワードを非表示にする機能に「©bbspink.com」も追加
[gikonavigoeson/gikonavi.git] / GikoMessage.pas
1 unit GikoMessage;
2
3 interface
4
5 uses
6         Classes, IniFiles;
7
8 type
9         //! MessageList
10         TGikoMessageListType = (gmLogout, gmLogin, gmForceLogin, gmSureItiran,
11                         gmUnKnown, gmSureSyutoku, gmSureDiff, gmNotMod, gmAbort, gmError,
12                         gmNewRes, gmNewSure, gmResError, gmSureError, gmBeLogout, gmBeLogin);
13
14         TGikoMessage = class(THashedStringList)
15         private
16         public
17                 constructor Create;
18                 function GetMessage(MesType: TGikoMessageListType): String;
19         end;
20
21 implementation
22
23 const
24         DEF_MESSAGES : array[0..15] of string = (  '\83\8d\83O\83A\83E\83g\82µ\82Ü\82µ\82½',
25                                                                                            '\83\8d\83O\83C\83\93\82µ\82Ü\82µ\82½ - ',
26                                                                                            '\8b­\90§\83\8d\83O\83C\83\93\82µ\82Ü\82µ\82½ - ',
27                                                                                            '[\83X\83\8c\88ê\97\97\8eæ\93¾\8a®\97¹]',
28                                                                                            '(\96¼\8fÌ\95s\96¾\81j',
29                                                                                            '[\83X\83\8c\8eæ\93¾\8a®\97¹]',
30                                                                                            '[\83X\83\8c\8d·\95ª\8eæ\93¾\8a®\97¹]',
31                                                                                            '[\96¢\8dX\90V]',
32                                                                                            '[\92\86\92f]',
33                                                                                            '[\83G\83\89\81[]',
34                                                                                            '[\83\8c\83X\91\97\90M\8fI\97¹]',
35                                                                                            '[\90V\83X\83\8c\91\97\90M\8fI\97¹]',
36                                                                                            '[\83\8c\83X\91\97\90M\8e¸\94s]',
37                                                                                            '[\90V\83X\83\8c\91\97\90M\8e¸\94s]',
38                                                'BE\83\8d\83O\83A\83E\83g\82µ\82Ü\82µ\82½',
39                                                                                            'BE\83\8d\83O\83C\83\93\82µ\82Ü\82µ\82½ - ');
40
41         MESSAGE_KEYS : array[0..15] of String = ( 'Logout', 'Login',
42                                                                                         'ForceLogin', 'SureItiran',
43                                                                                         'UnKnown', 'SureSyutoku',
44                                                                                         'SureDiff', 'NotMod',
45                                                                                         'Abort', 'Error',
46                                                                                         'NewRes', 'NewSure',
47                                                                                         'ResError', 'SureError',
48                                             'BELogout', 'BELogin');
49
50 constructor TGikoMessage.Create;
51 begin
52         inherited Create;
53         Self.Sorted := true;
54         Self.Duplicates := dupIgnore;
55 end;
56 //! MesType\82Å\8ew\92è\82³\82ê\82½\83\81\83b\83Z\81[\83W\95\8e\9a\97ñ\82ð\8eæ\93¾\82·\82é
57 function TGikoMessage.GetMessage(MesType: TGikoMessageListType): String;
58 begin
59         Result := '';
60         if MesType in [gmLogout..gmBeLogin] then begin
61                 //Key\82Å\8c\9f\8dõ\82µ\82Ä\8c©\82Â\82©\82ê\82Î\82»\82ê\82ð\95Ô\82·
62                 Result := Self.Values[MESSAGE_KEYS[Ord(MesType)]];
63                 if Result = '' then begin
64                         //\8c©\82Â\82©\82ç\82È\82¢\82Ì\82Å\81A\83f\83t\83H\83\8b\83g\82Å\95Ô\82·
65                         Result := DEF_MESSAGES[Ord(MesType)];
66                 end;
67         end;
68 end;
69
70 end.
71