TH3-Color themes » History » Version 2
Wil van Antwerpen, 06/03/2019 01:53 PM
1 | 1 | Wil van Antwerpen | # Color themes |
---|---|---|---|
2 | 1 | Wil van Antwerpen | |
3 | 1 | Wil van Antwerpen | The Hammer comes with the following default color themes: |
4 | 1 | Wil van Antwerpen | |
5 | 1 | Wil van Antwerpen | * White |
6 | 1 | Wil van Antwerpen | * Black |
7 | 1 | Wil van Antwerpen | * Blue |
8 | 1 | Wil van Antwerpen | * Lime |
9 | 1 | Wil van Antwerpen | * Sahara |
10 | 1 | Wil van Antwerpen | * Serene |
11 | 1 | Wil van Antwerpen | |
12 | 1 | Wil van Antwerpen | In order to select a different theme you go in the menu to: File -> Hammer Options -> Editor tab page -> Colorer |
13 | 1 | Wil van Antwerpen | You can select from the predefined color schemes via the Color Scheme name comboform |
14 | 1 | Wil van Antwerpen | |
15 | 1 | Wil van Antwerpen | It is also possible to create your own theme and save it under your own name. For this use the "New" button. |
16 | 1 | Wil van Antwerpen | |
17 | 1 | Wil van Antwerpen | ## Adding a custom theme as a new default |
18 | 1 | Wil van Antwerpen | |
19 | 1 | Wil van Antwerpen | If you created your own theme and you like it a lot then we would love to add it as another default theme to the list. |
20 | 1 | Wil van Antwerpen | |
21 | 2 | Wil van Antwerpen | Below are the steps needed to do so yourself. They are also notes for us :) |
22 | 2 | Wil van Antwerpen | |
23 | 2 | Wil van Antwerpen | ### Locate your new theme details |
24 | 1 | Wil van Antwerpen | When you create a theme or customize it, the details for that theme are saved in the Hammer configuration file which can be found under the Hammer\Data folder. |
25 | 1 | Wil van Antwerpen | The filename is CODEMAXEDIT<username>.ini where username is your windows login name. |
26 | 1 | Wil van Antwerpen | If your windows login is "John" then the filename will be CODEMAXEDITJohn.ini |
27 | 1 | Wil van Antwerpen | |
28 | 1 | Wil van Antwerpen | Open that file and search for a line that starts with "PSCOLOR," |
29 | 1 | Wil van Antwerpen | |
30 | 2 | Wil van Antwerpen | Copy the text after "PCSCOLOR," from that line. |
31 | 1 | Wil van Antwerpen | |
32 | 2 | Wil van Antwerpen | ### Change the Hammer source to include the new theme |
33 | 2 | Wil van Antwerpen | |
34 | 1 | Wil van Antwerpen | Now in the Hammer source files look for a file Hammer\Pkg\THColorer.h and search for the following line: |
35 | 1 | Wil van Antwerpen | |
36 | 1 | Wil van Antwerpen | ~~~ |
37 | 1 | Wil van Antwerpen | Define TH_DEFSCHEMA_SAHARA_STR for "Default (Sahara)" |
38 | 1 | Wil van Antwerpen | ~~~ |
39 | 1 | Wil van Antwerpen | |
40 | 1 | Wil van Antwerpen | You can add your own code name for the new theme there, in a new line underneath, let's call our new theme "DEMO", so that it looks like this: |
41 | 1 | Wil van Antwerpen | |
42 | 1 | Wil van Antwerpen | ~~~ |
43 | 1 | Wil van Antwerpen | Define TH_DEFSCHEMA_SAHARA_STR for "Default (Sahara)" |
44 | 1 | Wil van Antwerpen | Define TH_DEFSCHEMA_DEMO_STR for "Default (Demo)" |
45 | 1 | Wil van Antwerpen | ~~~ |
46 | 1 | Wil van Antwerpen | |
47 | 1 | Wil van Antwerpen | Then look for the actual theme data a few lines down: |
48 | 1 | Wil van Antwerpen | |
49 | 1 | Wil van Antwerpen | ~~~ |
50 | 1 | Wil van Antwerpen | Define TH_COLORSCHEMA_SAHARA for "255255187000220225240000255255255255255255187000000000000000255255187000255000255000255255187000000000255000255255187000255000000000255255187000000000255000255255187000000128000000255255187000255000128000255255187000000128128000255255187000255000000000255255187000000000255000255255187000128000000000255255187000105105105000190200225000255255255255192192192000220225240000128128128000255215215000000000000000200225255000255255000000255035035000000128128000255255187000170195240000215107000000255255187000000,000000000000000000000000000000000000000000000001000000" |
51 | 1 | Wil van Antwerpen | ~~~ |
52 | 1 | Wil van Antwerpen | |
53 | 1 | Wil van Antwerpen | and copy the line of data from your config file in there like so: |
54 | 1 | Wil van Antwerpen | |
55 | 1 | Wil van Antwerpen | ~~~ |
56 | 1 | Wil van Antwerpen | Define TH_COLORSCHEMA_SAHARA for "255255187000220225240000255255255255255255187000000000000000255255187000255000255000255255187000000000255000255255187000255000000000255255187000000000255000255255187000000128000000255255187000255000128000255255187000000128128000255255187000255000000000255255187000000000255000255255187000128000000000255255187000105105105000190200225000255255255255192192192000220225240000128128128000255215215000000000000000200225255000255255000000255035035000000128128000255255187000170195240000215107000000255255187000000,000000000000000000000000000000000000000000000001000000" |
57 | 1 | Wil van Antwerpen | Define TH_COLORSCHEMA_DEMO for "025025025000120120120000255255255255255255255255255255255000025025025000255185255000025025025000140215240000025025025000255108108000025025025000140215240000025025025000187255187000025025025000192192192000025025025000000128128000255255255255255000000000255255255255000000255000255255255255128000000000255255255255192192192000080080080000255255255255192192192000105105105000090090090000255215215000000000000000200225255000255255000000255000000000202255255000025025025000000000170000255190120000025025025000000" |
58 | 1 | Wil van Antwerpen | ~~~ |
59 | 1 | Wil van Antwerpen | |
60 | 2 | Wil van Antwerpen | As you see our demo theme is shorter. This is fine, it just means that we didn't set a custom font. |
61 | 2 | Wil van Antwerpen | |
62 | 2 | Wil van Antwerpen | Adding the new defaults to the header file is the first step, next up is adding this new theme to the UI. |
63 | 1 | Wil van Antwerpen | |
64 | 1 | Wil van Antwerpen | For that go to file Hammer\AppSrc\Tools\THParameters.dg |
65 | 1 | Wil van Antwerpen | |
66 | 1 | Wil van Antwerpen | In Object oSchemaSelect, procedure Combo_Fill_List |
67 | 1 | Wil van Antwerpen | |
68 | 1 | Wil van Antwerpen | Under line: |
69 | 1 | Wil van Antwerpen | |
70 | 1 | Wil van Antwerpen | ~~~ |
71 | 1 | Wil van Antwerpen | Send Combo_Add_Item TH_DEFSCHEMA_SAHARA_STR |
72 | 1 | Wil van Antwerpen | ~~~ |
73 | 1 | Wil van Antwerpen | |
74 | 1 | Wil van Antwerpen | add the new theme: |
75 | 1 | Wil van Antwerpen | |
76 | 1 | Wil van Antwerpen | ~~~ |
77 | 1 | Wil van Antwerpen | Send Combo_Add_Item TH_DEFSCHEMA_SAHARA_STR |
78 | 1 | Wil van Antwerpen | Send Combo_Add_Item TH_DEFSCHEMA_DEMO_STR |
79 | 1 | Wil van Antwerpen | ~~~ |
80 | 1 | Wil van Antwerpen | |
81 | 1 | Wil van Antwerpen | also Object oSchemaSelect, procedure OnChange |
82 | 1 | Wil van Antwerpen | |
83 | 1 | Wil van Antwerpen | Under line: |
84 | 1 | Wil van Antwerpen | |
85 | 1 | Wil van Antwerpen | ~~~ |
86 | 1 | Wil van Antwerpen | Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA To sSchema |
87 | 1 | Wil van Antwerpen | ~~~ |
88 | 1 | Wil van Antwerpen | |
89 | 1 | Wil van Antwerpen | add your new theme |
90 | 1 | Wil van Antwerpen | |
91 | 1 | Wil van Antwerpen | ~~~ |
92 | 1 | Wil van Antwerpen | Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA To sSchema |
93 | 1 | Wil van Antwerpen | Else If (sName=TH_DEFSCHEMA_DEMO_STR) Move TH_COLORSCHEMA_DEMO To sSchema |
94 | 1 | Wil van Antwerpen | ~~~ |
95 | 1 | Wil van Antwerpen | |
96 | 1 | Wil van Antwerpen | same method, but a few lines down: |
97 | 1 | Wil van Antwerpen | |
98 | 1 | Wil van Antwerpen | ~~~ |
99 | 1 | Wil van Antwerpen | Move (not((sName=TH_DEFSCHEMA_BLACK_STR) or ; |
100 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_WHITE_STR) or ; |
101 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_BLUE_STR) or ; |
102 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_SERENE_STR) or ; |
103 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_SAHARA_STR) or ; |
104 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_LIME_STR))) ; |
105 | 1 | Wil van Antwerpen | to iDisableManageButtons |
106 | 1 | Wil van Antwerpen | ~~~ |
107 | 1 | Wil van Antwerpen | |
108 | 1 | Wil van Antwerpen | change into: |
109 | 1 | Wil van Antwerpen | |
110 | 1 | Wil van Antwerpen | ~~~ |
111 | 1 | Wil van Antwerpen | Move (not((sName=TH_DEFSCHEMA_BLACK_STR) or ; |
112 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_WHITE_STR) or ; |
113 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_BLUE_STR) or ; |
114 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_SERENE_STR) or ; |
115 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_SAHARA_STR) or ; |
116 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_DEMO_STR) or ; |
117 | 1 | Wil van Antwerpen | (sName=TH_DEFSCHEMA_LIME_STR))) ; |
118 | 1 | Wil van Antwerpen | to iDisableManageButtons |
119 | 1 | Wil van Antwerpen | ~~~ |
120 | 1 | Wil van Antwerpen | |
121 | 1 | Wil van Antwerpen | Then in oSchemaDelete, procedure onClick |
122 | 1 | Wil van Antwerpen | |
123 | 1 | Wil van Antwerpen | ~~~ |
124 | 1 | Wil van Antwerpen | If (sName=TH_DEFSCHEMA_BLACK_STR or sName=TH_DEFSCHEMA_WHITE_STR or sName=TH_DEFSCHEMA_BLUE_STR or sName=TH_DEFSCHEMA_LIME_STR or sName=TH_DEFSCHEMA_SERENE_STR or sName=TH_DEFSCHEMA_SAHARA_STR) Begin |
125 | 1 | Wil van Antwerpen | ~~~ |
126 | 1 | Wil van Antwerpen | |
127 | 1 | Wil van Antwerpen | add your theme: |
128 | 1 | Wil van Antwerpen | |
129 | 1 | Wil van Antwerpen | ~~~ |
130 | 1 | Wil van Antwerpen | If (sName=TH_DEFSCHEMA_BLACK_STR or sName=TH_DEFSCHEMA_WHITE_STR or sName=TH_DEFSCHEMA_BLUE_STR or sName=TH_DEFSCHEMA_LIME_STR or sName=TH_DEFSCHEMA_SERENE_STR or sName=TH_DEFSCHEMA_SAHARA_STR or sName=TH_DEFSCHEMA_DEMO_STR) Begin |
131 | 1 | Wil van Antwerpen | ~~~ |
132 | 1 | Wil van Antwerpen | |
133 | 1 | Wil van Antwerpen | Next in oSchemaDefault button, procedure onClick |
134 | 1 | Wil van Antwerpen | |
135 | 1 | Wil van Antwerpen | add under line: |
136 | 1 | Wil van Antwerpen | |
137 | 1 | Wil van Antwerpen | ~~~ |
138 | 1 | Wil van Antwerpen | Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA To sColors |
139 | 1 | Wil van Antwerpen | ~~~ |
140 | 1 | Wil van Antwerpen | |
141 | 1 | Wil van Antwerpen | your own colors: |
142 | 1 | Wil van Antwerpen | |
143 | 1 | Wil van Antwerpen | ~~~ |
144 | 1 | Wil van Antwerpen | Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA To sColors |
145 | 1 | Wil van Antwerpen | Else If (sName=TH_DEFSCHEMA_DEMO_STR) Move TH_COLORSCHEMA_DEMO To sColors |
146 | 1 | Wil van Antwerpen | ~~~ |
147 | 1 | Wil van Antwerpen | |
148 | 1 | Wil van Antwerpen | And finally in Procedure SaveEntries: |
149 | 1 | Wil van Antwerpen | |
150 | 1 | Wil van Antwerpen | locate this part: |
151 | 1 | Wil van Antwerpen | |
152 | 1 | Wil van Antwerpen | ~~~ |
153 | 1 | Wil van Antwerpen | If ((sSchemaName<>TH_DEFSCHEMA_BLACK_STR) and ; |
154 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_WHITE_STR) and ; |
155 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_BLUE_STR) and ; |
156 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_SERENE_STR) and ; |
157 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_SAHARA_STR) and ; |
158 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_LIME_STR)) Begin |
159 | 1 | Wil van Antwerpen | ~~~ |
160 | 1 | Wil van Antwerpen | |
161 | 1 | Wil van Antwerpen | and add your own: |
162 | 1 | Wil van Antwerpen | |
163 | 1 | Wil van Antwerpen | ~~~ |
164 | 1 | Wil van Antwerpen | If ((sSchemaName<>TH_DEFSCHEMA_BLACK_STR) and ; |
165 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_WHITE_STR) and ; |
166 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_BLUE_STR) and ; |
167 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_SERENE_STR) and ; |
168 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_SAHARA_STR) and ; |
169 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_DEMO_STR) and ; |
170 | 1 | Wil van Antwerpen | (sSchemaName<>TH_DEFSCHEMA_LIME_STR)) Begin |
171 | 1 | Wil van Antwerpen | ~~~ |
172 | 1 | Wil van Antwerpen | |
173 | 1 | Wil van Antwerpen | Congratulations! |
174 | 1 | Wil van Antwerpen | If you now close the Hammer and recompile your new color theme should show up and you can select it as a default theme. |