Skip to content

Commit 0262d62

Browse files
committed
Add faction selection UI and data structure
Introduced new styles and UI elements for faction selection in the settings panel. Updated MenuComponents.uss with dedicated faction selector styles and refactored SettingsPanel.uxml to include a new faction selection row. Extended User.cs to support faction selections with a new FactionSelection class.
1 parent d49b922 commit 0262d62

File tree

6 files changed

+142
-16
lines changed

6 files changed

+142
-16
lines changed

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.13354853, g: -0.63915896, b: 0.757391, a: 0}
50+
- _SunDirection: {r: 0.030348197, g: 0.9846097, b: -0.17211302, 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.13354853, g: -0.63915896, b: 0.757391, a: 0}
46+
- _SunDirection: {r: 0.030348197, g: 0.9846097, b: -0.17211302, 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.13354853, g: -0.63915896, b: 0.757391, a: 0}
57+
- _SunDirection: {r: 0.030348197, g: 0.9846097, b: -0.17211302, a: 0}
5858
m_BuildTextureStacks: []
5959
m_AllowLocking: 1

Red Strike/Assets/UISystem/Styles/MenuComponents.uss

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,90 @@
205205
transition-duration: 4s;
206206
transition-timing-function: ease-in-out;
207207
display: flex;
208+
}
209+
210+
.faction-row {
211+
flex-direction: row;
212+
align-items: center;
213+
justify-content: space-between;
214+
margin-bottom: 15px;
215+
padding: 10px;
216+
background-color: rgba(255, 255, 255, 0.03);
217+
border-radius: 4px;
218+
}
219+
220+
.faction-selector-container {
221+
flex-direction: row;
222+
align-items: center;
223+
justify-content: flex-end;
224+
flex-grow: 1;
225+
}
226+
227+
.faction-card {
228+
width: 300px;
229+
height: 150px;
230+
margin-left: 10px;
231+
margin-right: 10px;
232+
233+
background-color: rgba(0, 255, 255, 0.05);
234+
border-width: 1px;
235+
border-color: var(--primary-cyan);
236+
border-radius: 8px;
237+
238+
padding: 10px;
239+
flex-direction: column;
240+
align-items: center;
241+
justify-content: center;
242+
}
243+
244+
.faction-card-icon {
245+
width: 50px;
246+
height: 50px;
247+
margin-bottom: 8px;
248+
background-color: rgba(0,0,0,0.3);
249+
border-radius: 6px;
250+
border-width: 1px;
251+
border-color: var(--secondary-blue);
252+
}
253+
254+
.faction-card-title {
255+
color: var(--primary-cyan);
256+
font-size: 16px;
257+
-unity-font-style: bold;
258+
margin-bottom: 4px;
259+
text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
260+
-unity-text-align: middle-center;
261+
}
262+
263+
.faction-card-desc {
264+
color: #cccccc;
265+
font-size: 11px;
266+
white-space: normal;
267+
-unity-text-align: middle-center;
268+
padding-left: 2px;
269+
padding-right: 2px;
270+
height: 30px;
271+
overflow: hidden;
272+
}
273+
274+
.faction-nav-btn {
275+
width: 35px;
276+
height: 150px;
277+
font-size: 20px;
278+
background-color: rgba(0, 0, 0, 0.4);
279+
border-width: 1px;
280+
border-color: var(--primary-cyan);
281+
border-radius: 6px;
282+
color: var(--primary-cyan);
283+
transition-duration: 0.1s;
284+
}
285+
286+
.faction-nav-btn:hover {
287+
background-color: var(--primary-cyan);
288+
color: black;
289+
}
290+
291+
.faction-nav-btn:active {
292+
background-color: var(--secondary-blue);
293+
color: white;
208294
}

Red Strike/Assets/UISystem/Templates/SettingsPanel.uxml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<ui:UXML xmlns:ui="UnityEngine.UIElements">
2-
<ui:VisualElement name="settings-overlay" class="overlay-container" style="display: none;">
2+
<ui:VisualElement name="settings-overlay" class="overlay-container" style="display: flex;">
33

44
<ui:VisualElement class="settings-box">
55

66
<!-- HEADER & TABS -->
77
<ui:VisualElement class="settings-header-area">
88
<ui:Label text="SETTINGS" style="font-size: 24px; color: cyan;" />
9-
109
<ui:VisualElement class="tabs-container">
1110
<ui:Button text="GAMEPLAY" name="tab-game" class="tab-button tab-active" />
1211
<ui:Button text="USER PROFILE" name="tab-user" class="tab-button" />
@@ -16,47 +15,72 @@
1615
<!-- CONTENT AREA -->
1716
<ui:VisualElement class="settings-content-area">
1817

19-
<!-- TAB 1: OYUN AYARLARI -->
20-
<ui:VisualElement name="content-gameplay" style="display: flex;">
18+
<!-- TAB 1: GAMEPLAY (Dokunulmadı) -->
19+
<ui:VisualElement name="content-gameplay" style="display: none;">
2120
<ui:Label text="AUDIO &amp; VIDEO" style="color: #888; margin-bottom: 20px;" />
22-
2321
<ui:VisualElement class="row">
2422
<ui:Label text="MASTER VOLUME" class="setting-label" />
2523
<ui:Slider name="slider-master-volume" high-value="1" low-value="0" value="0.75" style="width: 300px;" />
2624
</ui:VisualElement>
27-
2825
<ui:VisualElement class="row">
2926
<ui:Label text="MUSIC VOLUME" class="setting-label" />
3027
<ui:Slider name="slider-music-volume" high-value="1" low-value="0" value="0.60" style="width: 300px;" />
3128
</ui:VisualElement>
32-
3329
<ui:VisualElement class="row">
3430
<ui:Label text="FULLSCREEN" class="setting-label" />
3531
<ui:Toggle name="toggle-fullscreen" />
3632
</ui:VisualElement>
3733
</ui:VisualElement>
3834

39-
<!-- TAB 2: -->
40-
<ui:VisualElement name="content-user" style="display: none;">
35+
<!-- TAB 2: USER PROFILE (DÜZELTİLDİ) -->
36+
<ui:VisualElement name="content-user" style="display: flex;">
4137
<ui:Label text="ACCOUNT SETTINGS" style="color: #888; margin-bottom: 20px;" />
4238

39+
<!-- Satır 1: Username -->
4340
<ui:VisualElement class="row">
4441
<ui:Label text="USERNAME" class="setting-label" />
4542
<ui:TextField name="input-username" value="" class="sci-fi-input" />
4643
</ui:VisualElement>
4744

45+
<!-- Satır 2: Avatar -->
4846
<ui:VisualElement class="row">
4947
<ui:Label text="AVATAR" class="setting-label" />
5048
<ui:VisualElement class="avatar-selector" style="flex-direction: row; align-items: center;">
51-
<ui:Button name="btn-avatar-prev" class="arrow-btn" text="" style="font-size: 24px; width: 40px; height: 40px;" />
52-
<ui:VisualElement name="current-avatar-container" style="margin-left: 10px; margin-right: 10px;">
49+
<ui:Button name="btn-avatar-prev" class="arrow-btn" text="&lt;" style="font-size: 24px; width: 40px; height: 40px;" />
50+
<ui:VisualElement name="current-avatar-container" style="margin-left: 10px; margin-right: 10px; flex-direction: column; align-items: center;">
5351
<ui:Image name="current-avatar-image" style="width: 64px; height: 64px; border-width: 2px; border-color: cyan;" />
5452
</ui:VisualElement>
55-
<ui:Button name="btn-avatar-next" class="arrow-btn" text="▶" style="font-size: 24px; width: 40px; height: 40px;" />
53+
<ui:Button name="btn-avatar-next" class="arrow-btn" text="&gt;" style="font-size: 24px; width: 40px; height: 40px;" />
54+
</ui:VisualElement>
55+
</ui:VisualElement>
56+
57+
<!-- Satır 3: FACTION SELECTOR (YENİ VE DÜZGÜN YAPI) -->
58+
<!-- Artık .row yerine .faction-row kullanıyoruz -->
59+
<ui:VisualElement class="faction-row">
60+
61+
<!-- Sol Taraf: Etiket -->
62+
<ui:Label text="SELECT FACTION" class="setting-label" style="width: 150px; white-space: normal;" />
63+
64+
<!-- Sağ Taraf: Seçim Mekanizması -->
65+
<ui:VisualElement class="faction-selector-container">
66+
67+
<!-- Sol Büyük Ok -->
68+
<ui:Button name="btn-faction-prev" text="&lt;" class="faction-nav-btn" />
69+
70+
<!-- Orta Kart -->
71+
<ui:VisualElement name="current-faction-container" class="faction-card">
72+
<ui:Image name="faction-icon" class="faction-card-icon" />
73+
<ui:Label name="faction-name-label" text="THE IRON LEGION" class="faction-card-title" />
74+
<ui:Label name="faction-desc-label" text="Heavy armor and defensive tactics dominate the battlefield." class="faction-card-desc" />
75+
</ui:VisualElement>
76+
77+
<!-- Sağ Büyük Ok -->
78+
<ui:Button name="btn-faction-next" text="&gt;" class="faction-nav-btn" />
79+
5680
</ui:VisualElement>
5781
</ui:VisualElement>
5882

59-
<ui:Button name="btn-update-username" text="UPDATE PROFILE" class="action-btn" style="width: 200px; margin-top: 20px;" />
83+
<ui:Button name="btn-update-username" text="UPDATE PROFILE" class="action-btn" style="width: 200px; margin-top: 10px;" />
6084
</ui:VisualElement>
6185

6286
</ui:VisualElement>

Red Strike/Assets/UserSystem/User.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.Generic;
12
using UnityEngine;
23

34
namespace UserSystem
@@ -10,5 +11,20 @@ public class User : ScriptableObject
1011
public Sprite avatar;
1112

1213
public Sprite[] availableAvatars;
14+
15+
public List<FactionSelection> factionSelections;
16+
}
17+
[System.Serializable]
18+
public class FactionSelection
19+
{
20+
public string factionName;
21+
public string factionDescription;
22+
public Color factionColor;
23+
public Sprite factionLogo;
24+
25+
public (string factionName, string factionDescription, Color factionColor, Sprite factionLogo) GetFactionInfo()
26+
{
27+
return (factionName, factionDescription, factionColor, factionLogo);
28+
}
1329
}
1430
}

0 commit comments

Comments
 (0)