Jump to content
Sign in to follow this  
noubernou

Extending/Overiding RscMapControl to set maxSatelliteAlpha to 0?

Recommended Posts

Is this possible, I am trying it right now, I just basically made an addon with just the config.cpp having this in it:

class RscMapControl  {
moveOnEdges = 1;
x = "SafeZoneXAbs";
y = "SafeZoneY";
w = "SafeZoneWAbs";
h = "SafeZoneH";
ptsPerSquareSea = 8;
ptsPerSquareTxt = 10;
ptsPerSquareCLn = 10;
ptsPerSquareExp = 10;
ptsPerSquareCost = 10;
ptsPerSquareFor = "6.0f";
ptsPerSquareForEdge = "15.0f";
ptsPerSquareRoad = "3f";
ptsPerSquareObj = 15;
showCountourInterval = "false";
maxSatelliteAlpha = 0;
alphaFadeStartScale = 0.150000;
alphaFadeEndScale = 0.290000;
colorLevels[] = {0.650000,0.600000,0.450000,1 };
colorSea[] = {0.460000,0.650000,0.740000,0.500000 };
colorForest[] = {0.450000,0.640000,0.330000,0.500000 };
colorRocks[] = {0,0,0,0.300000 };
colorCountlines[] = {0.850000,0.800000,0.650000,1 };
colorMainCountlines[] = {0.450000,0.400000,0.250000,1 };
colorCountlinesWater[] = {0.250000,0.400000,0.500000,0.300000 };
colorMainCountlinesWater[] = {0.250000,0.400000,0.500000,0.900000 };
colorPowerLines[] = {0.100000,0.100000,0.100000,1 };
colorRailWay[] = {0.800000,0.200000,0,1 };
colorForestBorder[] = {0,0,0,0 };
colorRocksBorder[] = {0,0,0,0 };
colorNames[] = {0.100000,0.100000,0.100000,0.900000 };
colorInactive[] = {1,1,1,0.500000 };
colorOutside[] = {0,0,0,1 };
fontLabel = "Zeppelin32";
sizeExLabel = 0.034000;
fontGrid = "Zeppelin32";
sizeExGrid = 0.030000;
fontUnits = "Zeppelin32";
sizeExUnits = 0.034000;
fontNames = "Zeppelin32";
sizeExNames = 0.056000;
fontInfo = "Zeppelin32";
sizeExInfo = 0.034000;
fontLevel = "Zeppelin32";
sizeExLevel = 0.024000;
text = "\ca\ui\data\map_background2_co.paa";

class Task  {
	icon = "\ca\ui\data\ui_taskstate_current_CA.paa";
	iconCreated = "\ca\ui\data\ui_taskstate_new_CA.paa";
	iconCanceled = "#(argb,8,8,3)color(0,0,0,0)";
	iconDone = "\ca\ui\data\ui_taskstate_done_CA.paa";
	iconFailed = "\ca\ui\data\ui_taskstate_failed_CA.paa";
	color[] = {0.863000,0.584000,0.000000,1 };
	colorCreated[] = {0.950000,0.950000,0.950000,1 };
	colorCanceled[] = {0.606000,0.606000,0.606000,1 };
	colorDone[] = {0.424000,0.651000,0.247000,1 };
	colorFailed[] = {0.706000,0.074500,0.019600,1 };
	size = 27;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
};

class CustomMark  {
	icon = "\ca\ui\data\map_waypoint_ca.paa";
	color[] = {0.647100,0.670600,0.623500,1.000000 };
	size = 18;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
};

class Legend  {
	x = "SafeZoneX";
	y = "SafeZoneY";
	w = 0.340000;
	h = 0.152000;
	font = "Zeppelin32";
	sizeEx = 0.039210;
	colorBackground[] = {0.906000,0.901000,0.880000,0 };
	color[] = {0,0,0,1 };
};

class Bunker  {
	icon = "\ca\ui\data\map_bunker_ca.paa";
	size = 14;
	importance = "1.5 * 14 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Bush  {
	icon = "\ca\ui\data\map_bush_ca.paa";
	color[] = {0.450000,0.640000,0.330000,0.400000 };
	size = 14;
	importance = "0.2 * 14 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class BusStop  {
	icon = "\ca\ui\data\map_busstop_ca.paa";
	color[] = {0.150000,0.260000,0.870000,1 };
	size = 12;
	importance = "1 * 10 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Command  {
	icon = "\ca\ui\data\map_waypoint_ca.paa";
	color[] = {0,0.900000,0,1 };
	size = 18;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
};

class Cross  {
	icon = "\ca\ui\data\map_cross_ca.paa";
	size = 16;
	color[] = {0,0.900000,0,1 };
	importance = "0.7 * 16 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Fortress  {
	icon = "\ca\ui\data\map_bunker_ca.paa";
	size = 16;
	color[] = {0,0.900000,0,1 };
	importance = "2 * 16 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Fuelstation  {
	icon = "\ca\ui\data\map_fuelstation_ca.paa";
	size = 16;
	color[] = {0,0.900000,0,1 };
	importance = "2 * 16 * 0.05";
	coefMin = 0.750000;
	coefMax = 4;
};

class Fountain  {
	icon = "\ca\ui\data\map_fountain_ca.paa";
	color[] = {0.200000,0.450000,0.700000,1 };
	size = 11;
	importance = "1 * 12 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Hospital  {
	icon = "\ca\ui\data\map_hospital_ca.paa";
	color[] = {0.780000,0,0.050000,1 };
	size = 16;
	importance = "2 * 16 * 0.05";
	coefMin = 0.500000;
	coefMax = 4;
};

class Chapel  {
	icon = "\ca\ui\data\map_chapel_ca.paa";
	size = 16;
	importance = "1 * 16 * 0.05";
	coefMin = 0.900000;
	coefMax = 4;
};

class Church  {
	icon = "\ca\ui\data\map_church_ca.paa";
	size = 16;
	color[] = {0,0.900000,0,1 };
	importance = "2 * 16 * 0.05";
	coefMin = 0.900000;
	coefMax = 4;
};

class Lighthouse  {
	icon = "\ca\ui\data\map_lighthouse_ca.paa";
	size = 14;
	color[] = {0,0.900000,0,1 };
	importance = "3 * 16 * 0.05";
	coefMin = 0.900000;
	coefMax = 4;
};

class Quay  {
	icon = "\ca\ui\data\map_quay_ca.paa";
	size = 16;
	color[] = {0,0.900000,0,1 };
	importance = "2 * 16 * 0.05";
	coefMin = 0.500000;
	coefMax = 4;
};

class Rock  {
	icon = "\ca\ui\data\map_rock_ca.paa";
	color[] = {0.100000,0.100000,0.100000,0.800000 };
	size = 12;
	importance = "0.5 * 12 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Ruin  {
	icon = "\ca\ui\data\map_ruin_ca.paa";
	size = 16;
	color[] = {0,0.900000,0,1 };
	importance = "1.2 * 16 * 0.05";
	coefMin = 1;
	coefMax = 4;
};

class SmallTree  {
	icon = "\ca\ui\data\map_smalltree_ca.paa";
	color[] = {0.450000,0.640000,0.330000,0.400000 };
	size = 12;
	importance = "0.6 * 12 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Stack  {
	icon = "\ca\ui\data\map_stack_ca.paa";
	size = 20;
	color[] = {0,0.900000,0,1 };
	importance = "2 * 16 * 0.05";
	coefMin = 0.900000;
	coefMax = 4;
};

class Tree  {
	icon = "\ca\ui\data\map_tree_ca.paa";
	color[] = {0.450000,0.640000,0.330000,0.400000 };
	size = 12;
	importance = "0.9 * 16 * 0.05";
	coefMin = 0.250000;
	coefMax = 4;
};

class Tourism  {
	icon = "\ca\ui\data\map_tourism_ca.paa";
	size = 16;
	importance = "1 * 16 * 0.05";
	coefMin = 0.700000;
	coefMax = 4;
};

class Transmitter  {
	icon = "\ca\ui\data\map_transmitter_ca.paa";
	color[] = {0,0.900000,0,1 };
	size = 20;
	importance = "2 * 16 * 0.05";
	coefMin = 0.900000;
	coefMax = 4;
};

class ViewTower  {
	icon = "\ca\ui\data\map_viewtower_ca.paa";
	color[] = {0,0.900000,0,1 };
	size = 16;
	importance = "2.5 * 16 * 0.05";
	coefMin = 0.500000;
	coefMax = 4;
};

class Watertower  {
	icon = "\ca\ui\data\map_watertower_ca.paa";
	color[] = {0.200000,0.450000,0.700000,1 };
	size = 20;
	importance = "1.2 * 16 * 0.05";
	coefMin = 0.900000;
	coefMax = 4;
};

class Waypoint  {
	icon = "\ca\ui\data\map_waypoint_ca.paa";
};

class WaypointCompleted  {
	icon = "\ca\ui\data\map_waypoint_completed_ca.paa";
};
};

class RscMap  {
access = 0;

class controls  {

	class Map  : RscMapControl {
		moveOnEdges = 0;
		x = "SafeZoneXAbs";
		y = "SafeZoneY";
		w = "SafeZoneWAbs";
		h = "SafeZoneH";
                                maxSatelliteAlpha = 0;
	};
};
};
class CA_Black_Back;
class RscDisplayMainMap  {
saveParams = 1;

class controlsBackground  {

	class Map; //Extended

	class CA_Black  : CA_Black_Back {
	};

	class CA_Map  : RscMapControl {
		x = "SafeZoneXAbs";
		y = "SafeZoneY";
		w = "SafeZoneWAbs";
		h = "SafeZoneH";
                                maxSatelliteAlpha = 0;
	};
};

class controls;

class objects;
};

Nothing seems to have changed at all....

I would really like to not see the map texture on the map, it makes figuring altitude out to be a pain in the butt because the contour lines get obscured in the terrain textures.

Share this post


Link to post
Share on other sites

a) cfgPatches missing

b) Most important requiredAddons missing (you need to make your addon loaded AFTER BI's pbos

c) Only copy different values to your addon. Not a huge copy and paste.

Why - check the BC6 thread for explanations.

Share this post


Link to post
Share on other sites

Wow, I feel retarded... I actually have done that in the past... I just looked at the config.cpp in the UI pbo and was like "well this should work, its how they do it!" but yea...

Thanks kju!!!

Now to make reading contour lines not be so friggin hard!

---------- Post added at 12:09 AM ---------- Previous post was Yesterday at 11:37 PM ----------

Doe anyone know what showCountourInterval does?

Share this post


Link to post
Share on other sites

if the terrain height lines should be drawn from I can recall

Share this post


Link to post
Share on other sites

it seems to do nothing, its false in the main one and its never turned to true anywhere else... I left it be.

This is so much better now!

map_clear.jpg

Share this post


Link to post
Share on other sites

Now I am integrating some scripts I have used in missions in the past to draw rulers and compasses on the screen, but to be honest I am probably doing it in a horrible way that will break things in other addons.

I am adding event handlers to the map control...

((findDisplay 12) displayCtrl 51) ctrlSetEventHandler ["MouseButtonClick", "[player, _this] call nouRulerHandler"];
((findDisplay 12) displayCtrl 51) ctrlSetEventHandler ["keyDown", "[player, _this, true] call nouKeyBoardHandler"];
((findDisplay 12) displayCtrl 51) ctrlSetEventHandler ["keyUp", "[player, _this, false] call nouKeyBoardHandler"];

I am then look for the keycodes for H, J, K, L, [, and ] use those as controls to draw/clear a ruler, compass and line segments (though I am still looking for a decent key to assign to remove line segments).

Is it kosher to add event handlers like that? They work, I know that, but I mean for compatibility with other addons, or is that just something that can't really be avoided?

Also this isn't stuff nearly as complex as that one addon for ArmA that let you free draw on the map, this is just basic stuff to help do LANDNAV and polar plots and stuff.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×