From 692b543db135be251bd7177d32a9bce74cd44f78 Mon Sep 17 00:00:00 2001
From: Weicao-CatilGrass <1992414357@qq.com>
Date: Sat, 12 Apr 2025 19:07:18 +0800
Subject: 使用 Folder-Ico 美化了文件夹
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.cargo/config | 2 +-
.cargo/desktop.ini | 6 +++++
.gitignore | 4 ++--
.idea/PhantomLink-Gamepad.iml | 1 +
.init/desktop.ini | 6 +++++
.init/init_project.bat | 50 ++++++++++++++++++++++++++++++++++++-----
.obsidian/desktop.ini | 6 +++++
client/art/aseprite/desktop.ini | 6 +----
client/desktop.ini | 6 +++++
core/desktop.ini | 6 +----
core/server_test/src/main.rs | 3 +--
core/src/player.rs | 2 +-
desktop.ini | 6 +----
doc/desktop.ini | 6 +----
14 files changed, 79 insertions(+), 31 deletions(-)
create mode 100644 .cargo/desktop.ini
create mode 100644 .init/desktop.ini
create mode 100644 .obsidian/desktop.ini
create mode 100644 client/desktop.ini
diff --git a/.cargo/config b/.cargo/config
index b18a5b7..4cfe1c1 100644
--- a/.cargo/config
+++ b/.cargo/config
@@ -1,2 +1,2 @@
[build]
-target-dir = "./shared/target"
\ No newline at end of file
+target-dir = "./.cargo/shared/target"
\ No newline at end of file
diff --git a/.cargo/desktop.ini b/.cargo/desktop.ini
new file mode 100644
index 0000000..a0d951a
--- /dev/null
+++ b/.cargo/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+IconResource=.\..\.init\Folder-Ico\ico\rust-2.ico,0
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
diff --git a/.gitignore b/.gitignore
index aece2db..0b87936 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,8 +3,8 @@
/.init/Folder-Ico/*.*
# Rust Target
-/shared/
-/shared/*.*
+/.cargo/shared/
+/.cargo/shared/*.*
# Documents
/doc/client-documents/
diff --git a/.idea/PhantomLink-Gamepad.iml b/.idea/PhantomLink-Gamepad.iml
index 03e6177..061a65d 100644
--- a/.idea/PhantomLink-Gamepad.iml
+++ b/.idea/PhantomLink-Gamepad.iml
@@ -12,6 +12,7 @@
+
diff --git a/.init/desktop.ini b/.init/desktop.ini
new file mode 100644
index 0000000..ab0aa15
--- /dev/null
+++ b/.init/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+IconResource=.\..\.init\Folder-Ico\ico\programmer-4.ico,0
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
diff --git a/.init/init_project.bat b/.init/init_project.bat
index 5914d4f..cbd0f09 100644
--- a/.init/init_project.bat
+++ b/.init/init_project.bat
@@ -1,13 +1,53 @@
@echo off
-cd %~d0
+setlocal enabledelayedexpansion
+set "SCRIPT_DIR=%~dp0"
-cd ..\client
+:: 初始化目录
+cd /d "%SCRIPT_DIR%" || exit /b 1
+
+:: 客户端构建
+echo Building Module : Client
+pushd ..\client
cargo build
+popd
-cd ..\core
+:: 核心构建
+echo Building Module : Core
+pushd ..\core
cargo build
+popd
+
+:: 图标下载
+echo Downloading icon11 ... ( from github.com/icon11-community/Folder-Ico.git )
+pushd ..\.init
+git clone https://github.com/icon11-community/Folder-Ico.git || (
+ echo [ Failed ]
+ pause
+ exit /b 2
+)
+popd
+
+:: 批量设置系统属性
+for %%D in (
+ ".\..\PhantomLink-Gamepad"
+ ".\.cargo"
+ ".\.idea"
+ ".\.init"
+ ".\.obsidian"
+ ".\client"
+ ".\client\art\aseprite"
+ ".\core"
+ ".\doc"
+) do (
+ if exist "%%~D\desktop.ini" (
+ attrib +s +h "%%~D\desktop.ini"
+ )
+ attrib +s "%%~D"
+)
-cd ..\.init
-git clone https://github.com/icon11-community/Folder-Ico.git
+del /f /q "%LocalAppData%\IconCache.db" >nul
+:: 完成提示
+echo DONE :)
pause
+exit /b 0
diff --git a/.obsidian/desktop.ini b/.obsidian/desktop.ini
new file mode 100644
index 0000000..ff05e69
--- /dev/null
+++ b/.obsidian/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+IconResource=..\.init\Folder-Ico\ico\obsidian-2.ico,0
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
diff --git a/client/art/aseprite/desktop.ini b/client/art/aseprite/desktop.ini
index 3e94eb9..8927f1c 100644
--- a/client/art/aseprite/desktop.ini
+++ b/client/art/aseprite/desktop.ini
@@ -1,6 +1,2 @@
[.ShellClassInfo]
-IconResource=..\..\..\.init\Folder-Ico\ico\aseprite.ico,0
-[ViewState]
-Mode=
-Vid=
-FolderType=Generic
+IconResource=..\..\..\.init\Folder-Ico\ico\aseprite.ico,0
\ No newline at end of file
diff --git a/client/desktop.ini b/client/desktop.ini
new file mode 100644
index 0000000..67e27c9
--- /dev/null
+++ b/client/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+IconResource=..\.init\Folder-Ico\ico\microsoft_user.ico,0
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
diff --git a/core/desktop.ini b/core/desktop.ini
index edde22e..625ab66 100644
--- a/core/desktop.ini
+++ b/core/desktop.ini
@@ -1,6 +1,2 @@
[.ShellClassInfo]
-IconResource=..\.init\Folder-Ico\ico\rust-2.ico,0
-[ViewState]
-Mode=
-Vid=
-FolderType=Generic
+IconResource=..\.init\Folder-Ico\ico\windows_powershell_core.ico,0
\ No newline at end of file
diff --git a/core/server_test/src/main.rs b/core/server_test/src/main.rs
index c134fbc..deff058 100644
--- a/core/server_test/src/main.rs
+++ b/core/server_test/src/main.rs
@@ -1,6 +1,5 @@
-use phantomlink_gamepad_core::message::PlayerMessage;
use phantomlink_gamepad_core::server::{PLServer, PLServerEvent};
-use phantomlink_gamepad_core::player::PlayerInfo;
+use phantomlink_gamepad_core::player::{PlayerInfo, PlayerMessage};
fn main() {
let pl_server = PLServer::default();
diff --git a/core/src/player.rs b/core/src/player.rs
index 78e4d23..92430b8 100644
--- a/core/src/player.rs
+++ b/core/src/player.rs
@@ -35,7 +35,7 @@ impl PlayerInfo {
hasher.update(combined);
let result = hasher.finalize();
- self.name_hash = &format!("{:x}", &result[..16]);
+ self.name_hash = &format!("{:x}", &result[..]);
self
}
diff --git a/desktop.ini b/desktop.ini
index 5eacc4d..603775b 100644
--- a/desktop.ini
+++ b/desktop.ini
@@ -1,6 +1,2 @@
[.ShellClassInfo]
-IconResource=.init\Folder-Ico\ico\microsoft_games.ico,0
-[ViewState]
-Mode=
-Vid=
-FolderType=Generic
+IconResource=.init\Folder-Ico\ico\microsoft_games.ico,0
\ No newline at end of file
diff --git a/doc/desktop.ini b/doc/desktop.ini
index ff05e69..942b5fc 100644
--- a/doc/desktop.ini
+++ b/doc/desktop.ini
@@ -1,6 +1,2 @@
[.ShellClassInfo]
-IconResource=..\.init\Folder-Ico\ico\obsidian-2.ico,0
-[ViewState]
-Mode=
-Vid=
-FolderType=Generic
+IconResource=..\.init\Folder-Ico\ico\markdown-1.ico,0
\ No newline at end of file
--
cgit