diff --git a/.docs/Dockerfile b/.docs/Dockerfile
new file mode 100644
index 0000000..096ed9d
--- /dev/null
+++ b/.docs/Dockerfile
@@ -0,0 +1,3 @@
+FROM nginx:latest
+
+COPY ./web /usr/share/nginx/html
\ No newline at end of file
diff --git a/_docs/img/bridge.png b/.docs/web/img/bridge.png
similarity index 100%
rename from _docs/img/bridge.png
rename to .docs/web/img/bridge.png
diff --git a/_docs/img/bridge_added.png b/.docs/web/img/bridge_added.png
similarity index 100%
rename from _docs/img/bridge_added.png
rename to .docs/web/img/bridge_added.png
diff --git a/_docs/img/briefing_me.png b/.docs/web/img/briefing_me.png
similarity index 100%
rename from _docs/img/briefing_me.png
rename to .docs/web/img/briefing_me.png
diff --git a/_docs/img/briefing_mission.png b/.docs/web/img/briefing_mission.png
similarity index 100%
rename from _docs/img/briefing_mission.png
rename to .docs/web/img/briefing_mission.png
diff --git a/_docs/img/cap_routes.png b/.docs/web/img/cap_routes.png
similarity index 100%
rename from _docs/img/cap_routes.png
rename to .docs/web/img/cap_routes.png
diff --git a/_docs/img/carrierroutes.png b/.docs/web/img/carrierroutes.png
similarity index 100%
rename from _docs/img/carrierroutes.png
rename to .docs/web/img/carrierroutes.png
diff --git a/_docs/img/cas_mission.png b/.docs/web/img/cas_mission.png
similarity index 100%
rename from _docs/img/cas_mission.png
rename to .docs/web/img/cas_mission.png
diff --git a/_docs/img/kutaisi_dock_after.png b/.docs/web/img/kutaisi_dock_after.png
similarity index 100%
rename from _docs/img/kutaisi_dock_after.png
rename to .docs/web/img/kutaisi_dock_after.png
diff --git a/_docs/img/kutaisi_dock_before.png b/.docs/web/img/kutaisi_dock_before.png
similarity index 100%
rename from _docs/img/kutaisi_dock_before.png
rename to .docs/web/img/kutaisi_dock_before.png
diff --git a/_docs/img/kutaisi_loading_dock.png b/.docs/web/img/kutaisi_loading_dock.png
similarity index 100%
rename from _docs/img/kutaisi_loading_dock.png
rename to .docs/web/img/kutaisi_loading_dock.png
diff --git a/_docs/img/kutaisi_me.png b/.docs/web/img/kutaisi_me.png
similarity index 100%
rename from _docs/img/kutaisi_me.png
rename to .docs/web/img/kutaisi_me.png
diff --git a/_docs/img/sa2_mission_editor.png b/.docs/web/img/sa2_mission_editor.png
similarity index 100%
rename from _docs/img/sa2_mission_editor.png
rename to .docs/web/img/sa2_mission_editor.png
diff --git a/_docs/img/sa2_result.png b/.docs/web/img/sa2_result.png
similarity index 100%
rename from _docs/img/sa2_result.png
rename to .docs/web/img/sa2_result.png
diff --git a/_docs/img/script_install.png b/.docs/web/img/script_install.png
similarity index 100%
rename from _docs/img/script_install.png
rename to .docs/web/img/script_install.png
diff --git a/_docs/img/starting_stages.png b/.docs/web/img/starting_stages.png
similarity index 100%
rename from _docs/img/starting_stages.png
rename to .docs/web/img/starting_stages.png
diff --git a/_docs/img/strike_target.png b/.docs/web/img/strike_target.png
similarity index 100%
rename from _docs/img/strike_target.png
rename to .docs/web/img/strike_target.png
diff --git a/_docs/index.html b/.docs/web/index.html
similarity index 50%
rename from _docs/index.html
rename to .docs/web/index.html
index 511d204..3ba81de 100644
--- a/_docs/index.html
+++ b/.docs/web/index.html
@@ -32,28 +32,23 @@
-
Welcome to Spearhead!
-
-
Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).
-
Together with mission editors we've tried to build a framework that makes creating multiplayer missions as easy as possible.
-
- With the help of naming conventions, trigger zones, pre-configured logic and custom configuration items, it gives a huge amount of versatility.
- we're trying to strike a balance between no-code and low-code with the possibility to hook into it for the hard core scripters (like ourselves).
-
-
- For the scripters : If you yourself are a scripter, and you're missing interfaces, please reach out to us! We want to make sure that the framework is as easy to use for scripters as it is for non-scripters, and we can't do that without your help!
-
-
-
- Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier.
-
-
-
-
+
Welcome to Spearhead!
+
Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).
+
Together with mission editors we've tried to build a framework that
+ makes creating multiplayer missions as easy as possible.
+ With the help of naming conventions, trigger zones, pre-configured
+ logic and custom configuration items, it gives a huge amount of versatility.
+ we're trying to strike a balance between no-code and low-code with the possibility to hook into it for
+ the hard core scripters.
+
+
+ Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier.
+
+
+
-
diff --git a/_docs/js/components.js b/.docs/web/js/components.js
similarity index 100%
rename from _docs/js/components.js
rename to .docs/web/js/components.js
diff --git a/_docs/js/components/code-block.js b/.docs/web/js/components/code-block.js
similarity index 100%
rename from _docs/js/components/code-block.js
rename to .docs/web/js/components/code-block.js
diff --git a/_docs/js/components/code-inline.js b/.docs/web/js/components/code-inline.js
similarity index 100%
rename from _docs/js/components/code-inline.js
rename to .docs/web/js/components/code-inline.js
diff --git a/_docs/js/components/header.js b/.docs/web/js/components/header.js
similarity index 100%
rename from _docs/js/components/header.js
rename to .docs/web/js/components/header.js
diff --git a/_docs/js/components/latest-version-download.js b/.docs/web/js/components/latest-version-download.js
similarity index 92%
rename from _docs/js/components/latest-version-download.js
rename to .docs/web/js/components/latest-version-download.js
index d0a2e9c..6c3cc8b 100644
--- a/_docs/js/components/latest-version-download.js
+++ b/.docs/web/js/components/latest-version-download.js
@@ -38,7 +38,7 @@ class DownloadScript extends HTMLElement {
}
try {
- const response = await fetch('https://api.github.com/repos/dutchie031/Spearhead/releases/latest');
+ const response = await fetch('https://git.dutchie031.com/api/v1/repos/Spearhead/spearhead/releases/latest');
const data = await response.json();
// Cache the data
@@ -66,7 +66,7 @@ class DownloadScript extends HTMLElement {
var version = "?";
var timestamp = "?";
var size = "?";
- var href = "https://github.com/dutchie031/Spearhead/releases"
+ var href = "https://git.dutchie031.com/Spearhead/spearhead/releases"
const latestRelease = await this.fetchLatestRelease();
if (latestRelease) {
@@ -105,7 +105,7 @@ class DownloadScript extends HTMLElement {
${version} (${timestamp})
Download (${size})
- See All Versions here
+ See All Versions here
diff --git a/_docs/js/components/note.js b/.docs/web/js/components/note.js
similarity index 100%
rename from _docs/js/components/note.js
rename to .docs/web/js/components/note.js
diff --git a/_docs/js/components/sidebar.js b/.docs/web/js/components/sidebar.js
similarity index 100%
rename from _docs/js/components/sidebar.js
rename to .docs/web/js/components/sidebar.js
diff --git a/_docs/js/prism.js b/.docs/web/js/prism.js
similarity index 100%
rename from _docs/js/prism.js
rename to .docs/web/js/prism.js
diff --git a/_docs/js/site.js b/.docs/web/js/site.js
similarity index 100%
rename from _docs/js/site.js
rename to .docs/web/js/site.js
diff --git a/_docs/pages/about_us.html b/.docs/web/pages/about_us.html
similarity index 95%
rename from _docs/pages/about_us.html
rename to .docs/web/pages/about_us.html
index afd97cf..298cd7b 100644
--- a/_docs/pages/about_us.html
+++ b/.docs/web/pages/about_us.html
@@ -37,8 +37,10 @@
Even though, at the time of writing this, I've written every single line of code myself, I could not have done it without the help of these members.
Therefore it's something WE created.
- Our goal was very simple, make it possible to make big dynamic missions, without having to either give away all control or having to get knee deep into scripting.
- We struck a balance.
+ Our goal was very simple, make it possible to make big dynamic missions, without having to either give away all controll or having to get knee deep into scripting.
+ We struck a balance.
+
+
diff --git a/_docs/pages/advanced/CAP.html b/.docs/web/pages/advanced/CAP.html
similarity index 100%
rename from _docs/pages/advanced/CAP.html
rename to .docs/web/pages/advanced/CAP.html
diff --git a/_docs/pages/advanced/map-markings.html b/.docs/web/pages/advanced/map-markings.html
similarity index 100%
rename from _docs/pages/advanced/map-markings.html
rename to .docs/web/pages/advanced/map-markings.html
diff --git a/_docs/pages/advanced/missions.html b/.docs/web/pages/advanced/missions.html
similarity index 100%
rename from _docs/pages/advanced/missions.html
rename to .docs/web/pages/advanced/missions.html
diff --git a/_docs/pages/first-start.html b/.docs/web/pages/first-start.html
similarity index 98%
rename from _docs/pages/first-start.html
rename to .docs/web/pages/first-start.html
index 917e450..4c68496 100644
--- a/_docs/pages/first-start.html
+++ b/.docs/web/pages/first-start.html
@@ -90,13 +90,13 @@
Missions are also defined by trigger zones.
They'll be picked up by Spearhead when named according to the naming convention:
MISSION_[Type]_[FreeForm]
- Where [Type] is the type of mission. See all
+ Where [Type] is the type of mission.
CAS
- Personally CAS is one of my favorite mission types.
+ Personally CAS is one of our favorite mission types.
Mostly because it's easy to set up and creates a truly immersive experience.
diff --git a/_docs/pages/include-script.html b/.docs/web/pages/include-script.html
similarity index 100%
rename from _docs/pages/include-script.html
rename to .docs/web/pages/include-script.html
diff --git a/_docs/pages/persistence.html b/.docs/web/pages/persistence.html
similarity index 100%
rename from _docs/pages/persistence.html
rename to .docs/web/pages/persistence.html
diff --git a/_docs/pages/reference.html b/.docs/web/pages/reference.html
similarity index 97%
rename from _docs/pages/reference.html
rename to .docs/web/pages/reference.html
index 34a1228..01e2bf8 100644
--- a/_docs/pages/reference.html
+++ b/.docs/web/pages/reference.html
@@ -80,22 +80,11 @@
Example: MISSION_DEAD_BYRON
- Missions are completable objectives with specific types.
+ Missions are completable objectives with specific types, such as DEAD, BAI, STRIKE, or SAM.
Randomized missions can be defined using the format: RANDOMMISSION_[Type]_[Name]_[Index] .
-
- Valid Types:
-
- SAM
- DEAD
- BAI
- CAS
- STRIKE
-
-
-
CAP Routes
Format: CAPROUTE_[routeID]_[Name]
diff --git a/_docs/pages/spearheadapi.html b/.docs/web/pages/spearheadapi.html
similarity index 100%
rename from _docs/pages/spearheadapi.html
rename to .docs/web/pages/spearheadapi.html
diff --git a/_docs/pages/tutorials.html b/.docs/web/pages/tutorials.html
similarity index 100%
rename from _docs/pages/tutorials.html
rename to .docs/web/pages/tutorials.html
diff --git a/_docs/style/prism.css b/.docs/web/style/prism.css
similarity index 100%
rename from _docs/style/prism.css
rename to .docs/web/style/prism.css
diff --git a/_docs/style/style.css b/.docs/web/style/style.css
similarity index 100%
rename from _docs/style/style.css
rename to .docs/web/style/style.css
diff --git a/.gitea/workflows/static_pages.yml b/.gitea/workflows/static_pages.yml
index b8ede01..e168c79 100644
--- a/.gitea/workflows/static_pages.yml
+++ b/.gitea/workflows/static_pages.yml
@@ -2,16 +2,12 @@
name: Deploy static content to Pages
on:
- # Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
- release:
- types: [published]
-
-# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
-permissions:
- contents: read
- pages: write
- id-token: write
+ push:
+ branches:
+ - main
+ paths:
+ - '_docs/**'
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
diff --git a/.gitea/workflows/update-docs.yml b/.gitea/workflows/update-docs.yml
new file mode 100644
index 0000000..88ee6a7
--- /dev/null
+++ b/.gitea/workflows/update-docs.yml
@@ -0,0 +1,128 @@
+name: Update Docs
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ paths:
+ - '.docs/**'
+
+env:
+ DOCKER_REGISTRY: registry.dutchie031.net
+ DOCKER_IMAGE: spearhead-docs
+ DOCKER_TAG: latest
+
+jobs:
+ ## Run replacements and cleanups on the docs
+ prepare-docs:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ ## --break-system-packages is used to avoid conflicts with system-installed packages on Ubuntu runners.
+ - name: Install Python Pygments
+ run: |
+ python3 -m pip install --upgrade pip --break-system-packages --no-cache-dir --ignore-installed
+ pip install pygments --break-system-packages
+
+ - name: Highlight API code and update HTML
+ run: |
+ pygmentize -f html -l lua -O noclasses,style=monokai src/classes/api/SpearheadApiDoc.lua > .docs/web/pages/temp_api_code.html
+ # Insert the highlighted code into the placeholder in spearheadapi.html
+ sed -i '/@@API_CODE@@/r .docs/web/pages/temp_api_code.html' .docs/web/pages/spearheadapi.html
+ sed -i '/@@API_CODE@@/d' .docs/web/pages/spearheadapi.html
+ rm .docs/web/pages/temp_api_code.html
+
+ - name: Highlight API code and update HTML
+ run: |
+ pygmentize -f html -l lua -O noclasses,style=monokai ./config.lua > .docs/web/pages/temp_config_code.html
+ # Insert the highlighted code into the placeholder in spearheadapi.html
+ sed -i '/@@CONFIG_CODE@@/r .docs/web/pages/temp_config_code.html' .docs/web/pages/reference.html
+ sed -i '/@@CONFIG_CODE@@/d' .docs/web/pages/reference.html
+ rm .docs/web/pages/temp_config_code.html
+
+ - name: List files in .docs directory
+ run: |
+ echo "Listing files in .docs directory:"
+ ls -R .docs
+
+ - name: Upload spearhead.lua artifact
+ uses: actions/upload-artifact@v3
+ with:
+ name: spearhead-docs
+ path: |
+ ./.docs/Dockerfile
+ ./.docs/web/**/*
+ retention-days: 1
+
+ build-image:
+ runs-on: ubuntu-latest
+ needs: prepare-docs
+ steps:
+
+ # Download prepared pages from the previous job
+ - name: Download spearhead-docs artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: spearhead-docs
+ path: ./spearhead-docs
+
+ - name: DEBUG ls
+ run: |
+ ls -R ./spearhead-docs
+
+ - name: Build Docker image for docs
+ run: |
+ docker build -t ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} ./spearhead-docs
+
+ - name: Push Docker image
+ run: |
+ docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}
+
+
+ deploy-container:
+ runs-on: ubuntu-latest
+ needs: build-image
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Setup Helm
+ uses: azure/setup-helm@v5
+ with:
+ version: 'latest'
+ id: install
+
+ - name: Set up Kubeconfig
+ run: |
+ mkdir -p $HOME/.kube
+ echo "${{ secrets.KUBECONFIG_CONTENT }}" > $HOME/.kube/config
+ chmod 600 $HOME/.kube/config
+ cat $HOME/.kube/config
+
+ - name: Run Helm upgrade/install
+ run: |
+ helm upgrade --install spearhead-docs .helm \
+ --namespace spearhead-docs \
+ --create-namespace \
+ --set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \
+ --set image.tag=${{ env.DOCKER_TAG }} \
+ --wait
+
+ # - name: 'Deploy'
+ # uses: deliverybot/helm@v1
+ # with:
+ # release: spearhead-docs
+ # namespace: spearhead-docs
+ # chart: '.helm'
+ # value-files: >-
+ # [
+ # ".helm/values.yaml"
+ # ]
+ # env:
+ # KUBECONFIG_FILE: ${{ secrets.KUBECONFIG_CONTENT }}
diff --git a/.helm/Chart.yaml b/.helm/Chart.yaml
new file mode 100644
index 0000000..1c81b9f
--- /dev/null
+++ b/.helm/Chart.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+name: spearhead-docs
+description: Helm chart for deploying Spearhead documentation
+type: application
+version: 1.0.0
+appVersion: "1.0"
+keywords:
+ - spearhead
+ - documentation
+ - dcs
+home: https://git.dutchie031.com/Spearhead/spearhead
+sources:
+ - https://git.dutchie031.com/Spearhead/Spearhead
+maintainers:
+ - name: Spearhead Team
+
\ No newline at end of file
diff --git a/.helm/templates/deployment.yaml b/.helm/templates/deployment.yaml
new file mode 100644
index 0000000..4299185
--- /dev/null
+++ b/.helm/templates/deployment.yaml
@@ -0,0 +1,44 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ .Values.app }}
+ labels:
+ app: {{ .Values.app }}
+ namespace: spearhead-docs
+
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ .Values.app }}
+ template:
+ metadata:
+ labels:
+ app: {{ .Values.app }}
+ spec:
+ securityContext:
+ runAsNonRoot: true
+ runAsUser: 65534
+ seccompProfile:
+ type: RuntimeDefault
+ containers:
+ - name: {{ .Values.app }}
+ image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
+ ports:
+ - containerPort: {{ .Values.ports.containerPort }}
+ volumeMounts:
+ - name: cache
+ mountPath: /var/cache/nginx
+ - name: run
+ mountPath: /var/run
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ volumes:
+ - name: cache
+ emptyDir: {}
+ - name: run
+ emptyDir: {}
+
\ No newline at end of file
diff --git a/.helm/templates/network.yaml b/.helm/templates/network.yaml
new file mode 100644
index 0000000..e50e6e2
--- /dev/null
+++ b/.helm/templates/network.yaml
@@ -0,0 +1,49 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Values.app }}
+ namespace: spearhead-docs
+spec:
+ selector:
+ app: {{ .Values.app }}
+ ports:
+ - protocol: TCP
+ port: {{ .Values.ports.servicePort }}
+ targetPort: {{ .Values.ports.containerPort }}
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: {{ .Values.app }}-ingress
+ namespace: spearhead-docs
+ annotations:
+ kubernetes.io/tls-acme: "true"
+ cert-manager.io/cluster-issuer: "letsencrypt-prod"
+spec:
+ ingressClassName: nginx
+ rules:
+ - host: spearhead.dutchie031.com
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: {{ .Values.app }}
+ port:
+ number: {{ .Values.ports.servicePort }}
+ - host: spearhead.rocks
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: {{ .Values.app }}
+ port:
+ number: {{ .Values.ports.servicePort }}
+ tls:
+ - hosts:
+ - spearhead.dutchie031.com
+ - spearhead.rocks
+ secretName: spearhead-docs-tls
\ No newline at end of file
diff --git a/.helm/values.yaml b/.helm/values.yaml
new file mode 100644
index 0000000..499fdcb
--- /dev/null
+++ b/.helm/values.yaml
@@ -0,0 +1,10 @@
+
+app: spearhead-docs
+
+image:
+ repository: registry.dutchie031.net/spearhead-docs
+ tag: latest
+
+ports:
+ servicePort: 80
+ containerPort: 80
\ No newline at end of file
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index ebc0efe..fb2d13d 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -1,5 +1,5 @@
-### [Unreleased]
+## [Unreleased]
### Breaking Changes
@@ -7,6 +7,17 @@
### Bug Fixes
+
+## [0.12.1] 2026-07
+
+### Breaking Changes
+
+### New Features
+
+### Bug Fixes
+
+- Fixed stage drawing to only be checked when a stage completed. Now done on stage number changed.
+
## [0.12.0] 2026-06
Migration to Gitea.
diff --git a/_docs/img/first-start/1.png b/_docs/img/first-start/1.png
deleted file mode 100644
index cb3ff69..0000000
Binary files a/_docs/img/first-start/1.png and /dev/null differ
diff --git a/src/classes/stageClasses/GlobalStageManager.lua b/src/classes/stageClasses/GlobalStageManager.lua
index 140ca47..ad232a3 100644
--- a/src/classes/stageClasses/GlobalStageManager.lua
+++ b/src/classes/stageClasses/GlobalStageManager.lua
@@ -20,7 +20,7 @@ local WaitingStagesByIndex = {}
local currentStage = -99
----@class GlobalStageManager : StageCompleteListener
+---@class GlobalStageManager : StageCompleteListener, OnStageChangedListener
---@field private database Database
---@field private logger Logger
---@field private stageConfig StageConfig
@@ -47,15 +47,7 @@ function GlobalStageManager.NewAndStart(database, stageConfig, logLevel, spawnMa
logger:warn("Spearhead will not automatically progress stages due to the given settings. If you manually have implemented this, please ignore this message")
end
- ---@type OnStageChangedListener
- local OnStageNumberChangedListener = {
- OnStageNumberChanged = function (self, number)
- currentStage = number
- end
- }
-
-
- Events.AddStageNumberChangedListener(OnStageNumberChangedListener)
+ Events.AddStageNumberChangedListener(self)
for _, stageName in pairs(database:getStagezoneNames()) do
logger:debug("Found stage zone with name: " .. stageName)
@@ -208,13 +200,20 @@ function GlobalStageManager:OnStageComplete(stage)
if anyWaiting == false then
local newStageNumber = currentStage + 1
- self:UpdateDrawings(newStageNumber)
self.logger:debug("Setting next stage to: " .. tostring(newStageNumber))
Events.PublishStageNumberChanged(newStageNumber)
end
end
end
+---@public
+function GlobalStageManager:OnStageNumberChanged(stageNumber)
+ self.logger:debug("Stage number changed to: " .. tostring(stageNumber))
+ currentStage = stageNumber
+
+ self:UpdateDrawings(stageNumber)
+end
+
---@private
function GlobalStageManager:UpdateDrawings(stageNumber)
local drawings = self.database:getCustomDrawings()
diff --git a/version.txt b/version.txt
index d33c3a2..aac2dac 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.12.0
\ No newline at end of file
+0.12.1
\ No newline at end of file