| 829 | Texture *e_wall = NULL, *e_floor = NULL, *e_ceil = NULL; |
| 830 | |
| 831 | void guidetoggle() |
| 832 | { |
| 833 | if(player1->state == CS_EDITING) |
| 834 | { |
| 835 | Slot *sw = &slots[DEFAULT_WALL]; |
| 836 | Slot *sf = &slots[DEFAULT_FLOOR]; |
| 837 | Slot *sc = &slots[DEFAULT_CEIL]; |
| 838 | |
| 839 | //if textures match original texture |
| 840 | if(e_wall == NULL || e_floor == NULL || e_ceil == NULL) |
| 841 | { |
| 842 | //replace defaults with grid texures |
| 843 | e_wall = sw->tex; |
| 844 | e_floor = sf->tex; |
| 845 | e_ceil = sc->tex; |
| 846 | sw->tex = textureload("packages/textures/map_editor/wall.png"); |
| 847 | sf->tex = textureload("packages/textures/map_editor/floor.png"); |
| 848 | sc->tex = textureload("packages/textures/map_editor/ceil.png"); |
| 849 | conoutf("Guide: \f0on"); |
| 850 | } |
| 851 | else |
| 852 | { |
| 853 | // restore textures |
| 854 | if(e_wall) sw->tex = e_wall; |
| 855 | if(e_floor) sf->tex = e_floor; |
| 856 | if(e_ceil) sc->tex = e_ceil; |
| 857 | e_wall = NULL; |
| 858 | e_floor = NULL; |
| 859 | e_ceil = NULL; |
| 860 | conoutf("Guide: \fBoff"); |
| 861 | } |
| 862 | } |
| 863 | else |
| 864 | { |
| 865 | conoutf("\fBGuide view is only available when editing."); |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | COMMAND(guidetoggle, ""); |
| 870 |
nothing calls this directly
no test coverage detected