Fix career + minor glitches

This commit is contained in:
sladecraven 2022-03-30 13:38:01 +02:00
parent f65110f2a8
commit f6f8f71001
4 changed files with 499 additions and 474 deletions

View File

@ -39,8 +39,7 @@ const _manage_inn_roll = async (content, msg) => {
}) })
console.log("COMMANDES", command); console.log("COMMANDES", command);
if (command[0] == "/auberge" && command[1] ) if (command[0] == "/auberge" && command[1]) {
{
msg["type"] = 0; msg["type"] = 0;
msg["rollMode"] = "gmroll"; msg["rollMode"] = "gmroll";
var compendium = game.packs.get('WH4-fr-translation.plats-dauberges'); var compendium = game.packs.get('WH4-fr-translation.plats-dauberges');
@ -68,15 +67,18 @@ const _manage_inn_roll = async (content, msg) => {
} }
/************************************************************************************/ /************************************************************************************/
let __eis_tables = { "animalmishap":1, "beasthead":1, "coincedentalenc":1, "demonic-mien":1, let __eis_tables = {
"animalmishap": 1, "beasthead": 1, "coincedentalenc": 1, "demonic-mien": 1,
"expandedmutatemental": 1, "expandedmutatephys": 1, "fixations": 1, "expandedmutatemental": 1, "expandedmutatephys": 1, "fixations": 1,
"harmfulenc": 1, "positiveenc": 1, "weather": 1, "mutatephys": 1, "harmfulenc": 1, "positiveenc": 1, "weather": 1, "mutatephys": 1,
"vehiclemishap": 1, "quadruped": 1, "ridingmishap": 1, "weather": 1, "vehiclemishap": 1, "quadruped": 1, "ridingmishap": 1, "weather": 1,
"delirium": 1 "delirium": 1
} }
let __dotr_tables = { "rowingboat":1, "sailingboat":1, "wind-direction": 1, "waterborne": 1, "traderumour": 1 let __dotr_tables = {
"rowingboat": 1, "sailingboat": 1, "wind-direction": 1, "waterborne": 1, "traderumour": 1
} }
let __wfrp4e_tables = { "career": 1, "critbody":1, "critleg": 1, "doom": 1, "doom2": 1, "eyes": 1, "majormis": 1, "mutatemental": 1, "oops": 1, "species":1, "travel": 1, let __wfrp4e_tables = {
"career": 1, "critbody": 1, "critleg": 1, "doom": 1, "doom2": 1, "eyes": 1, "majormis": 1, "mutatemental": 1, "oops": 1, "species": 1, "travel": 1,
"hitloc": 1, "critarm": 1, "crithead": 1, "delirium": 1, "event": 1, "hair": 1, "minormis": 1, "mutatephys": 1, "talents": 1, "wrath": 1, "hitloc": 1, "critarm": 1, "crithead": 1, "delirium": 1, "event": 1, "hair": 1, "minormis": 1, "mutatephys": 1, "talents": 1, "wrath": 1,
"astral": 1, "corruption": 1, "snake": 1, "spider": 1, "job": 1 "astral": 1, "corruption": 1, "snake": 1, "spider": 1, "job": 1
@ -188,16 +190,19 @@ const __check_fix_wrong_modules = ( chatFlag, patchFinished ) => {
} }
if (name == "wfrp4e-ew" && module.active && game.user.isGM && chatFlag) { if (name == "wfrp4e-ew" && module.active && game.user.isGM && chatFlag) {
ChatMessage.create( { content: "<div><strong>Vous avez le module EW (wfrp4e-ew ?) installé. Malheureusement, ce module n'est pas compatible avec" + ChatMessage.create({
content: "<div><strong>Vous avez le module EW (wfrp4e-ew ?) installé. Malheureusement, ce module n'est pas compatible avec" +
" les traductions et vient casser le fonctionnement de la traduction. Veuillez recopier les compendiums dans votre monde, désactiver le module et re-démarrer le monde</strong></div>", " les traductions et vient casser le fonctionnement de la traduction. Veuillez recopier les compendiums dans votre monde, désactiver le module et re-démarrer le monde</strong></div>",
whisper: ChatMessage.getWhisperRecipients("GM") whisper: ChatMessage.getWhisperRecipients("GM")
}); });
} }
}); });
if (game.user.isGM && patchFinished) { if (game.user.isGM && patchFinished) {
ChatMessage.create( { content: "<div>Les modules WFRP4E ont été <strong>patchés avec succés</strong>. Vous pouvez y aller et que <strong>Shallya vous garde !</strong></div>", ChatMessage.create({
content: "<div>Les modules WFRP4E ont été <strong>patchés avec succés</strong>. Vous pouvez y aller et que <strong>Shallya vous garde !</strong></div>",
user: game.user.id, user: game.user.id,
whisper: ChatMessage.getWhisperRecipients("GM") } ); whisper: ChatMessage.getWhisperRecipients("GM")
});
} }
} }
@ -210,19 +215,15 @@ const convertColumnToMulti = (table) => {
newTable.rows = table.rows.map(i => { return { range: {} } }) newTable.rows = table.rows.map(i => { return { range: {} } })
newTable.multi = table.columns newTable.multi = table.columns
for(let column of columns) for (let column of columns) {
{ for (let row of newTable.rows) {
for (let row of newTable.rows)
{
row[column] = {} row[column] = {}
row.range[column] = [] row.range[column] = []
} }
} }
for(let index in newTable.rows) for (let index in newTable.rows) {
{ for (let column in table.rows[index].range) {
for (let column in table.rows[index].range)
{
newTable.rows[index][column] = { name: table.rows[index].name } newTable.rows[index][column] = { name: table.rows[index].name }
newTable.rows[index].range[column] = table.rows[index].range[column] newTable.rows[index].range[column] = table.rows[index].range[column]
} }
@ -230,6 +231,26 @@ const convertColumnToMulti = (table) => {
return newTable; return newTable;
} }
/************************************************************************************/
const __patchStyleSheet = () => {
for( let styleSheet of document.styleSheets) {
if (styleSheet.href && styleSheet.href.includes("wfrp4e.css") ) {
let found = 0
for (let i=0; i<styleSheet.cssRules.length; i++) {
let rule = styleSheet.cssRules[i]
if (rule.selectorText == '.sidebar-popout') {
console.log("DELETE RULE", rule)
found = i
/*rule.cssText = ".sidebar-popout { }"
rule.style.width = ""
console.log("Found rul2", rule)*/
}
}
styleSheet.deleteRule(found)
}
}
}
/************************************************************************************/ /************************************************************************************/
const __add_actors_translation = () => { const __add_actors_translation = () => {
const lang = game.settings.get('core', 'language'); const lang = game.settings.get('core', 'language');
@ -338,6 +359,8 @@ Hooks.once('ready', () => {
setTimeout(__check_fix_wrong_modules, 20000, true, true); setTimeout(__check_fix_wrong_modules, 20000, true, true);
setTimeout(__add_actors_translation, 21000, false, true); setTimeout(__add_actors_translation, 21000, false, true);
//__patchStyleSheet()
/* ATTEMPT !! /* ATTEMPT !!
loadCompendium("wfrp4e-core.spells").then( comp => { loadCompendium("wfrp4e-core.spells").then( comp => {
let sorted = {}; let sorted = {};

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
"authors": [ {"name":"LeRatierBretonnien" }], "authors": [ {"name":"LeRatierBretonnien" }],
"url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-wh4-lang-fr-fr", "url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-wh4-lang-fr-fr",
"flags": {}, "flags": {},
"version": "5.2.1", "version": "5.2.2",
"minimumCoreVersion": "0.8.0", "minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "9", "compatibleCoreVersion": "9",
"scripts": [], "scripts": [],

View File

@ -1,3 +1,5 @@
/** To deal with wrong menu background */
:root{ :root{
--color-bg-option: #352516; --color-bg-option: #352516;
} }