Skip to content

Commit

Permalink
Add support for Taptap Global version
Browse files Browse the repository at this point in the history
  • Loading branch information
soyasoya5 committed Nov 24, 2020
1 parent bf9947a commit b296c4f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion android/app/src/main/java/com/dcmodmanager/DCTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ public static DCModel pckToModel(Pck pck) throws Exception {
}

public static File getDCModelInfoPath() {
return new File(APPS_PATH + "/com.linegames.dcglobal/files/asset/character/model_info.json");
File modelInfo = new File(APPS_PATH + "/com.linegames.dcglobal/files/asset/character/model_info.json");
if (!modelInfo.exists()) {
modelInfo = new File(APPS_PATH + "/com.linegames.dcglobal.xsolla/files/asset/character/model_info.json");
}

return modelInfo;
}
}
4 changes: 4 additions & 0 deletions src/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const Settings = ({config, setConfig}) => {
<Card.Title title="Game Region" />
<Card.Content>
<RadioButton.Group onValueChange={value => setConfig({region: value})} value={config.region}>
<RadioButton.Item
label={'Global (Taptap) - com.linegames.dcglobal.xsolla' + (config.installedRegions.indexOf('global_tap') < 0 ? ' (not installed)' : '')}
value="global_tap"
disabled={config.installedRegions.indexOf('global_tap') < 0} />
<RadioButton.Item
label={'Global - com.linegames.dcglobal' + (config.installedRegions.indexOf('global') < 0 ? ' (not installed)' : '')}
value="global"
Expand Down
4 changes: 2 additions & 2 deletions src/actions/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {setLoading} from './loading'
import {loadInstalled} from './installed'
import {setView} from './view'
import RNFS from 'react-native-fs'
import {getSettingsPath, getDestinyChildPath} from '../lib/paths'
import {getSettingsPath, getDestinyChildPath, pathRegions} from '../lib/paths'

export const loadConfig = () =>
(dispatch) => {
const installedRegions = [],
regionPromises = [];
['global', 'kr', 'jp'].forEach(region => {
Object.keys(pathRegions).forEach(region => {
regionPromises.push(RNFS.exists(getDestinyChildPath(region)).then(exists => {
if(exists) installedRegions.push(region)
}))
Expand Down
5 changes: 4 additions & 1 deletion src/lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import RNFS from 'react-native-fs'
import store from './store'

const regions = {
global_tap: 'com.linegames.dcglobal.xsolla',
global: 'com.linegames.dcglobal',
kr: 'com.NextFloor.DestinyChild',
jp: 'com.stairs.destinychild'
Expand Down Expand Up @@ -35,4 +36,6 @@ export const getSettingsPath = () => {
export const getInstalledPath = () => {
const region = store.getState().config.region
return getDcModManagerFolderPath() + `/installed${region}.json`
}
}

export { regions as pathRegions }

0 comments on commit b296c4f

Please sign in to comment.