Skip to content

Commit

Permalink
Trying out for a GUI
Browse files Browse the repository at this point in the history
Not very succesfull
  • Loading branch information
Oskar Edholm committed Mar 19, 2017
1 parent cbe468b commit b46a678
Show file tree
Hide file tree
Showing 12 changed files with 543 additions and 5 deletions.
217 changes: 217 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
build.properties
.gradle
libs

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
5 changes: 5 additions & 0 deletions common/net/oskyedz/stickyNote/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.oskyedz.stickyNote.GUI.GuiHandler;
import net.oskyedz.stickyNote.init.ModBlocks;
import net.oskyedz.stickyNote.init.ModItems;

Expand Down Expand Up @@ -36,6 +38,9 @@ public void init(FMLInitializationEvent event) {
ModBlocks.initClient(mesher); // Register block models

ModItems.initClient(mesher); // Register item models

NetworkRegistry.INSTANCE.registerGuiHandler(stickyNote.instance,
new GuiHandler());
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions common/net/oskyedz/stickyNote/CommonProxy.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package net.oskyedz.stickyNote;

import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.oskyedz.stickyNote.init.ModBlocks;
import net.oskyedz.stickyNote.init.ModItems;

Expand All @@ -22,7 +19,7 @@ public void preInit(FMLPreInitializationEvent event) {
* init-phase.
*/

ModBlocks.init(); // Blocks and tile entities.
ModBlocks.init(); // Blocks

ModItems.init(); // Items

Expand Down
29 changes: 29 additions & 0 deletions common/net/oskyedz/stickyNote/GUI/GuiBlockStickyNote.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package net.oskyedz.stickyNote.GUI;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.oskyedz.stickyNote.stickyNote;

public class GuiBlockStickyNote extends GuiContainer {

public GuiBlockStickyNote(Container inventorySlotsIn) {
super(inventorySlotsIn);
// TODO Auto-generated constructor stub
}

@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks,
int mouseX, int mouseY) {

GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(
new ResourceLocation(stickyNote.MOD_ID,
"textures/gui/container/block_stickynoteblock.png"));
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize,
this.ySize);

}

}
25 changes: 25 additions & 0 deletions common/net/oskyedz/stickyNote/GUI/GuiHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package net.oskyedz.stickyNote.GUI;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler {

public static final int STICKY_BLOCK = 0;

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
// TODO Auto-generated method stub
return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
// TODO Auto-generated method stub
return null;
}

}
Loading

0 comments on commit b46a678

Please sign in to comment.