Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# aradar v1.0
# aradar v1.2

## Description

Expand Down Expand Up @@ -34,12 +34,13 @@ If a _blip_ is beyond the visible distance of the radar, it will change into a p

The table below describes the various colors of _blips_:

| Color | Target | Technical |
| Default Color | Target | Technical |
|-------:|:-------|-----------|
| Red | Living monsters | Has `ISMONSTER` and `COUNTKILL` flags. |
| Blue | Living allies | Has `FRIENDLY` and `SHOOTABLE` flags. |
| Yellow | Key items / interactive objects | Derived from `Powerup` or `Key`, or has `USEPSECIAL` or `BUMPSECIAL` flags. |
| Green | Regular items | Derived from `Inventory` or has `COUNTITEM` flag. |
| Yellow | Key items / interactive objects | Derived from `Powerup` or `Key`, or has `USESPECIAL` or `BUMPSECIAL` flags. |
| Green | Regular items | Derived from `Inventory` and has no `COUNTITEM` flag. |
| Magenta | Collectible items | Derived from `Inventory` and has `COUNTITEM` flag. |
| White | Objects | Has either `SHOOTABLE` or `FRIENDLY` flag (but not both). |

### Pips
Expand Down Expand Up @@ -84,8 +85,11 @@ You can turn the radar on/off, change the appearance, and control specific featu
| _Enable in deathmatch_ | Enables players to see the radar even in deathmatch. This is a host setting and cheats must be enabled to turn this on. |
| _Draw under HUD_ | Whether the radar displays under or over existing HUD elements. |
| _Radar scale_ | Global display scale of the radar and indicators. |
| _Radar transparency_ | Radar's transparency (alpha channel) to tune its intrusiveness. |
| _Radar X offset_ | Horizontal offset of the radar display, in screen pixels. Positive values move radar towards the center of the screen. |
| _Radar Y offset_ | Vertical offset of the radar display, in screen pixels. Positive values move radar towards the center of the screen. |
| _Blip types_ | Enables/disables specific radar blip types. |
| _Blip colors_ | Allow the user to customize colors for each blip type. |
| _Show blip altitude_ | Turn this off to hide [altitude indicators](#altitude). This is useful for smaller screens. |
| _Show respawned items_ | If `sv_itemrespawn` is enabled, items are allowed to reappear on the radar after respawning. Turning this off will keep the item's _blip_ hidden after being picked up the first time. This option can help clean up the radar for larger maps with lots of items. |
| _Alert volume_ | Changes the volume of the [alert sound](#alert). Set to zero to turn the feature off entirely. |
38 changes: 29 additions & 9 deletions cvarinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,34 @@

// -------------------------------------------------------------------------- //

nosave int aradar_anchor = 1;
nosave int aradar_order = 0;
nosave int aradar_offset_x = 30;
nosave int aradar_offset_y = 30;
nosave float aradar_scale = 0.70;
nosave bool aradar_altitude = false;
nosave bool aradar_respawn = false;
nosave float aradar_volume = 1.0;
server cheat bool aradar_deathmatch = false;
nosave int aradar_anchor = 1;
nosave int aradar_order = 0;
nosave int aradar_offset_x = 30;
nosave int aradar_offset_y = 30;
nosave float aradar_scale = 0.70;
nosave float aradar_alpha = 1.0;
nosave bool aradar_blip_monster = true;
nosave bool aradar_blip_friend = true;
nosave bool aradar_blip_count = true;
nosave bool aradar_blip_key = true;
nosave bool aradar_blip_other = true;
nosave bool aradar_blip_deco = true;
nosave color aradar_blip_monster_color = "FA 07 03";
nosave color aradar_blip_friend_color = "00 C1 F7";
nosave color aradar_blip_count_color = "F5 07 F7";
nosave color aradar_blip_key_color = "F5 F7 1A";
nosave color aradar_blip_other_color = "02 FC 05";
nosave color aradar_blip_deco_color = "FF FF FF";
nosave bool aradar_altitude = false;
nosave bool aradar_respawn = false;
nosave float aradar_volume = 1.0;
server cheat bool aradar_deathmatch = false;

// -------------------------------------------------------------------------- //







23 changes: 23 additions & 0 deletions menudef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ OptionMenu "ARadarOptions" {
Slider "Radar scale", "aradar_scale", 0.25, 2.0, 0.05, 2, "aradar_anchor"
Slider "Radar X offset", "aradar_offset_x", -200, 200, 5, 0, "aradar_anchor"
Slider "Radar Y offset", "aradar_offset_y", -200, 200, 5, 0, "aradar_anchor"
Slider "Radar transparency", "aradar_alpha", 0, 1, 0.01, 2, "aradar_anchor"
StaticText ""
StaticText "Show blips for:"
Option "Monsters", "aradar_blip_monster", "OnOff", "aradar_anchor"
Option "Friendlies", "aradar_blip_friend", "OnOff", "aradar_anchor"
Option "Collectibles", "aradar_blip_count", "OnOff", "aradar_anchor"
Option "Keys, powerups and special items", "aradar_blip_key", "OnOff", "aradar_anchor"
Option "Other items", "aradar_blip_other", "OnOff", "aradar_anchor"
Option "Objects", "aradar_blip_deco", "OnOff", "aradar_anchor"
StaticText ""
SubMenu "Customize blip colors", "CustomizeColors"
StaticText ""
Option "Show blip altitude", "aradar_altitude", "NoYes", "aradar_anchor"
Option "Show respawned items", "aradar_respawn", "NoYes", "aradar_anchor"
Expand All @@ -45,5 +56,17 @@ OptionMenu "ARadarOptions" {

}

OptionMenu "CustomizeColors" {

StaticText "Blip colors:"
ColorPicker "Monsters", "aradar_blip_monster_color"
ColorPicker "Friendlies", "aradar_blip_friend_color"
ColorPicker "Collectibles", "aradar_blip_count_color"
ColorPicker "Keys, powerups and special items", "aradar_blip_key_color"
ColorPicker "Other items", "aradar_blip_other_color"
ColorPicker "Objects", "aradar_blip_deco_color"

}

// -------------------------------------------------------------------------- //

52 changes: 40 additions & 12 deletions zscript/arookas/radar/data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum ARadarBlipType {
ARADAR_BLIP_YELLOW,
ARADAR_BLIP_BLUE,
ARADAR_BLIP_RED,
ARADAR_BLIP_MAGENTA,

ARADAR_NUM_BLIPS

Expand Down Expand Up @@ -56,8 +57,13 @@ class ARadarBlip {
return ARADAR_BLIP_YELLOW;
}

if ((mo is 'Inventory') || mo.bCOUNTITEM) {
return ARADAR_BLIP_GREEN;
if (mo is 'Inventory')
{
if (mo.bCOUNTITEM) {
return ARADAR_BLIP_MAGENTA;
} else {
return ARADAR_BLIP_GREEN;
}
}

if (mo.bFRIENDLY) {
Expand Down Expand Up @@ -142,8 +148,12 @@ struct ARadarData {
int notices = 0;

for (uint i = 0; i < self.blips.Size(); ++i) {
if (!self.blips[i]) {
break;
}
if ((self.blips[i].flags & ARADAR_BLIPF_VISIBLE) != 0) {
switch (self.blips[i].type) {
case ARADAR_BLIP_MAGENTA:
case ARADAR_BLIP_GREEN:
case ARADAR_BLIP_YELLOW: {
break;
Expand All @@ -156,9 +166,12 @@ struct ARadarData {

Actor mo = self.blips[i].mo;

if (mo == null) {
continue;
}
if (ARadarBlip.DeduceType(self.blips[i].mo) < 0) {
--self.counts[self.blips[i].type];
self.blips.Delete(i);
--i;
continue;
}

switch (self.blips[i].type) {
case ARADAR_BLIP_RED: {
Expand All @@ -170,6 +183,7 @@ struct ARadarData {

break;
}
case ARADAR_BLIP_MAGENTA:
case ARADAR_BLIP_GREEN:
case ARADAR_BLIP_YELLOW: {
let item = Inventory(mo);
Expand All @@ -185,6 +199,15 @@ struct ARadarData {
self.blips[i].flags |= ARADAR_BLIPF_RESPAWNED;
continue;
}

if (multiplayer && mo is 'Key') {
if (players[consoleplayer].mo.CountInv(mo.GetClassName()) > 0) {
if ((self.blips[i].flags & ARADAR_BLIPF_VISIBLE) == 1) {
self.blips[i].flags &= ~ARADAR_BLIPF_VISIBLE;
}
continue;
}
}
}

break;
Expand Down Expand Up @@ -239,15 +262,20 @@ struct ARadarData {
}

bool RemoveBlip(Actor mo) {
for (uint i = 0; i < self.blips.Size(); ++i) {
if (self.blips[i].mo != mo) {
continue;
}
if (ARadarBlip.DeduceType(mo) >= 0) {
for (uint i = 0; i < self.blips.Size(); ++i) {
if (!self.blips[i]) {
return false;
}
if (self.blips[i].mo != mo) {
continue;
}

--self.counts[self.blips[i].type];
self.blips.Delete(i);
--self.counts[self.blips[i].type];
self.blips.Delete(i);

return true;
return true;
}
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion zscript/arookas/radar/manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ARadarManager : EventHandler {
if (mDefunct) {
return;
}

mData.RemoveBlip(e.Thing);
}

Expand Down
Loading