Skip to content

Commit

Permalink
Merge pull request #859 from ebkr/across-the-obelisk
Browse files Browse the repository at this point in the history
Add game support: Across the Obelisk
  • Loading branch information
MythicManiac authored Oct 24, 2022
2 parents 2484d1d + 49b1467 commit 11a1ed8
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/model/game/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import StorePlatformMetadata from '../../model/game/StorePlatformMetadata';
import { GameSelectionDisplayMode } from '../../model/game/GameSelectionDisplayMode';
import { GameInstanceType } from '../../model/game/GameInstanceType';
import { PackageLoader } from '../../model/installing/PackageLoader';
import { GAME_NAME } from '../../r2mm/installing/profile_installers/ModLoaderVariantRecord';

export default class Game {

private readonly _displayName: string;
private readonly _internalFolderName: string;
private readonly _internalFolderName: GAME_NAME;
private readonly _steamFolderName: string;
private readonly _settingsIdentifier: string;
private readonly _exeName: string[];
Expand All @@ -24,7 +25,7 @@ export default class Game {

private _activePlatform: StorePlatformMetadata;

constructor(displayName: string, internalFolderName: string, settingsIdentifier: string,
constructor(displayName: string, internalFolderName: GAME_NAME, settingsIdentifier: string,
steamFolderName: string, exeName: string[], dataFolderName: string,
tsUrl: string, exclusionsUrl: string, platforms: StorePlatformMetadata[], gameImage: string,
displayMode: GameSelectionDisplayMode, instanceType: GameInstanceType, packageLoader: PackageLoader, additionalSearchStrings?: string[]) {
Expand All @@ -50,7 +51,7 @@ export default class Game {
return this._displayName;
}

get internalFolderName(): string {
get internalFolderName(): GAME_NAME {
return this._internalFolderName;
}

Expand Down
5 changes: 5 additions & 0 deletions src/model/game/GameManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ export default class GameManager {
[new StorePlatformMetadata(StorePlatform.STEAM, "2067920")], "RogueGenesia.jpg",
GameSelectionDisplayMode.VISIBLE, GameInstanceType.GAME, PackageLoader.BEPINEX, ["rg"]),

new Game("Across the Obelisk", "AcrossTheObelisk", "AcrossTheObelisk",
"Across the Obelisk", ["AcrossTheObelisk.exe"], "AcrossTheObelisk_Data",
"https://thunderstore.io/c/across-the-obelisk/api/v1/package/", "https://raw.githubusercontent.com/ebkr/r2modmanPlus/master/modExclusions.md",
[new StorePlatformMetadata(StorePlatform.STEAM, "1385380")], "AcrossTheObelisk.jpg",
GameSelectionDisplayMode.VISIBLE, GameInstanceType.GAME, PackageLoader.BEPINEX, ["ato", "ao"]),
];

static get activeGame(): Game {
Expand Down
7 changes: 6 additions & 1 deletion src/pages/GameSelectionScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</div>
</div>
<div class="image is-fullwidth border border--border-box rounded" :class="[{'border--warning warning-shadow': isFavourited(game)}]">
<img :src='getImage(game.gameImage)' alt='Mod Logo' class="rounded"/>
<img :src='getImage(game.gameImage)' alt='Mod Logo' class="rounded game-thumbnail"/>
</div>
</header>
</div>
Expand Down Expand Up @@ -360,4 +360,9 @@ export default class GameSelectionScreen extends Vue {
.mb-2 {
margin-bottom: 0.5rem !important;
}
.game-thumbnail {
width: 188px;
height: 250px;
object-fit: cover;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import InstallRules_ChronoArk from '../default_installation_rules/game_rules/Ins
import InstallRules_BONELAB from '../default_installation_rules/game_rules/InstallRules_BONELAB';
import InstallRules_TromboneChamp from '../default_installation_rules/game_rules/InstallRules_TromboneChamp';
import InstallRules_RogueGenesia from '../default_installation_rules/game_rules/InstallRules_RogueGenesia';
import { buildBepInExRules } from '../default_installation_rules/game_rules/InstallRules_BepInex';

export default class InstallationRuleApplicator {

Expand Down Expand Up @@ -97,6 +98,7 @@ export default class InstallationRuleApplicator {
InstallRules_BONELAB(),
InstallRules_TromboneChamp(),
InstallRules_RogueGenesia(),
buildBepInExRules("AcrossTheObelisk"),
]
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import type { CoreRuleType } from '../../InstallationRules';
import * as path from 'path';
import { MOD_LOADER_VARIANTS } from '../../profile_installers/ModLoaderVariantRecord';

export function buildBepInExRules(gameName: keyof typeof MOD_LOADER_VARIANTS): CoreRuleType {
return {
gameName: gameName,
rules: [
{
route: path.join("BepInEx", "plugins"),
isDefaultLocation: true,
defaultFileExtensions: [".dll"],
trackingMethod: "SUBDIR",
subRoutes: []
},
{
route: path.join("BepInEx", "core"),
defaultFileExtensions: [],
trackingMethod: "SUBDIR",
subRoutes: []
},
{
route: path.join("BepInEx", "patchers"),
defaultFileExtensions: [],
trackingMethod: "SUBDIR",
subRoutes: []
},
{
route: path.join("BepInEx", "monomod"),
defaultFileExtensions: [".mm.dll"],
trackingMethod: "SUBDIR",
subRoutes: []
},
{
route: path.join("BepInEx", "config"),
defaultFileExtensions: [],
trackingMethod: "NONE",
subRoutes: []
}
]
}
}
10 changes: 8 additions & 2 deletions src/r2mm/installing/profile_installers/ModLoaderVariantRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PackageLoader } from '../../../model/installing/PackageLoader';
* Mapping is:
* game's InternalFolderName: Mapping
*/
export const MOD_LOADER_VARIANTS: {[key: string]: ModLoaderPackageMapping[]} = {
const VARIANTS = {
RiskOfRain2: [new ModLoaderPackageMapping("bbepis-BepInExPack", "BepInExPack", PackageLoader.BEPINEX)],
ThunderstoreDev: [new ModLoaderPackageMapping("xiaoxiao921-BepInExPack", "BepInExPack", PackageLoader.BEPINEX)],
DysonSphereProgram: [new ModLoaderPackageMapping("xiaoye97-BepInEx", "BepInExPack", PackageLoader.BEPINEX)],
Expand Down Expand Up @@ -61,4 +61,10 @@ export const MOD_LOADER_VARIANTS: {[key: string]: ModLoaderPackageMapping[]} = {
BONELAB: [new ModLoaderPackageMapping("LavaGang-MelonLoader", "", PackageLoader.MELON_LOADER)],
TromboneChamp: [new ModLoaderPackageMapping("BepInEx-BepInExPack_TromboneChamp", "BepInExPack_TromboneChamp", PackageLoader.BEPINEX)],
RogueGenesia: [new ModLoaderPackageMapping("BepInEx-BepInExPack_RogueGenesia", "BepInExPack_RogueGenesia", PackageLoader.BEPINEX)],
}
AcrossTheObelisk: [new ModLoaderPackageMapping("BepInEx-BepInExPack_AcrossTheObelisk", "BepInExPack_AcrossTheObelisk", PackageLoader.BEPINEX)],
};
// Exported separately from the definition in order to preserve the key names in the type definition.
// Otherwise this would become [key: string] and we couldn't use the game names for type hinting elsewhere.
// Casting is done here to ensure the values are ModLoaderPackageMapping[]
export type GAME_NAME = keyof typeof VARIANTS;
export const MOD_LOADER_VARIANTS: {[key in GAME_NAME]: ModLoaderPackageMapping[]} = VARIANTS;
2 changes: 1 addition & 1 deletion src/r2mm/manager/SettingsDexieStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class SettingsDexieStore extends Dexie {

// Add all games to store. Borked v2-3 locally
// Increment per game or change to settings.
this.version(50).stores(store);
this.version(51).stores(store);

this.activeGame = game;
this.global = this.table("value");
Expand Down

0 comments on commit 11a1ed8

Please sign in to comment.