Skip to content

Commit

Permalink
Use pkg_resources.parse_version to compare versions, changed version …
Browse files Browse the repository at this point in the history
…IDs to v0.2.0
  • Loading branch information
eliasdoehne committed Oct 13, 2018
1 parent 20aeabf commit 468afc0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

The stellaris dashboard is a program that reads your Stellaris save files while you play the game and shows you more detailed information and stats about your playthrough.

**Important**: This program only works for **singleplayer** games.

# Features

There are two main components: A **timeline dashboard** which shows you graphs of many statistics about the empires in your game, and an **event ledger** listing the events that define the history of your game.

By using [the game mod](https://steamcommunity.com/sharedfiles/filedetails/?id=1466534202) available on the steam workshop, the dashboard is available directly in-game through the integrated browser (by clicking the help icon).

**Important**: This program only works for **singleplayer** games. Also, other mods may or may not work, the program is developed with the vanilla game in mind. Which version of Stellaris is supported by a particular release should be annotated in the release notes, so if you use an older version of Stellaris, you could download one of the older releases, or try your luck with the most recent one.

## Timeline Dashboard

Here is an animation of the timeline dashboard in action:
Expand Down Expand Up @@ -116,7 +116,8 @@ The dashboard is quite complex and to my knowledge, making a mod with these feat
1. Budget numbers (especially if sectors are involved) may not always match up exactly (but should be close)
2. Loading save files out of order (with respect to in-game time) is not supported, and this will screw up the data.
3. Renaming things (leaders, planets, systems etc) after they have been added to the database might cause issues.

4. The dashboard may not work with other mods, it is developed with the vanilla game in mind.

If an error occurs, please try restarting the dashboard program. If you run into problems that don't go away after restarting, please start a new discussion topic [on the Steam workshop](https://steamcommunity.com/sharedfiles/filedetails/discussions/1466534202).


Expand Down
4 changes: 2 additions & 2 deletions mod/Dashboard/interface/browser.gui
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ guiTypes = {
quadTextureSprite = "GFX_button_timeline_index"
position = { x = -280 y = 26 }
Orientation = UPPER_RIGHT
web_link="http://127.0.0.1:28053/"
web_link="http://127.0.0.1:28053/checkversion/v0.2.0"
shortcut = "J"
}
buttonType =
Expand All @@ -106,7 +106,7 @@ guiTypes = {
quadTextureSprite = "GFX_button_event_history"
position = { x = -150 y = 21 }
Orientation = UPPER_RIGHT
web_link="http://127.0.0.1:28053/checkversion/v0.1.5/history"
web_link="http://127.0.0.1:28053/checkversion/v0.2.0/history"
shortcut = "L"
}

Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
print("Using pre-built C-extension if available, or (slow) fallback solution.")
extension_modules = []

# TODO: Fix the Cython extensions!

setup(
name="stellarisdashboard",
ext_modules=extension_modules,
Expand Down
9 changes: 7 additions & 2 deletions src/stellarisdashboard/dash_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import plotly.graph_objs as go
from dash.dependencies import Input, Output
from flask import render_template, request, redirect
from pkg_resources import parse_version

from stellarisdashboard import config, models, visualization_data, game_info

Expand All @@ -22,11 +23,15 @@
timeline_app.css.config.serve_locally = True
timeline_app.scripts.config.serve_locally = True

VERSION_ID = "v0.1.5"
VERSION_ID = "v0.2.0"


def is_old_version(requested_version: str) -> bool:
return requested_version != VERSION_ID
try:
req_version = parse_version(requested_version)
return parse_version(VERSION_ID) < req_version
except Exception:
return False


@flask_app.route("/")
Expand Down
5 changes: 3 additions & 2 deletions src/stellarisdashboard/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
{%if show_old_version_notice%}
<p>
You may be using an old version of the stellaris dashboard program. You are using version {{ version }}, and the requested version was {{ update_version_id }}.
You can get the most current version <a href=https://github.com/eliasdoehne/stellaris-dashboard class="textlink">on Github.</a>

You can get the current version <a href=https://github.com/eliasdoehne/stellaris-dashboard class="textlink">on Github.</a>
</p>
<p>
This update notice can be disabled in the <a href="/settings/" class="textlink">Dashboard Settings</a>.
</p>
{%endif%}
Expand Down

0 comments on commit 468afc0

Please sign in to comment.