Skip to content

Commit aa5d508

Browse files
committed
Refactor GameHUD UI to modular templates and styles
Reworked the GameHUD.uxml to use modular UI Toolkit templates for construction, deployment monitor, info, overlays, top bar, and VS panel. Split the monolithic GameHUDStyles.uss into multiple focused USS files (HUDVariables, HUDLayouts, HUDComponents, HUDDeploymentMonitor, HUDVSOverlays) and updated references accordingly. Added new UXML templates for ConstructionPanel, DeploymentMonitor, InfoPanels, OverlayPanels, TopBar, and VSPanel. Updated material files to change _SunDirection values. This improves maintainability, scalability, and visual consistency of the UI.
1 parent fef2162 commit aa5d508

30 files changed

+614
-282
lines changed

Red Strike/Assets/NetworkingSystem/CommanderData.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public void RPC_SpawnVehicle(string vehicleName, Vector3 position)
107107
}
108108
}
109109

110-
111110
[Rpc(RpcSources.InputAuthority, RpcTargets.StateAuthority)]
112111
public void RPC_SpawnAmmunition(
113112
string ammunitionName,

Red Strike/Assets/PlanetAtmosphereSystem/AtmosphereMaterial.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Material:
4747
- _GunesYonu: {r: -0.91, g: 0.4, b: 3.24, a: 0}
4848
- _RenkUzak: {r: 0, g: 0.10166844, b: 2.152374, a: 1}
4949
- _RenkYakin: {r: 0, g: 5.670685, b: 8, a: 1}
50-
- _SunDirection: {r: 0.0034775808, g: 0.9997995, b: -0.01972233, a: 0}
50+
- _SunDirection: {r: 0.14699276, g: -0.53239363, b: -0.8336367, a: 0}
5151
m_BuildTextureStacks: []
5252
m_AllowLocking: 1
5353
--- !u!114 &1522106816477559216

Red Strike/Assets/PlanetAtmosphereSystem/CloudMaterial.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Material:
4343
m_Colors:
4444
- _Color: {r: 0, g: 3.8274493, b: 5.992155, a: 1}
4545
- _GunesYonu: {r: -1, g: 0, b: 0, a: 0}
46-
- _SunDirection: {r: 0.0034775808, g: 0.9997995, b: -0.01972233, a: 0}
46+
- _SunDirection: {r: 0.14699276, g: -0.53239363, b: -0.8336367, a: 0}
4747
m_BuildTextureStacks: []
4848
m_AllowLocking: 1
4949
--- !u!114 &8499732345945835446

Red Strike/Assets/PlanetAtmosphereSystem/FogMaterial.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ Material:
5454
- _QueueControl: 0
5555
- _QueueOffset: 0
5656
m_Colors:
57-
- _SunDirection: {r: 0.0034775808, g: 0.9997995, b: -0.01972233, a: 0}
57+
- _SunDirection: {r: 0.14699276, g: -0.53239363, b: -0.8336367, a: 0}
5858
m_BuildTextureStacks: []
5959
m_AllowLocking: 1
Lines changed: 43 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,55 @@
11
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:engine="UnityEngine.UIElements" editor-extension-mode="False">
2-
<!-- Stil Dosyası -->
3-
<Style src="project://database/Assets/UI%20Toolkit/GameHUDStyles.uss?fileID=7433441132597879392&amp;guid=76481a45a761bb147acf1059658d7ddd&amp;type=3#GameHUDStyles" />
4-
5-
<!-- ROOT -->
6-
<ui:VisualElement name="root-container" picking-mode="Ignore" style="width: 100%; height: 100%;">
7-
8-
<!-- TOP BAR -->
9-
<ui:VisualElement name="top-bar-container" class="top-bar" picking-mode="Position" />
10-
11-
<!-- LEFT PANEL -->
12-
<ui:VisualElement name="left-panel" class="side-panel" picking-mode="Position">
13-
<ui:Button text="Main Station" name="main-station-button" class="build-button" />
14-
<ui:Button text="Hangar" name="hangar-button" class="build-button" />
15-
<ui:Button text="Energy Tower" name="energy-tower-button" class="build-button" />
2+
3+
<ui:Template name="ConstructionPanel" src="project://database/Assets/UISystem/Templates/ConstructionPanel.uxml?fileID=9197481963319205126&amp;guid=9aa1e599dfc8cd14b929981e240e8eb3&amp;type=3#ConstructionPanel" />
4+
<ui:Template name="DeploymentMonitor" src="project://database/Assets/UISystem/Templates/DeploymentMonitor.uxml?fileID=9197481963319205126&amp;guid=8e4b16f919eb69b47a0107ddd97850e8&amp;type=3#DeploymentMonitor" />
5+
<ui:Template name="InfoPanels" src="project://database/Assets/UISystem/Templates/InfoPanels.uxml?fileID=9197481963319205126&amp;guid=90ed04409a9899f4b979ec99b034e516&amp;type=3#InfoPanels" />
6+
<ui:Template name="OverlayPanels" src="project://database/Assets/UISystem/Templates/OverlayPanels.uxml?fileID=9197481963319205126&amp;guid=837353a900555744c8b7ff84af0b7170&amp;type=3#OverlayPanels" />
7+
<ui:Template name="TopBar" src="project://database/Assets/UISystem/Templates/TopBar.uxml?fileID=9197481963319205126&amp;guid=64ac0276179d92042be6c1918759d05e&amp;type=3#TopBar" />
8+
<ui:Template name="VSPanel" src="project://database/Assets/UISystem/Templates/VSPanel.uxml?fileID=9197481963319205126&amp;guid=ca336e664243e0e4da6e6df43adbcc14&amp;type=3#VSPanel" />
9+
10+
<Style src="project://database/Assets/UISystem/Styles/HUDVariables.uss?fileID=7433441132597879392&amp;guid=529a8cddc609549449b35620f337d689&amp;type=3#HUDVariables" />
11+
<Style src="project://database/Assets/UISystem/Styles/HUDLayouts.uss?fileID=7433441132597879392&amp;guid=9411b51df6374034386208321453b214&amp;type=3#HUDLayouts" />
12+
<Style src="project://database/Assets/UISystem/Styles/HUDComponents.uss?fileID=7433441132597879392&amp;guid=06d2fa809ade4fd4495f97ebd5509a2b&amp;type=3#HUDComponents" />
13+
<Style src="project://database/Assets/UISystem/Styles/HUDDeploymentMonitor.uss?fileID=7433441132597879392&amp;guid=de6bd60526d71654a8da52203aeb4b42&amp;type=3#HUDDeploymentMonitor" />
14+
<Style src="project://database/Assets/UISystem/Styles/HUDVSOverlays.uss?fileID=7433441132597879392&amp;guid=46f4d98b9b134ae498e7d57cce3fffa2&amp;type=3#HUDVSOverlays" />
15+
16+
<!-- YENİ GRID YAPISI (Picking Mode Ignore: Oyuna tıklamayı engellememesi için) -->
17+
<ui:VisualElement name="root-container" class="root-interface" picking-mode="Ignore">
18+
19+
<!-- 1. ÜST KISIM (HEADER) -->
20+
<ui:VisualElement class="header-area" picking-mode="Ignore">
21+
<!-- TopBar Şablonunu buraya koyuyoruz -->
22+
<ui:Instance template="TopBar" name="TopBarInstance" style="width: 100%; height: 100%;" />
1623
</ui:VisualElement>
1724

18-
<!-- RIGHT PANEL 1 -->
19-
<ui:VisualElement name="building-details-panel" class="info-panel" style="display: none;" picking-mode="Position">
20-
<ui:Label text="Build Type:" name="shared-build-type-label" class="details-title" />
21-
<ui:Label text="Health:" name="shared-health-label" class="details-text" />
22-
<ui:VisualElement style="height: 1px; background-color: rgb(100, 100, 100); margin-top: 5px; margin-bottom: 5px;" />
23-
<ui:VisualElement name="building-dynamic-content-container">
24-
<ui:VisualElement name="main-station-content-area" style="display: none;">
25-
<ui:Label text="Shield:" name="shield-label" class="details-text" />
26-
</ui:VisualElement>
27-
<ui:VisualElement name="energy-tower-content-area" style="display: none;">
28-
<ui:Label text="Capacity:" name="capacity-label" class="details-text" />
29-
<ui:Label text="Density:" name="density-label" class="details-text" />
30-
</ui:VisualElement>
31-
<ui:VisualElement name="hangar-content-area" style="display: none;">
32-
<ui:Label text="Is Ready:" name="is-ready-label" class="details-text" />
33-
<ui:Label text="In production:" name="in-production-label" class="details-text" />
34-
<ui:ScrollView mode="Vertical" style="max-height: 300px;">
35-
<ui:Button text="Create Infantry" name="infantry-create-button" class="action-button" />
36-
<ui:Button text="Create Trike" name="trike-create-button" class="action-button" />
37-
<ui:Button text="Create Quad" name="quad-create-button" class="action-button" />
38-
<ui:Button text="Create Tank Combat" name="tank-combat-create-button" class="action-button" />
39-
<ui:Button text="Create Tank Heavy A" name="tank-heavy-a-create-button" class="action-button" />
40-
<ui:Button text="Create Tank Heavy B" name="tank-heavy-b-create-button" class="action-button" />
41-
<ui:Button text="Create Ornithopter A" name="ornithopter-a-create-button" class="action-button" />
42-
<ui:Button text="Create Ornithopter B" name="ornithopter-b-create-button" class="action-button" />
43-
</ui:ScrollView>
44-
</ui:VisualElement>
25+
<!-- 2. ORTA KISIM (MAIN BODY - 3 Sütunlu) -->
26+
<ui:VisualElement class="main-content-area" picking-mode="Ignore">
27+
28+
<!-- SOL SÜTUN -->
29+
<ui:VisualElement class="column-left" picking-mode="Ignore">
30+
<ui:Instance template="ConstructionPanel" name="ConstructionInstance" />
4531
</ui:VisualElement>
46-
</ui:VisualElement>
4732

48-
<!-- RIGHT PANEL 2 -->
49-
<ui:VisualElement name="vehicle-details-panel" class="info-panel" style="display: none;" picking-mode="Position">
50-
<ui:Label text="Vehicle:" name="shared-vehicle-name-label" class="details-title" />
51-
<ui:Label text="Health:" name="shared-vehicle-health-label" class="details-text" />
52-
<ui:Label text="Fuel:" name="shared-vehicle-fuel-label" class="details-text" />
53-
<ui:Label text="Ammunition:" name="shared-vehicle-ammo-label" class="details-text" />
54-
<ui:Label text="Target:" name="shared-vehicle-target-label" class="details-text" />
55-
<ui:VisualElement name="vehicle-dynamic-content-container" class="dynamic-content" />
56-
</ui:VisualElement>
33+
<!-- ORTA SÜTUN (Otomatik Ortalar) -->
34+
<ui:VisualElement class="column-center" picking-mode="Ignore">
35+
<ui:Instance template="DeploymentMonitor" name="DeploymentInstance" />
36+
</ui:VisualElement>
37+
38+
<!-- SAĞ SÜTUN -->
39+
<ui:VisualElement class="column-right" picking-mode="Ignore">
40+
<ui:Instance template="InfoPanels" name="InfoInstance" />
41+
</ui:VisualElement>
5742

58-
<!-- GAME OVER PANEL -->
59-
<ui:VisualElement name="game-over-panel" class="overlay-panel" style="display: none;" picking-mode="Position">
60-
<ui:Label text="Game Over" name="game-over-title" class="overlay-title" />
61-
<ui:Label text="You have been defeated!" name="game-over-message" class="overlay-message" />
62-
<ui:Button text="Return to Main Menu" name="return-to-menu-button" class="overlay-button" />
6343
</ui:VisualElement>
6444

65-
<!-- VICTORY PANEL -->
66-
<ui:VisualElement name="victory-panel" class="overlay-panel" style="display: none;" picking-mode="Position">
67-
<ui:Label text="VICTORY!" name="victory-title" class="victory-title" />
68-
<ui:Label text="Mission Accomplished, Commander." name="victory-message" class="overlay-message" />
69-
<ui:Button text="Menu" name="victory-menu-button" class="victory-secondary-button" />
45+
<!-- 3. ALT KISIM (FOOTER) -->
46+
<ui:VisualElement class="footer-area" picking-mode="Ignore">
47+
<ui:Instance template="VSPanel" name="VSInstance" style="width: 100%; height: 100%;" />
7048
</ui:VisualElement>
7149

72-
<!-- FADE PANEL -->
50+
<!-- 4. TAM EKRAN KAPLAMALAR (Grid dışı, en üstte) -->
51+
<ui:Instance template="OverlayPanels" name="OverlayInstance" />
7352
<ui:VisualElement name="fade-panel" class="fade-panel" style="display: none;" />
53+
7454
</ui:VisualElement>
75-
</ui:UXML>
55+
</ui:UXML>

Red Strike/Assets/UISystem/GameHUDStyles.uss

Lines changed: 0 additions & 214 deletions
This file was deleted.

Red Strike/Assets/UISystem/Styles.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.build-button, .action-button, .overlay-button {
2+
background-color: rgba(0, 80, 100, 0.4);
3+
color: white;
4+
border-width: 1px; border-color: var(--secondary-blue);
5+
height: 35px; margin-bottom: 5px; -unity-font-style: bold;
6+
}
7+
.build-button:hover { background-color: var(--primary-cyan); color: black; }
8+
.details-title {
9+
color: var(--primary-cyan); font-size: 16px; -unity-font-style: bold;
10+
border-bottom-width: 1px; border-bottom-color: rgba(0, 255, 255, 0.2); margin-bottom: 10px;
11+
}
12+
.health-bar .unity-progress-bar__progress { background-color: var(--danger-red); }
13+
.fuel-bar .unity-progress-bar__progress { background-color: var(--secondary-blue); }
14+
.unity-progress-bar__container { height: 12px; margin-bottom: 5px; }

0 commit comments

Comments
 (0)