scripthookvdotnet / scripthookvdotnet

An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language on the .NET Framework runtime in-game.
https://scripthookvdotnet.github.io
zlib License
1.2k stars 631 forks source link

Change Zone to CamelCase enumeration #294

Closed crosire closed 9 years ago

crosire commented 9 years ago

Zone should be changed to an enum in camelcase convention instead of using strings. This would then remove the need for ZoneID too. There are several natives which work with integers to identify zones (like GET_ZONE_AT_COORDS), so this is the more obvious way to do it.

Created the enum already, but I yet need to find all the values for it. _GET_ZONE_BY_NAME might help for that matter, but I don't know which name to pass to it.

public enum class Zone
{
    Unknown = 0,
    Airport = 0, // AIRP
    AlamoSea = 0, // ALAMO
    Alta = 0, // ALTA
    FortZancudo = 0, // ARMYB
    BanhamCanyonDr = 0, // BANHAMC
    Banning = 0, // BANNING
    VespucciBeach = 0, // BEACH
    BanhamCanyon = 0, // BHAMCA
    BraddockPass = 0, // BRADP
    BraddockTunnel = 0, // BRADT
    Burton = 0, // BURTON
    CalafiaBridge = 0, // CALAFB
    RatonCanyon = 0, // CANNY
    CassidyCreek = 0, // CCREAK
    ChamberlainHills = 0, // CHAMH
    VinewoodHills = 0, // CHIL
    Chumash = 0, // CHU
    ChiliadMountainStateWilderness = 0, // CMSW
    CypressFlats = 0, // CYPRE
    Davis = 0, // DAVIS
    DelPerroBeach = 0, // DELBE
    DelPerro = 0, // DELPE
    PuertoDelSol = 0, // DELSOL
    GrandSenoraDesert = 0, // DESRT
    Downtown = 0, // DOWNT
    DowntownVinewood = 0, // DTVINE
    EastVinewood = 0, // EAST_V
    ElBurroHeights = 0, // EBURO
    ElGordoLighthouse = 0, // ELGORL
    ElysianIsland = 0, // ELYSIAN
    Galilee = 0, // GALFISH
    Golf = 0, // GOLF
    Grapeseed = 0, // GRAPES
    GreatChaparral = 0, // GREATC
    Harmony = 0, // HARMO
    Hawick = 0, // HAWICK
    VinewoodRacetrack = 0, // HORS
    HumaneLabsAndResearch = 0, // HUMLAB
    BolingbrokePenitentiary = 0, // JAIL
    LittleSeoul = 0, // KOREAT
    LandActReservoir = 0, // LACT
    LagoZancudo = 0, // LAGO
    LandActDam = 0, // LDAM
    LegionSquare = 0, // LEGSQU
    LaMesa = 0, // LMESA
    LaPuerta = 0, // LOSPUER
    MirrorPark = 0, // MIRR
    Morningwood = 0, // MORN
    RichardsMajestic = 0, // MOVIE
    MountChiliad = 0, // MTCHIL
    MountGordo = 0, // MTGORDO
    MountJosiah = 0, // MTJOSE
    MurrietaHeights = 0, // MURRI
    NorthChumash = 0, // NCHU
    NOOSE = 0, // NOOSE
    PacificOcean = 0, // OCEANA
    PaletoCove = 0, // PALCOV
    PaletoBay = 0, // PALETO
    PaletoForest = 0, // PALFOR
    PalominoHighlands = 0, // PALHIGH
    PalmerTaylorPowerStation = 0, // PALMPOW
    PacificBluffs = 0, // PBLUFF
    PillboxHill = 0, // PBOX
    ProcopioBeach = 0, // PROCOB
    Rancho = 0, // RANCHO
    RichmanGlen = 0, // RGLEN
    Richman = 0, // RICHM
    RockfordHills = 0, // ROCKF
    RedwoodLightsTrack = 0, // RTRAK
    SanAndreas = 0, // SANAND
    SanChianskiMountainRange = 0, // SANCHIA
    SandyShores = 0, // SANDY
    MissionRow = 0, // SKID
    StabCity = 0, // SLAB
    MazeBankArena = 0, // STAD
    Strawberry = 0, // STRAW
    TataviamMountains = 0, // TATAMO
    Terminal = 0, // TERMINA
    TextileCity = 0, // TEXTI
    TongvaHills = 0, // TONGVAH
    TongvaValley = 0, // TONGVAV
    VespucciCanals = 0, // VCANA
    Vespucci = 0, // VESP
    Vinewood = 0, // VINE
    WindFarm = 0, // WINDF
    VinewoodWest = 0, // WVINE
    ZancudoRiver = 0, // ZANCUDO
    SouthLosSantosPort = 0, // ZP_ORT
    DavisQuartz = 0, // ZQ_UAR
};
JohnnyCrazy commented 9 years ago

Well, that won't be possible that way I guess.

Every Zone is again parted into little zones (I'm calling them part-zones), little quote from popzone.ipl:

Z_GOLF1, -1414.06, -38.121, 0.0, -1108.57, 225.116, 1250.0, Golf, 0 Z_GOLF3, -1108.57, -38.121, 0.0, -1035.49, 82.4809, 1250.1, Golf, 0

Calling _GET_ZONE_BY_NAME with Z_GOLF1 will give you the id 2, but Z_GOLF3 will give you the id 3. Maybe I'm missing something, but AFAIK we only can relate part-zones with zones by providing a dictionary or something.