This commit is contained in:
Oscar
2025-06-29 15:06:54 +03:00
parent 495c672818
commit 235d5ad90a
7 changed files with 423 additions and 111 deletions

View File

@@ -25,29 +25,32 @@
}
</div>
@* <!-- Панель управления сохранением инвентаря --> *@
@* <div class="save-status"> *@
@* <div class="save-indicator @( HasSaveFile ? "has-save" : "no-save" )"> *@
@* <div class="save-text">@( HasSaveFile ? "Сохранение есть" : "Нет сохранения" )</div> *@
@* <div class="save-panel"> *@
@* <div class="save-title">Сохранение инвентаря</div> *@
@* <div class="save-buttons"> *@
@* <button class="save-button" @onclick="SaveInventory"> *@
@* 💾 Сохранить *@
@* </button> *@
@* <button class="save-button" @onclick="LoadInventory"> *@
@* 📂 Загрузить *@
@* </button> *@
@* <button class="save-button danger" @onclick="ClearSave"> *@
@* 🗑️ Очистить *@
@* </button> *@
@* <button class="save-button danger" @onclick="DropAllItems"> *@
@* 📦 Выбросить все *@
@* </button> *@
@* </div> *@
@* <div class="save-status"> *@
@* @if ( HasSaveFile ) *@
@* { *@
@* <span class="save-status-ok">✓ Файл сохранения найден</span> *@
@* } *@
@* else *@
@* { *@
@* <span class="save-status-none">✗ Файл сохранения не найден</span> *@
@* } *@
@* </div> *@
@* *@
@* @if ( HasSaveFile ) *@
@* { *@
@* <button class="load-button" onmousedown="LoadInventory"> *@
@* <div class="button-text">Загрузить</div> *@
@* </button> *@
@* } *@
@* *@
@* <button class="save-button" onmousedown="SaveInventory"> *@
@* <div class="button-text">Сохранить</div> *@
@* </button> *@
@* *@
@* @if ( HasSaveFile ) *@
@* { *@
@* <button class="clear-button" onmousedown="ClearSave"> *@
@* <div class="button-text">Очистить</div> *@
@* </button> *@
@* } *@
@* </div> *@
</root>
@@ -125,7 +128,7 @@
display: none;
}
.save-status {
.save-panel {
position: absolute;
top: 20px;
right: 20px;
@@ -137,79 +140,61 @@
gap: 8px;
min-width: 200px;
.save-indicator {
display: flex;
align-items: center;
gap: 8px;
padding: 8px;
border-radius: 4px;
font-size: 14px;
.save-title {
font-size: 18px;
font-weight: 500;
color: white;
}
.save-buttons {
display: flex;
justify-content: space-between;
gap: 8px;
&.has-save {
background: rgba(76, 175, 80, 0.2);
color: #4CAF50;
border: 1px solid #4CAF50;
}
&.no-save {
background: rgba(244, 67, 54, 0.2);
color: #F44336;
border: 1px solid #F44336;
}
.save-text {
button {
padding: 8px 12px;
border-radius: 4px;
border: none;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
&:hover {
transform: translateY(-1px);
}
&.save-button {
background: #2196F3;
color: white;
&:hover {
background: #1976D2;
}
}
&.danger {
background: #F44336;
color: white;
&:hover {
background: #D32F2F;
}
}
}
}
button {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 4px;
border: none;
cursor: pointer;
.save-status {
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
color: white;
&:hover {
transform: translateY(-1px);
&.save-status-ok {
color: #4CAF50;
}
&.save-button {
background: #2196F3;
color: white;
&:hover {
background: #1976D2;
}
}
&.load-button {
background: #4CAF50;
color: white;
&:hover {
background: #388E3C;
}
}
&.clear-button {
background: #F44336;
color: white;
&:hover {
background: #D32F2F;
}
}
.button-text {
font-size: 14px;
font-weight: 500;
&.save-status-none {
color: #F44336;
}
}
}
@@ -284,6 +269,14 @@
CheckSaveFile();
}
private void DropAllItems()
{
if ( Dedugan.Local != null )
{
Dedugan.Local.ForceDropAllItems();
}
}
protected override int BuildHash()
{
if ( Dedugan.Local == null || !HasWeapon )

65
Code/UI/GUI.razor.scss Normal file
View File

@@ -0,0 +1,65 @@
.save-panel {
position: absolute;
top: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.8);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 8px;
padding: 16px;
min-width: 200px;
.save-title {
font-size: 18px;
font-weight: 500;
color: white;
margin-bottom: 12px;
text-align: center;
}
.save-buttons {
display: flex;
flex-direction: column;
gap: 8px;
button {
padding: 8px 12px;
border-radius: 4px;
border: none;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
background: #2196F3;
color: white;
&:hover {
background: #1976D2;
transform: translateY(-1px);
}
&.danger {
background: #F44336;
color: white;
&:hover {
background: #D32F2F;
}
}
}
}
.save-status {
margin-top: 12px;
font-size: 14px;
font-weight: 500;
text-align: center;
.save-status-ok {
color: #4CAF50;
}
.save-status-none {
color: #F44336;
}
}
}