Do not let ebassi see this code

This commit is contained in:
2026-04-28 12:58:00 +01:00
parent fc0ed5ac2c
commit a97c42323c
7 changed files with 323 additions and 426 deletions
+59 -283
View File
@@ -134,287 +134,63 @@ var mucPersistentBytes []byte
//go:embed assets/muc_temporary.png
var mucTemporaryBytes []byte
func init() {
loader := gdkpixbuf.NewPixbufLoader()
loader.Write(defaultAvatarBytes)
loader.Close()
clientAssets["DefaultAvatar"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(failedBytes)
loader.Close()
clientAssets["FailedAvatar"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(ownerMedalBytes)
loader.Close()
clientAssets["owner"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(cancelBytes)
loader.Close()
clientAssets["cancel"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(tagBytes)
loader.Close()
clientAssets["tag"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(adminMedalBytes)
loader.Close()
clientAssets["admin"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(memberMedalBytes)
loader.Close()
clientAssets["member"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(noneMedalBytes)
loader.Close()
clientAssets["none"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(outcastMedalBytes)
loader.Close()
clientAssets["outcast"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(logoDisabledBytes)
loader.Close()
clientAssets["disabled_logo"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(groupBytes)
loader.Close()
clientAssets["group"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(doorInBytes)
loader.Close()
clientAssets["door_in"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(doorOutBytes)
loader.Close()
clientAssets["door_out"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(largeGroupBytes)
loader.Close()
clientAssets["large_group"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(worldBytes)
loader.Close()
clientAssets["world"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(disconnectBytes)
loader.Close()
clientAssets["disconnect"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(barBytes)
loader.Close()
clientAssets["chart_bar"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(barLaggyBytes)
loader.Close()
clientAssets["chart_bar_laggy"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(okBytes)
loader.Close()
clientAssets["ok"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(hourglassBytes)
loader.Close()
clientAssets["hourglass"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(connectBytes)
loader.Close()
clientAssets["connect"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(commentBytes)
loader.Close()
clientAssets["comment"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(informationBytes)
loader.Close()
clientAssets["information"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(sABytes)
loader.Close()
clientAssets["status_away"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(sBBytes)
loader.Close()
clientAssets["status_dnd"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(sCBytes)
loader.Close()
clientAssets["status_chat"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(xaBytes)
loader.Close()
clientAssets["status_xa"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(sOBytes)
loader.Close()
clientAssets["status_"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(carBytes)
loader.Close()
clientAssets["car"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(carHighBytes)
loader.Close()
clientAssets["car_high"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucOpenBytes)
loader.Close()
clientAssets["muc_open"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucMembersOnlyBytes)
loader.Close()
clientAssets["muc_membersonly"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucPasswordProtectedBytes)
loader.Close()
clientAssets["muc_passwordprotected"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucUnsecuredBytes)
loader.Close()
clientAssets["muc_unsecured"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucHiddenBytes)
loader.Close()
clientAssets["muc_hidden"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucPublicBytes)
loader.Close()
clientAssets["muc_public"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucUnmoderatedBytes)
loader.Close()
clientAssets["muc_unmoderated"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucModeratedBytes)
loader.Close()
clientAssets["muc_moderated"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucNonAnonymousBytes)
loader.Close()
clientAssets["muc_nonanonymous"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucSemiAnonymousBytes)
loader.Close()
clientAssets["muc_semianonymous"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucPersistentBytes)
loader.Close()
clientAssets["muc_persistent"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
loader = gdkpixbuf.NewPixbufLoader()
loader.Write(mucTemporaryBytes)
loader.Close()
clientAssets["muc_temporary"] = gdk.NewTextureForPixbuf(loader.Pixbuf())
//go:embed assets/moderate.png
var moderateBytes []byte
func loadAsset(key string, data []byte) {
loader := gdkpixbuf.NewPixbufLoader()
loader.Write(data)
loader.Close()
clientAssets[key] = gdk.NewTextureForPixbuf(loader.Pixbuf())
}
func init() {
for key, data := range map[string][]byte{
"DefaultAvatar": defaultAvatarBytes,
"FailedAvatar": failedBytes,
"owner": ownerMedalBytes,
"admin": adminMedalBytes,
"member": memberMedalBytes,
"none": noneMedalBytes,
"outcast": outcastMedalBytes,
"cancel": cancelBytes,
"tag": tagBytes,
"disabled_logo": logoDisabledBytes,
"group": groupBytes,
"door_in": doorInBytes,
"door_out": doorOutBytes,
"large_group": largeGroupBytes,
"world": worldBytes,
"disconnect": disconnectBytes,
"chart_bar": barBytes,
"chart_bar_laggy": barLaggyBytes,
"ok": okBytes,
"hourglass": hourglassBytes,
"connect": connectBytes,
"comment": commentBytes,
"information": informationBytes,
"status_away": sABytes,
"status_dnd": sBBytes,
"status_chat": sCBytes,
"status_xa": xaBytes,
"status_": sOBytes,
"car": carBytes,
"car_high": carHighBytes,
"muc_open": mucOpenBytes,
"muc_membersonly": mucMembersOnlyBytes,
"muc_passwordprotected": mucPasswordProtectedBytes,
"muc_unsecured": mucUnsecuredBytes,
"muc_hidden": mucHiddenBytes,
"muc_public": mucPublicBytes,
"muc_unmoderated": mucUnmoderatedBytes,
"muc_moderated": mucModeratedBytes,
"muc_nonanonymous": mucNonAnonymousBytes,
"muc_semianonymous": mucSemiAnonymousBytes,
"muc_persistent": mucPersistentBytes,
"muc_temporary": mucTemporaryBytes,
"moderate": moderateBytes,
} {
loadAsset(key, data)
}
}