Skip to content

Commit

Permalink
Add Integrated Dynamics infobook sections
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jan 20, 2018
1 parent 8c96d03 commit aa967ae
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/org/cyclops/integratedrest/IntegratedRest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import org.cyclops.cyclopscore.config.ConfigHandler;
import org.cyclops.cyclopscore.config.extendedconfig.BlockItemConfigReference;
import org.cyclops.cyclopscore.helper.MinecraftHelpers;
import org.cyclops.cyclopscore.infobook.IInfoBookRegistry;
import org.cyclops.cyclopscore.init.ItemCreativeTab;
import org.cyclops.cyclopscore.init.ModBaseVersionable;
import org.cyclops.cyclopscore.init.RecipeHandler;
import org.cyclops.cyclopscore.proxy.ICommonProxy;
import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.api.item.IVariableFacadeHandlerRegistry;
import org.cyclops.integrateddynamics.infobook.OnTheDynamicsOfIntegrationBook;
import org.cyclops.integratedrest.api.http.request.IRequestHandlerRegistry;
import org.cyclops.integratedrest.api.json.IValueTypeJsonHandlerRegistry;
import org.cyclops.integratedrest.block.BlockHttpConfig;
Expand Down Expand Up @@ -114,6 +116,12 @@ public void init(FMLInitializationEvent event) {
@Override
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);

// Initialize info book
IntegratedDynamics._instance.getRegistryManager().getRegistry(IInfoBookRegistry.class)
.registerSection(
OnTheDynamicsOfIntegrationBook.getInstance(), "info_book.integrateddynamics.manual",
"/assets/" + Reference.MOD_ID + "/info/rest_info.xml");
}

/**
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/assets/integratedrest/info/rest_info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<section name="info_book.integratedrest.section.main">
<section name="info_book.integratedrest.introduction">
<paragraph>info_book.integratedrest.introduction.text1</paragraph>
<paragraph>info_book.integratedrest.introduction.text2</paragraph>
<paragraph>info_book.integratedrest.introduction.text3</paragraph>
</section>

<section name="info_book.integratedrest.http">
<tag>integratedrest:http</tag>
<paragraph>info_book.integratedrest.http.text1</paragraph>
<paragraph>info_book.integratedrest.http.text2</paragraph>
<paragraph>info_book.integratedrest.http.text3</paragraph>
<appendix type="crafting_recipe">integratedrest:http</appendix>
</section>
</section>
16 changes: 15 additions & 1 deletion src/main/resources/assets/integratedrest/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@ tile.blocks.integratedrest.http.info=Read values that have been provided by exte
http.integratedrest.tooltip.delay_id=§e§oHTTP Proxy ID: §r§o%s
http.integratedrest.error.http_not_in_network=HTTP Proxy with id %s could not be found within the current network.
http.integratedrest.error.http_invalid=HTTP Proxy with id %s is not exposing a valid variable.
http.integratedrest.error.http_invalid_type=HTTP Proxy with id %s is expected to expose a variable with type %s while %s is found.
http.integratedrest.error.http_invalid_type=HTTP Proxy with id %s is expected to expose a variable with type %s while %s is found.

# ------ On the Dynamics of Integration contents ------

info_book.integratedrest.section.main=REST

info_book.integratedrest.introduction=Introduction
info_book.integratedrest.introduction.text1=&lIntegrated REST&r is a mod allows you to read from and write to your &lIntegrated Dynamics&r networks via a REST API.
info_book.integratedrest.introduction.text2=This makes it possible to read the status of your networks and worlds via Web-protocols, and interact with them by POST-ing values to HTTP Proxy blocks in your world.
info_book.integratedrest.introduction.text3=Check the server console to see where your server is running and see what kind of information you can find. (Default is &lhttp://localhost:3000/&r)

info_book.integratedrest.http=HTTP Proxy
info_book.integratedrest.http.text1=The HTTP Proxy has an internal value state that can be updated via HTTP POST requests.
info_book.integratedrest.http.text2=A certain value type must be selected in the HTTP Proxy, and only requests of that type will be accepted.
info_book.integratedrest.http.text3=More information can be found on the GitHub wiki

0 comments on commit aa967ae

Please sign in to comment.