Skip to content

Commit

Permalink
Merge pull request #1 from GeckoEidechse/main
Browse files Browse the repository at this point in the history
feat: Show own version number in settings view (#11)
  • Loading branch information
TH3-S4LM0N authored Oct 8, 2022
2 parents d352b40 + ef95fbe commit e29cf4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src-vue/src/plugins/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface FlightCoreStore {
game_path: string,
install_type: InstallType,

flightcore_version: string,

installed_northstar_version: string,
northstar_state: NorthstarState,
release_canal: ReleaseCanal,
Expand All @@ -31,6 +33,8 @@ export const store = createStore<FlightCoreStore>({
game_path: undefined as unknown as string,
install_type: undefined as unknown as InstallType,

flightcore_version: "",

installed_northstar_version: "",
northstar_state: NorthstarState.GAME_NOT_FOUND,
release_canal: ReleaseCanal.RELEASE,
Expand Down Expand Up @@ -139,6 +143,9 @@ async function _initializeApp(state: any) {
state.developer_mode = true;
}

// Get FlightCore version number
state.flightcore_version = await invoke("get_version_number");

const result = await invoke("find_game_install_location_caller")
.catch((err) => {
// Gamepath not found or other error
Expand All @@ -163,13 +170,10 @@ async function _checkForFlightCoreUpdates(state: FlightCoreStore) {
// Check if FlightCore up-to-date
let flightcore_is_outdated = await invoke("check_is_flightcore_outdated_caller") as boolean;

// Get FlightCore version number
let flightcore_version_number = await invoke("get_version_number") as string;

if (flightcore_is_outdated) {
ElNotification({
title: 'FlightCore outdated!',
message: `Please update FlightCore. Running outdated version ${flightcore_version_number}`,
message: `Please update FlightCore. Running outdated version ${state.flightcore_version}`,
type: 'warning',
position: 'bottom-right',
duration: 0 // Duration `0` means the notification will not auto-vanish
Expand Down
8 changes: 8 additions & 0 deletions src-vue/src/views/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
</template>
</el-input>
<h3>About:</h3>
FlightCore Version: {{ flightcoreVersion === '' ? 'Unknown version' : `${flightcoreVersion}` }}
<br />
<br />
UI design inspired by <el-link :underline="false" target="_blank" href="https://github.com/TFORevive/tforevive_launcher/" type="primary">TFORevive Launcher</el-link> (not yet public)
</div>
</template>
Expand All @@ -26,6 +29,11 @@ import { ElNotification } from 'element-plus';
export default defineComponent({
name: "SettingsView",
computed: {
flightcoreVersion(): string {
return this.$store.state.flightcore_version;
},
},
methods: {
async updateGamePath() {
// Open a selection dialog for directories
Expand Down

0 comments on commit e29cf4b

Please sign in to comment.