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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...