This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
xuma202's profile picture

[CC 1.33 | MC 1.2.5] CCPDA [1.0.1] - make a GUI for everithing

Started by xuma202, 05 April 2012 - 09:11 PM
xuma202 #1
Posted 05 April 2012 - 11:11 PM
Description

​An add-on that allows you to create GUIs.

Download

v 1.0.1 [CC 1.33 | MC 1.2.5] (mediafire)
v 1.0.1 [CC 1.33 | MC 1.2.4] (mediafire)

v 1.0.0 [CC 1.31 | MC 1.2.3] (mediafire)
v 1.0.0 [CC 1.32 | MC 1.2.4] (mediafire)
v 1.0.0 [CC 1.33 | MC 1.2.5] (mediafire)

Requirements
  • ComputerCraft
  • ModLoader (also needed by CC)
Installation

Unzip the file to the mods folder.

Screenshots



more here: imgur

Crafting


PDA Controller


PDA

How to use

The PDA Controller can be attached to any side of a Computer except for the bottom

The peripheral has plenty of functions and events.

Get a full list of them here

Colors

Some functions need a color parameter here you have to pass in an integer.

The easiest way to calculate this number from a hexadecimal A-R-G-B value (two hexadecimal digits for the Alpha-, Red-, Green-, Blue-value) (Alpha of FF => fully visible)
is to use this website.
You will have to input your 8digit Hex-number to the HEX input filed a the top. Now press the enter key.
You now pick the value in the field (decimal-column and 3rd row from bottom).
Now you simply multiply this value by -1. This is what you have to pass into the function.

Examples
  • A GUI accessible by using (right-click) the PDA, that allows to set Redstone Outputs of the computer. (pastebin)
Planed features

view

Changelog

v 1.0.1:
  • Fixed a serious bug that was causing the Iron Shovel to be replaced by the PDA
v 1.0.0:
  • first official release
If you like it, a comment is highly appreciated. :)/>/>
FuzzyPurp #2
Posted 05 April 2012 - 11:18 PM
found a bug: You didnt state what version of Minecraft this supports.
xuma202 #3
Posted 05 April 2012 - 11:21 PM
Thanks I've added it.
coolblockj #4
Posted 06 April 2012 - 02:37 AM
You should add some sort of channel switch, because so far it can only use one thing.
FuzzyPurp #5
Posted 06 April 2012 - 04:21 AM
As well as it needs more functions.
xuma202 #6
Posted 06 April 2012 - 11:18 AM
You should add some sort of channel switch, because so far it can only use one thing.
Great idea. Still thinking how to realize this. I could add a selection when you use the PDA. But opening the GUI by the Computer could get difficult maybe there will something like a popup message that could be sent by a computer like "NEW update chicken-farm" or so and when you then use the PDA you can switch between all Channels.
xuma202 #7
Posted 06 April 2012 - 11:21 AM
As well as it needs more functions.

In the next update I'll definitely add the ability to add, delete and modify Buttons without having the GUI open. I think I have to take a closer look at the GUI API maybe.
kamnxt #8
Posted 08 April 2012 - 11:57 AM
I get an error:
SpoilerMods loaded: 3
ModLoader 1.2.4
mod_ModLoaderMp 1.2.4v1
mod_MinecraftForge 2.0.0.67

Minecraft: Minecraft 1.2.4
OS: Linux (amd64) version 2.6.32-5-amd64
Java: 1.7.0_02, Oracle Corporation
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.8.3
OpenGL: GeForce GTS 450/PCI/SSE2 version 4.2.0 NVIDIA 290.10, NVIDIA Corporation

java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
at java.lang.Class.getDeclaredFields(Class.java:1760)
at ModLoader.setupProperties(ModLoader.java:1747)
at ModLoader.addMod(ModLoader.java:293)
at ModLoader.readFromModFolder(ModLoader.java:1292)
at ModLoader.init(ModLoader.java:887)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:79)
at ahu.<clinit>(ahu.java:9)
at net.minecraft.client.Minecraft.a(Minecraft.java:395)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Thread.java:722)

EDIT: Oops, i have minecraft 1.2.4… Can you make a 1.2.4 version?
EDIT 2: And i'm using CC 1.32… I must read the title first :P/>/>
xuma202 #9
Posted 08 April 2012 - 06:20 PM
EDIT: Oops, i have minecraft 1.2.4… Can you make a 1.2.4 version?

I've just updated the add-on for MC 1.2.4
kamnxt #10
Posted 09 April 2012 - 06:05 PM
Thanks for updating! :P/>/>



Don't try this code:

side = "top"
pda = peripheral.wrap(side)
pda.registerAsEventListener()
pda.createGui()
while true do
os.pullEvent()
pda.displayGui()
end
It makes it impossible to close the PDA GUI…
xuma202 #11
Posted 09 April 2012 - 06:46 PM
You can do this even more easy:


side = "top"
pda = peripheral.wrap(side)
pda.setOption("closeOnEscape", false)
pda.createGui()
pda.displayGui

WARNING: DO NOT TRY!

You would have to quit the game in order to close the GUI
djblocksaway #12
Posted 10 April 2012 - 03:10 PM
woah nice but as mentiond needs more functions :P/>/>
xuma202 #13
Posted 11 April 2012 - 11:38 AM
Yes, I know that it would be great if you can easily put checkboxes, edit fields and process bars on the GUI.
And I'll definitely add this but for now it's already possible:

For a text field you could draw a black rectangle with a gray border made out of lines. You save a lua variable whether the field is selected. When the mouse get's pressed you compare the coordinates and if the click was performed inside the field you select it otherwise you deselect it. When a key get's pressed you add the char to a variable and add the text to the GUI right above the rectangle. You would just have to limit the length of the value .

So as you can see you could do it. But of course it's not easy and it's slow. That's why I'll definitely add this.

I only what to give a way of how you can do it until the mod get's updated.
Wolvan #14
Posted 12 April 2012 - 10:46 PM
What I would love to see is SMP Support and another thing: You can mark the port to 1.2.4 as done on your to do list
xuma202 #15
Posted 13 April 2012 - 10:17 AM
Well there will not be SMP support or at least not in the near future because I have no experience in SMP mods yet.
If someone is interested in making this mod a SPM mod send me a PM and I'll serve you the source code.

PS: updated the to do list.
WiolfCat7 #16
Posted 29 April 2012 - 12:17 AM
FAIL I CANT EVEN CREATE A GUI NO MATTER WHAT I TYPE IT SAYS ATTEMPT TO CALL NIL AND YES I PUT THE THING NEXT TO THE COMPUTER
xuma202 #17
Posted 30 April 2012 - 05:03 PM
Well have you wraped the Peripheral?
Also you can only place it next to a side or the top!
You then have to create the GUI and after that you can add stuff to it and then you can display it but make sure you have a PDA in hotbar!
xuma202 #18
Posted 04 June 2012 - 06:47 PM
Sorry guys I totally missed the update. But as I found out the 1.2.4 version works just fine on 1.2.5
Yurameki #19
Posted 30 June 2012 - 06:38 AM
great in concept, more flexibility and SMP support are a must!
Soundlogic #20
Posted 20 July 2012 - 05:19 AM
I am trying to use this, and it seems to work fine, except that the PDA keeps going to id 256 and stealing my iron shovel. I am using id resolver, but both id resolver and your config file are set to things besides 256. I'm not quite sure what to do.
Thank you,
Sound Logic
xuma202 #21
Posted 20 July 2012 - 08:24 AM
Ok I was able to reproduce this error. After looking in the code I still have no idea why this is happening. I've changed something in the code but nothing that would correct the problem but it did.

I'll now uploaded the fixed version.
Soundlogic #22
Posted 20 July 2012 - 05:46 PM
Huh. Well, it is fixed. Cool? I guess? Also, is it possible to make it detect how long someone holds down the right mouse button with the pda selected?
xuma202 #23
Posted 22 July 2012 - 12:50 PM
No that is not possible. I only get a notification when the click is performed not when when it's released. Sorry.
FuzzyPurp #24
Posted 18 August 2012 - 04:13 AM
Temp Sphax patch available, pm me if anyone wants it.
SebaTeck #25
Posted 11 October 2012 - 07:50 PM
can you make a GUI with bundled colors output? O: i have one but is for CC and have an interface e.e