Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#7,956 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
game-dev

Direzione di ricerca

Leggi load_missing_retail_gauges e confronta il ciclo dell'HUD predefinito con quello delle classi di navi. L'issue identifica la durata e il comportamento di reset del flag come causa; verifica come ciascun ciclo controlla l'elenco dei gauge della nave. Il lavoro è completato quando un HUD di nave con un gauge personalizzato riceve tutti i gauge standard che non definisce, anche per le classi di navi successive.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C++
Stelle
488
Fork
184
Merge medio
1g 19h
PR unite (30g)
33

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scp-fs2open/fs2open.github.com

Tutte le issue di scp-fs2open/fs2open.github.com

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.