Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

P2: A ship-specific HUD with "$Load Retail Configuration: YES" loses most of its retail gauges

Abierto Apto para principiantes
#7,956 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp
Área
game-dev

Línea de trabajo

Lee load_missing_retail_gauges y compara el bucle del HUD predeterminado con el bucle de clases de nave. El issue identifica como causa el ciclo de vida y el comportamiento de restablecimiento de la flag; verifica cómo comprueba cada bucle la lista de gauges de la nave. Se considerará terminado cuando un HUD de nave con un gauge personalizado reciba todos los gauges estándar que no define, también para las clases de nave posteriores.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

A mod can give one ship class its own HUD and have the game fill in the rest of the standard gauges with $Load Retail Configuration: YES. When that HUD defines even one gauge itself, most of the standard gauges never get added: in my test the player kept only the radar and the message box, and lost the reticle, target box, weapons, energy, escort list and the rest.

In the ship-class half of load_missing_retail_gauges, retail_gauge_loaded is set to true as soon as one built-in gauge is found in the ship's own list, and is never set back to false for the next built-in gauge (the default-HUD loop above it does reset it). So every built-in gauge after the first match is treated as already loaded and skipped. By reading the code (not run): the flag also isn't reset between ship classes, so later ship classes with their own HUD should lose their fill-in entirely once any earlier one matched.

Steps to reproduce

  1. Current master (I used 8afa31842, Debug build), MediaVPs 5.0.2.
  2. Make a mod with a data/tables/zz-hdg.tbm containing:
    #Gauge Config
    $Ships: ("GTF Myrmidon")
    $Load Retail Configuration: YES
    $Base: (1024, 768)
    $Gauges:
    +Messages:
    $End Gauges
    #End
    
  3. Start SM1-01 (the player flies a GTF Myrmidon) and compare the HUD with a run without the mod.

What I got: without the mod, the full retail HUD. With it, only the radar and the message box.

Expected vs. actual behavior

Expected: the ship's own gauges plus every standard gauge it didn't define.
Actual: the standard gauges after the first one the ship defines are missing, for that ship and for every later ship class with its own HUD.

Proposed fixes

  1. Set retail_gauge_loaded = false; at the top of the per-gauge loop in the ship-class half, as the default-HUD loop already does.
  2. Declare the flag inside that loop instead of once for the whole function, so it can't carry over between gauges or ship classes.
  3. Replace the inner search with std::any_of over the ship's gauge list, which removes the flag altogether.
Lenguaje dominante
C++
Estrellas
488
Forks
184
Merge medio
1 d 19 h
PR fusionados (30 d)
33

Preparar el entorno

Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de scp-fs2open/fs2open.github.com

Todos los issues de scp-fs2open/fs2open.github.com

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.