private void ReadLegacyData(PluginData data) { foreach (TexType texType in Enum.GetValues(typeof(TexType))) { if (texType == TexType.Unknown) { continue; } if (data != null && data.data.TryGetValue(texType.ToString(), out var texData) && texData is byte[] bytes && bytes.Length > 0) { if (texType == TexType.EyeOver) { OverlayStorage.SetTexture(TexType.EyeOverL, bytes); OverlayStorage.SetTexture(TexType.EyeOverR, bytes); } else if (texType == TexType.EyeUnder) { OverlayStorage.SetTexture(TexType.EyeUnderL, bytes); OverlayStorage.SetTexture(TexType.EyeUnderR, bytes); } else { OverlayStorage.SetTexture(texType, bytes); } } } #if KK OverlayStorage.CopyToOtherCoords(); #endif }
public Texture2D SetOverlayTex(byte[] overlayTex, TexType overlayType) { if (overlayType == TexType.EyeOver || overlayType == TexType.EyeUnder) { SetOverlayTex(overlayTex, overlayType + 2); return(SetOverlayTex(overlayTex, overlayType + 4)); } OverlayStorage.SetTexture(overlayType, overlayTex); UpdateTexture(overlayType); return(OverlayStorage.GetTexture(overlayType)); }
private void ReadLegacyData(PluginData data) { if (TryImportCOBOC()) { return; } KoiSkinOverlayMgr.Logger.LogInfo("Reading legacy overlay data"); foreach (TexType texType in Enum.GetValues(typeof(TexType))) { if (texType == TexType.Unknown) { continue; } if (data != null && data.data.TryGetValue(texType.ToString(), out var texData) && texData is byte[] bytes && bytes.Length > 0) { if (texType == TexType.EyeOver) { OverlayStorage.SetTexture(TexType.EyeOverL, bytes); OverlayStorage.SetTexture(TexType.EyeOverR, bytes); } else if (texType == TexType.EyeUnder) { OverlayStorage.SetTexture(TexType.EyeUnderL, bytes); OverlayStorage.SetTexture(TexType.EyeUnderR, bytes); } else { OverlayStorage.SetTexture(texType, bytes); } } } #if KK || KKS OverlayStorage.CopyToOtherCoords(); #endif }