Skip to content

Instantly share code, notes, and snippets.

@pennyworth12345
Created February 3, 2017 12:22
Show Gist options
  • Save pennyworth12345/f15c69e820e55bef7f51cdbeb223f8de to your computer and use it in GitHub Desktop.
Save pennyworth12345/f15c69e820e55bef7f51cdbeb223f8de to your computer and use it in GitHub Desktop.
surfaceIcons = addMissionEventHandler ["Draw3D", {
_spacing = 0.5;
_size = 10;
_worldPos = screenToWorld getMousePosition;
_worldPos = [round (_worldPos select 0), round (_worldPos select 1), 0];
for "_i" from (_size * -1) to _size step _spacing do {
for "_j" from (_size * -1) to _size step _spacing do {
_pos = [(_worldPos select 0) + _i, (_worldPos select 1) + _j, 0];
_pos set [2, getTerrainHeightASL _pos];
_pos = ASLToAGL _pos;
_surface = surfaceType _pos;
_color = switch _surface do {
case "#CRGrit1": {[0.474509804, 0.392156863, 0.8, 1]};
case "#CRRock": {[0.419607843, 0.709803922, 0.254901961, 1]};
case "#CRGrass1": {[0.756862745, 0.329411765, 0.725490196, 1]};
case "#CRGrass2": {[0.356862745, 0.729411765, 0.505882353, 1]};
case "#CRGrassW1": {[0.823529412, 0.262745098, 0.462745098, 1]};
case "#CRGrassW2": {[0.247058824, 0.737254902, 0.756862745, 1]};
case "#CRForest1": {[0.807843137, 0.301960784, 0.192156863, 1]};
case "#CRForest2": {[0.415686275, 0.541176471, 0.8, 1]};
case "#CRHlina": {[0.807843137, 0.643137255, 0.196078431, 1]};
case "#CRMudGround": {[0.752941176, 0.462745098, 0.678431373, 1]};
case "#CRHeather": {[0.270588235, 0.474509804, 0.243137255, 1]};
case "#CRTarmac": {[0.725490196, 0.364705882, 0.376470588, 1]};
case "#CRConcrete": {[0.631372549, 0.662745098, 0.329411765, 1]};
case "#CRField1": {[0.843137255, 0.545098039, 0.341176471, 1]};
case "#CRField2": {[0.517647059, 0.411764706, 0.160784314, 1]};
default {[1, 1, 1, 1]};
};
drawIcon3D ["\a3\ui_f\data\gui\cfg\cursors\add_gs.paa", _color, _pos, 0.5, 0.5, 0];
};
};
}];
//removed with
removeMissionEventHandler ["Draw3D", surfaceIcons];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment