mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-13 21:45:17 +03:00
Option to add outlines to ships in radar (#156)
* Add outlines to ships in radar * Move Outline feature to hooks * Missing semicolon
This commit is contained in:
parent
a466e0d75a
commit
1b534ccd70
@ -1790,7 +1790,7 @@ void HUD_RadarMark_Arwing_Draw(s32 colorIdx) {
|
||||
|
||||
RCP_SetupDL(&gMasterDisp, SETUPDL_62);
|
||||
gDPSetPrimColor(gMasterDisp++, 0, 0, arwingMarkColor[colorIdx][0], arwingMarkColor[colorIdx][1],
|
||||
arwingMarkColor[colorIdx][2], arwingMarkColor[colorIdx][3]);
|
||||
arwingMarkColor[colorIdx][2], arwingMarkColor[colorIdx][3]);
|
||||
Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY);
|
||||
Matrix_SetGfxMtx(&gMasterDisp);
|
||||
gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL);
|
||||
@ -1885,17 +1885,21 @@ void HUD_RadarMark_Draw(s32 type) {
|
||||
} else {
|
||||
arwingMarkColor = arwingMarkColor * 2;
|
||||
}
|
||||
|
||||
HUD_RadarMark_Arwing_Draw(arwingMarkColor);
|
||||
CALL_CANCELLABLE_EVENT(DrawRadarMarkArwingEvent, arwingMarkColor) {
|
||||
HUD_RadarMark_Arwing_Draw(arwingMarkColor);
|
||||
}
|
||||
break;
|
||||
|
||||
case RADARMARK_WOLF:
|
||||
case RADARMARK_LEON:
|
||||
case RADARMARK_PIGMA:
|
||||
case RADARMARK_ANDREW:
|
||||
HUD_RadarMark_StarWolf_Draw();
|
||||
break;
|
||||
|
||||
{ //This won't compile without braces, for some reason.
|
||||
CALL_CANCELLABLE_EVENT(DrawRadarMarkWolfenEvent) {
|
||||
HUD_RadarMark_StarWolf_Draw();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RADARMARK_KATT:
|
||||
HUD_RadarMark_Katt_Draw();
|
||||
break;
|
||||
|
@ -15,6 +15,8 @@ DEFINE_EVENT(PlayerPreUpdateEvent, Player* player;);
|
||||
DEFINE_EVENT(PlayerPostUpdateEvent, Player* player;);
|
||||
|
||||
DEFINE_EVENT(DrawRadarHUDEvent);
|
||||
DEFINE_EVENT(DrawRadarMarkArwingEvent, s32 colorIdx;);
|
||||
DEFINE_EVENT(DrawRadarMarkWolfenEvent);
|
||||
DEFINE_EVENT(DrawBoostGaugeHUDEvent);
|
||||
DEFINE_EVENT(DrawBombCounterHUDEvent);
|
||||
DEFINE_EVENT(DrawIncomingMsgHUDEvent);
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "hit64.h"
|
||||
#include "mods.h"
|
||||
#include "hud.h"
|
||||
#include "assets/ast_star_wolf.h"
|
||||
|
||||
#define INIT_EVENT_IDS
|
||||
#include "port/hooks/Events.h"
|
||||
@ -318,6 +319,64 @@ void OnPreSetupRadioMsgEvent(PreSetupRadioMsgEvent* ev){
|
||||
}
|
||||
}
|
||||
|
||||
void OnRadarMarkArwingDraw(DrawRadarMarkArwingEvent* ev){
|
||||
bool outlines = CVarGetInteger("gFighterOutlines", 0);
|
||||
if (!outlines){
|
||||
return;
|
||||
}
|
||||
|
||||
ev->event.cancelled = true;
|
||||
|
||||
s32 arwingMarkColor[][4] = {
|
||||
{ 177, 242, 12, 255 }, { 89, 121, 6, 128 }, { 90, 90, 255, 255 }, { 45, 45, 128, 128 },
|
||||
{ 0, 179, 67, 255 }, { 0, 90, 34, 128 }, { 255, 30, 0, 255 }, { 128, 15, 0, 128 },
|
||||
};
|
||||
f32 var_fv1;
|
||||
f32 var_fv2;
|
||||
|
||||
if (gCamCount != 1) {
|
||||
var_fv1 = 38.0f;
|
||||
var_fv2 = 38.0f;
|
||||
} else {
|
||||
var_fv1 = 54.0f;
|
||||
var_fv2 = 54.0f;
|
||||
}
|
||||
|
||||
RCP_SetupDL(&gMasterDisp, SETUPDL_62);
|
||||
gDPSetPrimColor(gMasterDisp++, 0, 0,0,0,0,255);
|
||||
Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY);
|
||||
Matrix_SetGfxMtx(&gMasterDisp);
|
||||
gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL);
|
||||
|
||||
gDPSetPrimColor(gMasterDisp++, 0, 0, arwingMarkColor[ev->colorIdx][0], arwingMarkColor[ev->colorIdx][1],
|
||||
arwingMarkColor[ev->colorIdx][2], arwingMarkColor[ev->colorIdx][3]);
|
||||
Matrix_Translate(gGfxMatrix, 0.0f, 1.0f, 0.0f, MTXF_APPLY);
|
||||
Matrix_Scale(gGfxMatrix, 0.8f, 0.7f, 1.0f, MTXF_APPLY);
|
||||
Matrix_SetGfxMtx(&gMasterDisp);
|
||||
gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void OnRadarMarkWolfenDraw(IEvent* ev) {
|
||||
bool outlines = CVarGetInteger("gFighterOutlines", 0);
|
||||
if (!outlines){
|
||||
return;
|
||||
}
|
||||
ev->cancelled = true;
|
||||
|
||||
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255);
|
||||
Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, MTXF_APPLY);
|
||||
Matrix_SetGfxMtx(&gMasterDisp);
|
||||
gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL);
|
||||
|
||||
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255);
|
||||
Matrix_Translate(gGfxMatrix, 0.0f, -1.2f, 0.0f, MTXF_APPLY);
|
||||
Matrix_Scale(gGfxMatrix, 0.9f, 0.8f, 1.0f, MTXF_APPLY);
|
||||
Matrix_SetGfxMtx(&gMasterDisp);
|
||||
gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL);
|
||||
}
|
||||
|
||||
void OnLivesCounterDraw(IEvent* ev){
|
||||
bool restore = CVarGetInteger("gRestoreBetaBoostGauge", 0) == 1;
|
||||
if(!restore){
|
||||
@ -347,6 +406,8 @@ void PortEnhancements_Init() {
|
||||
REGISTER_LISTENER(DrawLivesCounterHUDEvent, OnLivesCounterDraw, EVENT_PRIORITY_NORMAL);
|
||||
REGISTER_LISTENER(DrawBombCounterHUDEvent, OnBombCounterDraw, EVENT_PRIORITY_NORMAL);
|
||||
REGISTER_LISTENER(PreSetupRadioMsgEvent, OnPreSetupRadioMsgEvent, EVENT_PRIORITY_NORMAL);
|
||||
REGISTER_LISTENER(DrawRadarMarkArwingEvent, OnRadarMarkArwingDraw, EVENT_PRIORITY_NORMAL);
|
||||
REGISTER_LISTENER(DrawRadarMarkWolfenEvent, OnRadarMarkWolfenDraw, EVENT_PRIORITY_NORMAL);
|
||||
|
||||
REGISTER_LISTENER(ObjectUpdateEvent, OnItemGoldRingUpdate, EVENT_PRIORITY_NORMAL);
|
||||
REGISTER_LISTENER(ObjectDrawPostSetupEvent, OnItemGoldRingDraw, EVENT_PRIORITY_NORMAL);
|
||||
@ -375,6 +436,8 @@ void PortEnhancements_Register() {
|
||||
REGISTER_EVENT(PlayerPostUpdateEvent);
|
||||
|
||||
REGISTER_EVENT(DrawRadarHUDEvent);
|
||||
REGISTER_EVENT(DrawRadarMarkArwingEvent);
|
||||
REGISTER_EVENT(DrawRadarMarkWolfenEvent);
|
||||
REGISTER_EVENT(DrawBoostGaugeHUDEvent);
|
||||
REGISTER_EVENT(DrawBombCounterHUDEvent);
|
||||
REGISTER_EVENT(DrawIncomingMsgHUDEvent);
|
||||
|
@ -567,6 +567,10 @@ void DrawEnhancementsMenu() {
|
||||
.tooltip = "Gorgon flashes the screen repeatedly when firing its beam or when teleporting, which causes eye pain for some players and may be harmful to those with photosensitivity.",
|
||||
.defaultValue = false
|
||||
});
|
||||
UIWidgets::CVarCheckbox("Add outline to Arwing and Wolfen in radar", "gFighterOutlines", {
|
||||
.tooltip = "Increases visibility of ships in the radar.",
|
||||
.defaultValue = false
|
||||
});
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user