Skip to content

Commit

Permalink
game now support special message in multiplayer room
Browse files Browse the repository at this point in the history
  • Loading branch information
Faraphel committed Feb 9, 2022
1 parent f47049e commit 5dfaa35
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/scripts/tmp/
/Pack/MKWFaraphel/file/generated/
/Pack/UltraDupraMegaSupraMKW/
/.github/
39 changes: 38 additions & 1 deletion Pack/MKWFaraphel/file/essentials/lpar-debug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,44 @@ PERF-MONITOR = 2
DEBUG = DEBUG$1

[CHAT-MESSAGE-MODES]
@legacy = 1
M37 = CHAT$RESET

M38 = CHAT$ANY_TRACK
M39 = CHAT$TRACK_BY_HOST

M40 = CHAT$BLOCK_CLEAR
M41 = CHAT$BLOCK_DISABLE
M42 = CHAT$BLOCK_ENABLE

M43 = chat$vehicles(VEH$ANY)

M44 = chat$vehicles(VEH$ANY_SIZE)
M45 = chat$vehicles(VEH$SMALL)
M46 = chat$vehicles(-VEH$SMALL)
M47 = chat$vehicles(VEH$MEDIUM)
M48 = chat$vehicles(-VEH$MEDIUM)
M49 = chat$vehicles(VEH$LARGE)
M50 = chat$vehicles(-VEH$LARGE)

M51 = chat$vehicles(VEH$ANY_TYPE)
M52 = chat$vehicles(VEH$KART)
M53 = chat$vehicles(VEH$BIKE)

M54 = CHAT$RESET_ENGINE
M55 = CHAT$USE_ENGINE_1
M56 = CHAT$USE_ENGINE_2
M57 = CHAT$USE_ENGINE_3

M58 = chat$n_races(1)
M59 = chat$n_races(2)
M60 = chat$n_races(4)
M61 = chat$n_races(8)
M62 = chat$n_races(12)
M63 = chat$n_races(16)
M64 = chat$n_races(24)
M65 = chat$n_races(32)
M66 = chat$n_races(48)
M67 = chat$n_races(64)

[DEBUG-1]
SETUP = DEBUG$CLEAR
Expand Down
39 changes: 38 additions & 1 deletion Pack/MKWFaraphel/file/essentials/lpar-normal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,41 @@ SPEEDOMETER = 1
THCLOUD-TIME = 720

[CHAT-MESSAGE-MODES]
@legacy = 1
M37 = CHAT$RESET

M38 = CHAT$ANY_TRACK
M39 = CHAT$TRACK_BY_HOST

M40 = CHAT$BLOCK_CLEAR
M41 = CHAT$BLOCK_DISABLE
M42 = CHAT$BLOCK_ENABLE

M43 = chat$vehicles(VEH$ANY)

M44 = chat$vehicles(VEH$ANY_SIZE)
M45 = chat$vehicles(VEH$SMALL)
M46 = chat$vehicles(-VEH$SMALL)
M47 = chat$vehicles(VEH$MEDIUM)
M48 = chat$vehicles(-VEH$MEDIUM)
M49 = chat$vehicles(VEH$LARGE)
M50 = chat$vehicles(-VEH$LARGE)

M51 = chat$vehicles(VEH$ANY_TYPE)
M52 = chat$vehicles(VEH$KART)
M53 = chat$vehicles(VEH$BIKE)

M54 = CHAT$RESET_ENGINE
M55 = CHAT$USE_ENGINE_1
M56 = CHAT$USE_ENGINE_2
M57 = CHAT$USE_ENGINE_3

M58 = chat$n_races(1)
M59 = chat$n_races(2)
M60 = chat$n_races(4)
M61 = chat$n_races(8)
M62 = chat$n_races(12)
M63 = chat$n_races(16)
M64 = chat$n_races(24)
M65 = chat$n_races(32)
M66 = chat$n_races(48)
M67 = chat$n_races(64)
173 changes: 168 additions & 5 deletions Pack/MKWFaraphel/file_process.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,39 @@
"0x703e": "\\c{white}Random: All tracks",
"0x703f": "\\c{white}Random: Original tracks",
"0x7040": "\\c{white}Random: Custom Tracks",
"0x7041": "\\c{white}Random: New tracks"
"0x7041": "\\c{white}Random: New tracks",

"M37": "\\c{YOR4}Reset options",
"M38": "\\c{YOR4}Vote : by players",
"M39": "\\c{YOR4}Vote : by host",
"M40": "\\c{YOR4}Blocking : reset",
"M41": "\\c{YOR4}Blocking : disable",
"M42": "\\c{YOR4}Blocking : enable",
"M43": "\\c{YOR4}Vehicle : all",
"M44": "\\c{YOR4}Vehicle : all weight",
"M45": "\\c{YOR4}Vehicle : light only",
"M46": "\\c{YOR4}Vehicle : all except light",
"M47": "\\c{YOR4}Vehicle : medium only",
"M48": "\\c{YOR4}Vehicle : all except medium",
"M49": "\\c{YOR4}Vehicle : heavy only",
"M50": "\\c{YOR4}Vehicle : all except heavy",
"M51": "\\c{YOR4}Vehicle : all type",
"M52": "\\c{YOR4}Vehicle : kart only",
"M53": "\\c{YOR4}Vehicle : bike only",
"M54": "\\c{YOR4}Engine : reset",
"M55": "\\c{YOR4}Engine : 100cc",
"M56": "\\c{YOR4}Engine : 150cc",
"M57": "\\c{YOR4}Engine : 150cc mirror",
"M58": "\\c{YOR4}Game : 1 race",
"M59": "\\c{YOR4}Game : 2 races",
"M60": "\\c{YOR4}Game : 4 races",
"M61": "\\c{YOR4}Game : 8 races",
"M62": "\\c{YOR4}Game : 12 races",
"M63": "\\c{YOR4}Game : 16 races",
"M64": "\\c{YOR4}Game : 24 races",
"M65": "\\c{YOR4}Game : 32 races",
"M66": "\\c{YOR4}Game : 48 races",
"M67": "\\c{YOR4}Game : 64 races"
}
},
{
Expand All @@ -17,7 +49,39 @@
"0x703e": "\\c{white}Aléatoire: Toutes les pistes",
"0x703f": "\\c{white}Aléatoire: Pistes Originales",
"0x7040": "\\c{white}Aléatoire: Custom Tracks",
"0x7041": "\\c{white}Aléatoire: Nouvelles pistes"
"0x7041": "\\c{white}Aléatoire: Nouvelles pistes",

"M37": "\\c{YOR4}Réinitialiser les options",
"M38": "\\c{YOR4}Vote : par les joueurs",
"M39": "\\c{YOR4}Vote : par l'hôte",
"M40": "\\c{YOR4}Blocage : réinitialiser",
"M41": "\\c{YOR4}Blocage : désactiver",
"M42": "\\c{YOR4}Blocage : activer",
"M43": "\\c{YOR4}Véhicule : tout",
"M44": "\\c{YOR4}Véhicule : tout poids",
"M45": "\\c{YOR4}Véhicule : seulement léger",
"M46": "\\c{YOR4}Véhicule : tout sauf léger",
"M47": "\\c{YOR4}Véhicule : seulement moyen",
"M48": "\\c{YOR4}Véhicule : tout sauf moyen",
"M49": "\\c{YOR4}Véhicule : seulement lourd",
"M50": "\\c{YOR4}Véhicule : tout sauf lourd",
"M51": "\\c{YOR4}Véhicule : tout type",
"M52": "\\c{YOR4}Véhicule : seulement kart",
"M53": "\\c{YOR4}Véhicule : seulement moto",
"M54": "\\c{YOR4}Cylindrée : réinitialiser",
"M55": "\\c{YOR4}Cylindrée : 100cc",
"M56": "\\c{YOR4}Cylindrée : 150cc",
"M57": "\\c{YOR4}Cylindrée : 150cc mirroir",
"M58": "\\c{YOR4}Partie : 1 course",
"M59": "\\c{YOR4}Partie : 2 courses",
"M60": "\\c{YOR4}Partie : 4 courses",
"M61": "\\c{YOR4}Partie : 8 courses",
"M62": "\\c{YOR4}Partie : 12 courses",
"M63": "\\c{YOR4}Partie : 16 courses",
"M64": "\\c{YOR4}Partie : 24 courses",
"M65": "\\c{YOR4}Partie : 32 courses",
"M66": "\\c{YOR4}Partie : 48 courses",
"M67": "\\c{YOR4}Partie : 64 courses"
}
},
{
Expand All @@ -27,7 +91,40 @@
"0x703e": "\\c{white}Zufällig: Alle Tracks",
"0x703f": "\\c{white}Zufällig: Original-Tracks",
"0x7040": "\\c{white}Zufällig: Custom Tracks",
"0x7041": "\\c{white}Zufällig: Neue Tracks"
"0x7041": "\\c{white}Zufällig: Neue Tracks",

"M37": "\\c{YOR4}Optionen zurücksetzen",
"M38": "\\c{YOR4}Abstimmung : von Spielern",
"M39": "\\c{YOR4}Abstimmung : vom Gastgeber",
"M40": "\\c{YOR4}Blockierung : reset",
"M41": "\\c{YOR4}Blockierung : disable",
"M42": "\\c{YOR4}Blockierung : enable",
"M43": "\\c{YOR4}Fahrzeug : alle",
"M44": "\\c{YOR4}Fahrzeug : alles Gewicht",
"M45": "\\c{YOR4}Fahrzeug : nur leicht",
"M46": "\\c{YOR4}Fahrzeug : alles außer leicht",
"M47": "\\c{YOR4}Fahrzeug : nur Mittel",
"M48": "\\c{YOR4}Fahrzeug : alles außer Mittel",
"M49": "\\c{YOR4}Fahrzeug : nur schwer",
"M50": "\\c{YOR4}Fahrzeug : alles außer schwer",
"M51": "\\c{YOR4}Fahrzeug : alle Arten",
"M52": "\\c{YOR4}Fahrzeug : nur Kart",
"M53": "\\c{YOR4}Fahrzeug : nur Fahrrad",
"M54": "\\c{YOR4}Motor : zurücksetzen",
"M55": "\\c{YOR4}Motor : 100cc",
"M56": "\\c{YOR4}Motor : 150cc",
"M57": "\\c{YOR4}Motor : 150cc Spiegel",
"M58": "\\c{YOR4}Spiel : 1 Track",
"M59": "\\c{YOR4}Spiel : 2 Tracks",
"M60": "\\c{YOR4}Spiel : 4 Tracks",
"M61": "\\c{YOR4}Spiel : 8 Tracks",
"M62": "\\c{YOR4}Spiel : 12 Tracks",
"M63": "\\c{YOR4}Spiel : 16 Tracks",
"M64": "\\c{YOR4}Spiel : 24 Tracks",
"M65": "\\c{YOR4}Spiel : 32 Tracks",
"M66": "\\c{YOR4}Spiel : 48 Tracks",
"M67": "\\c{YOR4}Spiel : 64 Tracks"

}
},
{
Expand All @@ -37,7 +134,40 @@
"0x703e": "\\c{white}Casuale: Tutte le tracce",
"0x703f": "\\c{white}Casuale: Tracce originali",
"0x7040": "\\c{white}Casuale: Custom Tracks",
"0x7041": "\\c{white}Casuale: Nuovi brani"
"0x7041": "\\c{white}Casuale: Nuovi brani",

"M37": "\\c{YOR4}Ripristina opzioni",
"M38": "\\c{YOR4}Votazione : dei giocatori",
"M39": "\\c{YOR4}Votazione : per ospite",
"M40": "\\c{YOR4}Blocco : Ripristina",
"M41": "\\c{YOR4}Blocco : disattivare",
"M42": "\\c{YOR4}Blocco : abilitare",
"M43": "\\c{YOR4}Veicolo : tutto",
"M44": "\\c{YOR4}Veicolo : tutto peso",
"M45": "\\c{YOR4}Veicolo : solo leggero",
"M46": "\\c{YOR4}Veicolo : tutto tranne leggero",
"M47": "\\c{YOR4}Veicolo : solo medio",
"M48": "\\c{YOR4}Veicolo : tutto tranne medio",
"M49": "\\c{YOR4}Veicolo : solo pesante",
"M50": "\\c{YOR4}Veicolo : tutto tranne pesante",
"M51": "\\c{YOR4}Veicolo : tutti i tipi",
"M52": "\\c{YOR4}Veicolo : solo kart",
"M53": "\\c{YOR4}Veicolo : solo bici",
"M54": "\\c{YOR4}Motore : Ripristina",
"M55": "\\c{YOR4}Motore : 100cc",
"M56": "\\c{YOR4}Motore : 150cc",
"M57": "\\c{YOR4}Motore : 150cc specchio",
"M58": "\\c{YOR4}Gioco : 1 pista",
"M59": "\\c{YOR4}Gioco : 2 pistas",
"M60": "\\c{YOR4}Gioco : 4 pistas",
"M61": "\\c{YOR4}Gioco : 8 pistas",
"M62": "\\c{YOR4}Gioco : 12 pistas",
"M63": "\\c{YOR4}Gioco : 16 pistas",
"M64": "\\c{YOR4}Gioco : 24 pistas",
"M65": "\\c{YOR4}Gioco : 32 pistas",
"M66": "\\c{YOR4}Gioco : 48 pistas",
"M67": "\\c{YOR4}Gioco : 64 pistas"

}
},
{
Expand All @@ -47,7 +177,40 @@
"0x703e": "\\c{white}Aleatorio: Todas las pistas",
"0x703f": "\\c{white}Aleatorio: Pistas originales",
"0x7040": "\\c{white}Aleatorio: Custom Tracks",
"0x7041": "\\c{white}Aleatorio: Pistas nuevas"
"0x7041": "\\c{white}Aleatorio: Pistas nuevas",

"M37": "\\c{YOR4}Restablecer opciones",
"M38": "\\c{YOR4}Votar : de los jugadores",
"M39": "\\c{YOR4}Votar : by por la anfitriona",
"M40": "\\c{YOR4}Bloqueando : reiniciar",
"M41": "\\c{YOR4}Bloqueando : desactivar",
"M42": "\\c{YOR4}Bloqueando : permitir",
"M43": "\\c{YOR4}Vehículo : todo",
"M44": "\\c{YOR4}Vehículo : todo el peso",
"M45": "\\c{YOR4}Vehículo : solo ligero",
"M46": "\\c{YOR4}Vehículo : todo excepto ligero",
"M47": "\\c{YOR4}Vehículo : solo medio",
"M48": "\\c{YOR4}Vehículo : todo excepto medio",
"M49": "\\c{YOR4}Vehículo : solo pesado",
"M50": "\\c{YOR4}Vehículo : todo excepto pesado",
"M51": "\\c{YOR4}Vehículo : todos los tipos",
"M52": "\\c{YOR4}Vehículo : kart único",
"M53": "\\c{YOR4}Vehículo : solo bicicleta",
"M54": "\\c{YOR4}Motor : reiniciar",
"M55": "\\c{YOR4}Motor : 100cc",
"M56": "\\c{YOR4}Motor : 150cc",
"M57": "\\c{YOR4}Motor : 150cc espejo",
"M58": "\\c{YOR4}Partido : 1 pista",
"M59": "\\c{YOR4}Partido : 2 pistas",
"M60": "\\c{YOR4}Partido : 4 pistas",
"M61": "\\c{YOR4}Partido : 8 pistas",
"M62": "\\c{YOR4}Partido : 12 pistas",
"M63": "\\c{YOR4}Partido : 16 pistas",
"M64": "\\c{YOR4}Partido : 24 pistas",
"M65": "\\c{YOR4}Partido : 32 pistas",
"M66": "\\c{YOR4}Partido : 48 pistas",
"M67": "\\c{YOR4}Partido : 64 pistas"

}
},
{
Expand Down
8 changes: 4 additions & 4 deletions source/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ def process_bmg_replacement(bmg_content: str, bmg_language: str) -> str:
data_replacement = data_replacement.replace("{"+key+"}", replacement)

if bmg_process["mode"] == "overwrite_id":
start_line = f"\n\t{str_to_int(data):x} = "
start_line = f"\n\t{data} = "
start_pos = bmg_content.find(start_line)
if start_pos != -1:
end_pos = bmg_content[start_pos:].find("\n")
bmg_content = (
bmg_content[:start_pos] +
start_line + data_replacement +
bmg_content[end_pos:]
bmg_content[:start_pos] +
start_line + data_replacement +
bmg_content[end_pos:]
)
else:
bmg_content = f"{bmg_content}\n{start_line}{data_replacement}\n"
Expand Down

0 comments on commit 5dfaa35

Please sign in to comment.