mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-15 15:02:34 +02:00
Map flashing
This commit is contained in:
parent
6f9c3db52e
commit
e5694b383c
@ -108,6 +108,7 @@ GameState::GameState()
|
||||
, currentCutscene(nullptr)
|
||||
, cutsceneStartTime(-1.f)
|
||||
, isCinematic(false)
|
||||
, hudFlash(HudFlash::Disabled)
|
||||
, cameraNear(0.1f)
|
||||
, cameraFixed(false)
|
||||
, cameraTarget(0)
|
||||
|
@ -243,6 +243,13 @@ struct GarageInfo {
|
||||
}
|
||||
};
|
||||
|
||||
enum class HudFlash {
|
||||
Disabled = -1,
|
||||
FlashArmor = 3,
|
||||
FlashHealth = 4,
|
||||
FlashRadar = 8
|
||||
};
|
||||
|
||||
/**
|
||||
* Gameplay state object that holds persistent state, and references runtime
|
||||
* world state.
|
||||
@ -301,6 +308,7 @@ public:
|
||||
float cutsceneStartTime;
|
||||
/** Flag for rendering cutscene letterbox */
|
||||
bool isCinematic;
|
||||
HudFlash hudFlash;
|
||||
|
||||
std::string lastMissionName;
|
||||
|
||||
|
@ -11835,9 +11835,7 @@ void opcode_03e6(const ScriptArguments& args) {
|
||||
@arg arg1
|
||||
*/
|
||||
void opcode_03e7(const ScriptArguments& args, const ScriptHudFlash arg1) {
|
||||
RW_UNIMPLEMENTED_OPCODE(0x03e7);
|
||||
RW_UNUSED(arg1);
|
||||
RW_UNUSED(args);
|
||||
args.getState()->hudFlash = (HudFlash)arg1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,6 +32,8 @@ void drawMap(ViewCamera& currentView, PlayerController* player,
|
||||
GameWorld* world, GameRenderer* render) {
|
||||
MapRenderer::MapInfo map;
|
||||
|
||||
if (world->state->hudFlash != HudFlash::FlashRadar
|
||||
|| std::fmod(world->getGameTime(), 0.5f) >= .25f) {
|
||||
glm::quat camRot = currentView.rotation;
|
||||
|
||||
map.rotation = glm::roll(camRot) - glm::half_pi<float>();
|
||||
@ -53,6 +55,7 @@ void drawMap(ViewCamera& currentView, PlayerController* player,
|
||||
|
||||
render->map.draw(world, map);
|
||||
}
|
||||
}
|
||||
|
||||
void drawPlayerInfo(PlayerController* player, GameWorld* world,
|
||||
GameRenderer* render) {
|
||||
@ -104,8 +107,9 @@ void drawPlayerInfo(PlayerController* player, GameWorld* world,
|
||||
|
||||
infoTextY += ui_textHeight;
|
||||
|
||||
if (player->getCharacter()->getCurrentState().health > ui_lowHealth
|
||||
|| fmod(world->getGameTime(), 0.5) >= .25) { // UI: Blinking health indicator if health is low
|
||||
if ((world->state->hudFlash != HudFlash::FlashHealth
|
||||
&& player->getCharacter()->getCurrentState().health > ui_lowHealth)
|
||||
|| std::fmod(world->getGameTime(), 0.5f) >= .25f) { // UI: Blinking health indicator if health is low
|
||||
std::stringstream ss;
|
||||
ss << std::setw(3) << std::setfill('0')
|
||||
<< (int)player->getCharacter()->getCurrentState().health;
|
||||
|
Loading…
Reference in New Issue
Block a user