diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-23 11:10:32 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-23 11:10:32 -0800 |
| commit | e2eccde99075d2ca355a80bbbb7a3160d766b920 (patch) | |
| tree | 008c1bffa1066044da27cb714b258ffb5ebf9220 | |
| parent | 674477d8c76d9625d0c3967c8fae54a5abdb86a4 (diff) | |
Quick pass at an emoji based icon set, matching icons to classic Hotline icons where possible.
| -rw-r--r-- | Hotline/Hotline/HotlineClient.swift | 2 | ||||
| -rw-r--r-- | Hotline/Models/Hotline.swift | 69 | ||||
| -rw-r--r-- | Hotline/macOS/ServerView.swift | 14 |
3 files changed, 80 insertions, 5 deletions
diff --git a/Hotline/Hotline/HotlineClient.swift b/Hotline/Hotline/HotlineClient.swift index bbaec5b..6eb6f42 100644 --- a/Hotline/Hotline/HotlineClient.swift +++ b/Hotline/Hotline/HotlineClient.swift @@ -764,7 +764,7 @@ class HotlineClient { let userIconID = userIconIDField.getUInt16(), let userFlagsField = transaction.getField(type: .userFlags), let userFlags = userFlagsField.getUInt16() { - print("HotlineClient: User changed \(username)") + print("HotlineClient: User changed \(username) icon: \(userIconID)") let user = HotlineUser(id: userID, iconID: userIconID, status: userFlags, name: username) diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift index 0e9ca9e..229f085 100644 --- a/Hotline/Models/Hotline.swift +++ b/Hotline/Models/Hotline.swift @@ -4,6 +4,73 @@ import SwiftUI let trackerClient: HotlineTrackerClient let client: HotlineClient + static let defaultIconSet: [Int: String] = [ + 414: "๐", + 2000: "๐", + 2001: "๐", + 2002: "๐ชฉ", + 2003: "๐ฅ", + 2004: "๐", + 2014: "๐", + 2006: "๐ ", + 2007: "๐ฆ ", + 2008: "๐ช", + 2009: "๐", + 2010: "๐", + 2011: "๐", + 2012: "๐ฆ", + 145: "๐", + 2015: "๐ป", + 2016: "๐ป", + 2017: "โ๏ธ", + 2018: "โก๏ธ", + 417: "๐งโโ๏ธ", + 140: "๐จ", + 141: "๐ฝ", + 142: "๐", + 143: "๐ท๏ธ", + 138: "๐บ", + 146: "๐
", + 149: "๐ฎ", + 150: "๐ฆ", + 151: "๐งป", + 154: "๐", + 182: "โ", + 207: "โ ๏ธ", + 2061: "โ๏ธ", + 2063: "๐ฎ", + 2064: "๐", + 2065: "๐", + 2066: "๐ญ", + 2067: "๐ญ", + 2013: "๐ง", + 2037: "โ ๏ธ", + 2055: "โก๏ธ", + 2400: "๐จ๐ฆ", + 2036: "โฃ๏ธ", + 4134: "๐ฆ", + 4247: "๐", + 135: "โฏ๏ธ", + 137: "๐", + 144: "๐", + 165: "๐ถ", + 166: "โค๏ธ", + 2549: "๐ฎ๐ฑ", + 2553: "๐บ๐ธ", + 2555: "๐จ๐ฆ", + 2552: "๐ฎ๐ณ", + 2556: "๐ฆ๐บ", + 2565: "๐ฌ๐ง", + 2567: "๐ฏ๐ต", + 2566: "๐ซ๐ท", + 2564: "๐ฉ๐ช", + 2563: "๐ฎ๐น", + 2550: "๐ญ๐บ", + 2551: "๐ต๐ฑ", + 2560: "๐ช๐ธ", + 2561: "๐ธ๐ช", + ] + var status: HotlineClientStatus = .disconnected var server: Server? { @@ -23,7 +90,7 @@ import SwiftUI } var serverTitle: String = "Server" var username: String = "bolt" - var iconID: UInt = 128 + var iconID: UInt = 414 var access: HotlineUserAccessOptions? var agreed: Bool = false diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index ce9b3dc..a385109 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -161,9 +161,17 @@ struct ServerView: View { Section("Users") { ForEach(model.users) { user in HStack { - Text("๐") - .font(.headline) - .opacity(controlActiveState == .inactive ? 0.5 : 1.0) + if let iconString = Hotline.defaultIconSet[Int(user.iconID)] { + Text(iconString) + .font(.headline) + .frame(width: 18) + .opacity(controlActiveState == .inactive ? 0.5 : 1.0) + } + else { + Text("") + .frame(width: 18) + } + if user.status.contains(.admin) { if user.status.contains(.idle) { Text(user.name) |