| 1203 | } |
| 1204 | |
| 1205 | bool CUIXmlInit::InitMultiTexture(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) |
| 1206 | { |
| 1207 | string256 buff; |
| 1208 | bool success = false; |
| 1209 | |
| 1210 | strconcat(sizeof(buff), buff, path, ":texture"); |
| 1211 | shared_str texture = xml_doc.Read(buff, index, NULL); |
| 1212 | |
| 1213 | if (texture.size() > 0) |
| 1214 | { |
| 1215 | pWnd->InitTexture(*texture); |
| 1216 | return true; |
| 1217 | } |
| 1218 | |
| 1219 | strconcat(sizeof(buff), buff, path, ":texture_e"); |
| 1220 | texture = xml_doc.Read(buff, index, NULL); |
| 1221 | if (texture.size()) |
| 1222 | { |
| 1223 | auto e = pWnd->m_background.CreateE(); |
| 1224 | e->InitTexture(*texture); |
| 1225 | success = true; |
| 1226 | } |
| 1227 | |
| 1228 | strconcat(sizeof(buff), buff, path, ":texture_t"); |
| 1229 | texture = xml_doc.Read(buff, index, NULL); |
| 1230 | if (texture.size()) |
| 1231 | { |
| 1232 | auto t = pWnd->m_background.CreateT(); |
| 1233 | t->InitTexture(*texture); |
| 1234 | success = true; |
| 1235 | } |
| 1236 | |
| 1237 | strconcat(sizeof(buff), buff, path, ":texture_d"); |
| 1238 | texture = xml_doc.Read(buff, index, NULL); |
| 1239 | if (texture.size()) |
| 1240 | { |
| 1241 | auto d = pWnd->m_background.CreateD(); |
| 1242 | d->InitTexture(*texture); |
| 1243 | success = true; |
| 1244 | } |
| 1245 | |
| 1246 | strconcat(sizeof(buff), buff, path, ":texture_h"); |
| 1247 | texture = xml_doc.Read(buff, index, NULL); |
| 1248 | if (texture.size()) |
| 1249 | { |
| 1250 | auto h = pWnd->m_background.CreateH(); |
| 1251 | h->InitTexture(*texture); |
| 1252 | success = true; |
| 1253 | } |
| 1254 | |
| 1255 | if (success) |
| 1256 | { |
| 1257 | pWnd->TextureOn(); |
| 1258 | } |
| 1259 | |
| 1260 | return success; |
| 1261 | } |
| 1262 | |