Jump to content

Recommended Posts

Posted

Im not sure if this is the right place to post this of not but here it goes.

 

I used the open source techniclauncher, i installed solder on my webhost

i changed the solder api in the launchercore to mine so it now displays only my modpacks on my solder so now my launcher looks like this.

G5TGYaX.jpg

 

now i noticed in the platform part of launchercore this here:

public class PlatformConstants {
    public static final String PLATFORM = "http://www.technicpack.net/";

    public static final String API = PLATFORM + "api/";

    public static final String MODPACK = API + "modpack/";

    public static final String NEWS = API + "news/";

    public static String getPlatformInfoUrl(String modpack) {
        return MODPACK + modpack;
    }

    public static String getRunCountUrl(String modpack) {
        return getPlatformInfoUrl(modpack) + "/run";
    }

    public static String getDownloadCountUrl(String modpack) {
        return getPlatformInfoUrl(modpack) + "/download";
    }
}

Now, what i want to do is make my own news feed that pops up for my modpack,

    public String getUrl() {
        return PlatformConstants.PLATFORM + "article/view/" + title;
    }

And finally i see it uses this:

    private void setupArticles(List<Article> articles) {
        Font articleFont = LauncherFrame.getMinecraftFont(10);
        int width = getWidth() - 16;
        int height = getHeight() / 2 - 16;

        for (int i = 0; i < 2; i++) {
            Article article = articles.get(i);
            String date = article.getDate();
            String title = "Davey News";
            HyperlinkJTextPane link = new HyperlinkJTextPane(date + "n" + title, article.getUrl());
            link.setFont(articleFont);
            link.setForeground(Color.WHITE);
            link.setBackground(new Color(255, 255, 255, 0));
            link.setBounds(8, 8 + ((height + 8) * i), width, height);
            this.add(link);
        }

        RoundedBox background = new RoundedBox(LauncherFrame.TRANSPARENT);
        background.setBounds(0, 0, getWidth(), getHeight());
        this.add(background);
        this.repaint();
    }
}

Any idea how i can setup my own news feed on the launcher?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...