From e265fd42b35d8c354b37b584e451a2608a9ff4dc Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:04:01 +0100 Subject: [PATCH 1/8] Remove unwanted subdirectory --- VoxelCam/.classpath => .classpath | 34 +- VoxelCam/.gitignore => .gitignore | 0 VoxelCam/.project => .project | 34 +- .../org.eclipse.core.resources.prefs | 6 +- .../org.eclipse.jdt.core.prefs | 22 +- {VoxelCam/build => build}/build.gradle | 0 {VoxelCam/build => build}/build.xml | 278 ++-- {VoxelCam/build => build}/buildnumber.txt | 6 +- .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 {VoxelCam/build => build}/gradlew | 0 {VoxelCam/build => build}/gradlew.bat | 0 .../build => build}/litemod.template.json | 16 +- {VoxelCam/debug => debug}/litemod.json | 12 +- .../lib => lib}/facebook4j-core-2.0.0.jar | Bin .../lib => lib}/jreddit-1.0.1-SNAPSHOT.jar | Bin .../twitter4j-core-3.0.6-SNAPSHOT.jar | Bin .../assets/voxelcam/lang/de_DE.lang | 0 .../assets/voxelcam/lang/en_GB.lang | 4 +- .../assets/voxelcam/lang/en_US.lang | 160 +- .../assets/voxelcam/lang/es_ES.lang | 0 .../assets/voxelcam/lang/nl_NL.lang | 138 +- .../assets/voxelcam/lang/sv_SE.lang | 136 +- .../assets/voxelcam/textures/avatar.png | Bin .../assets/voxelcam/textures/karmapony.png | Bin .../assets/voxelcam/textures/photo.png | Bin {VoxelCam/res => res}/litemod.json | 0 .../voxelcam/LiteModVoxelCam.java | 36 +- .../voxelcam/VoxelCamConfig.java | 120 +- .../thatapplefreak/voxelcam/VoxelCamCore.java | 502 +++---- .../voxelcam/VoxelCamTransformer.java | 76 +- .../gui/editor/GuiEditScreenshot.java | 156 +- .../voxelcam/gui/mainmenu/FirstRunPopup.java | 140 +- .../mainmenu/GuiMainMenuWithPhotoButton.java | 62 +- .../voxelcam/gui/mainmenu/PhotoButton.java | 52 +- .../voxelcam/gui/manager/DeletePopup.java | 96 +- .../gui/manager/GuiScreenShotManager.java | 384 ++--- .../voxelcam/gui/manager/GuiTextSlot.java | 786 +++++----- .../voxelcam/gui/manager/PhotoSelector.java | 130 +- .../voxelcam/gui/manager/PostPopup.java | 250 ++-- .../voxelcam/gui/manager/RenamePopup.java | 110 +- .../voxelcam/gui/manager/ScalePhotoFrame.java | 282 ++-- .../voxelcam/gui/manager/SearchBar.java | 1302 ++++++++--------- .../settings/GuiVoxelCamSettingsPanel.java | 178 +-- .../gui/settings/VoxelPropertyIntFieldEX.java | 94 +- .../imagehandle/BigScreenshotTaker.java | 172 +-- .../imagehandle/GLImageMemoryHandler.java | 172 +-- .../voxelcam/imagehandle/ImageDrawer.java | 92 +- .../imagehandle/ScreenshotIncapable.java | 10 +- .../voxelcam/imagehandle/ScreenshotNamer.java | 60 +- .../voxelcam/imagehandle/ScreenshotTaker.java | 256 ++-- .../voxelcam/imagehandle/filters/Filter.java | 18 +- .../imagehandle/metadata/MetaDataHandler.java | 66 +- .../voxelcam/io/VoxelCamIO.java | 168 +-- .../voxelcam/upload/AutoUploader.java | 186 +-- .../upload/dropbox/DropboxHandler.java | 154 +- .../upload/facebook/FacebookHandler.java | 80 +- .../googleDrive/GoogleDriveHandler.java | 146 +- .../voxelcam/upload/imgur/Imgur.java | 288 ++-- .../voxelcam/upload/imgur/ImgurCallback.java | 14 +- .../voxelcam/upload/imgur/ImgurDelete.java | 44 +- .../upload/imgur/ImgurDeleteResponse.java | 68 +- .../voxelcam/upload/imgur/ImgurHandler.java | 64 +- .../voxelcam/upload/imgur/ImgurResponse.java | 22 +- .../voxelcam/upload/imgur/ImgurUpload.java | 78 +- .../upload/imgur/ImgurUploadFailedPopup.java | 76 +- .../upload/imgur/ImgurUploadResponse.java | 238 +-- .../upload/imgur/ImgurUploadSuccessPopup.java | 128 +- .../upload/reddit/ILoginCallback.java | 18 +- .../upload/reddit/IRedditPostCallback.java | 22 +- .../voxelcam/upload/reddit/RedditHandler.java | 186 +-- .../upload/reddit/RedditLoginPopup.java | 220 +-- .../upload/reddit/RedditPostPopup.java | 234 +-- .../upload/reddit/RedditPostSuccessPopup.java | 126 +- .../upload/twitter/TwitterHandler.java | 188 +-- .../upload/twitter/TwitterLoginPopup.java | 80 +- .../upload/twitter/TwitterPINPopup.java | 156 +- .../upload/twitter/TwitterPostPopup.java | 180 +-- .../twitter/TwitterUploadFailedPopup.java | 152 +- .../twitter/TwitterUploadSuccessPopup.java | 146 +- 80 files changed, 4954 insertions(+), 4956 deletions(-) rename VoxelCam/.classpath => .classpath (74%) rename VoxelCam/.gitignore => .gitignore (100%) rename VoxelCam/.project => .project (95%) rename {VoxelCam/.settings => .settings}/org.eclipse.core.resources.prefs (97%) rename {VoxelCam/.settings => .settings}/org.eclipse.jdt.core.prefs (98%) rename {VoxelCam/build => build}/build.gradle (100%) rename {VoxelCam/build => build}/build.xml (97%) rename {VoxelCam/build => build}/buildnumber.txt (96%) rename {VoxelCam/build => build}/gradle/wrapper/gradle-wrapper.jar (100%) rename {VoxelCam/build => build}/gradle/wrapper/gradle-wrapper.properties (100%) rename {VoxelCam/build => build}/gradlew (100%) rename {VoxelCam/build => build}/gradlew.bat (100%) rename {VoxelCam/build => build}/litemod.template.json (98%) rename {VoxelCam/debug => debug}/litemod.json (98%) rename {VoxelCam/lib => lib}/facebook4j-core-2.0.0.jar (100%) rename {VoxelCam/lib => lib}/jreddit-1.0.1-SNAPSHOT.jar (100%) rename {VoxelCam/lib => lib}/twitter4j-core-3.0.6-SNAPSHOT.jar (100%) rename {VoxelCam/res => res}/assets/voxelcam/lang/de_DE.lang (100%) rename {VoxelCam/res => res}/assets/voxelcam/lang/en_GB.lang (97%) rename {VoxelCam/res => res}/assets/voxelcam/lang/en_US.lang (96%) rename {VoxelCam/res => res}/assets/voxelcam/lang/es_ES.lang (100%) rename {VoxelCam/res => res}/assets/voxelcam/lang/nl_NL.lang (97%) rename {VoxelCam/res => res}/assets/voxelcam/lang/sv_SE.lang (97%) rename {VoxelCam/res => res}/assets/voxelcam/textures/avatar.png (100%) rename {VoxelCam/res => res}/assets/voxelcam/textures/karmapony.png (100%) rename {VoxelCam/res => res}/assets/voxelcam/textures/photo.png (100%) rename {VoxelCam/res => res}/litemod.json (100%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/LiteModVoxelCam.java (94%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/VoxelCamConfig.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/VoxelCamCore.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/VoxelCamTransformer.java (98%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/io/VoxelCamIO.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/AutoUploader.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java (94%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java (95%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java (94%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java (94%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java (94%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java (97%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java (96%) rename {VoxelCam/src => src}/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java (96%) diff --git a/VoxelCam/.classpath b/.classpath similarity index 74% rename from VoxelCam/.classpath rename to .classpath index 4ef8b93..c057c32 100644 --- a/VoxelCam/.classpath +++ b/.classpath @@ -1,18 +1,16 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/VoxelCam/.gitignore b/.gitignore similarity index 100% rename from VoxelCam/.gitignore rename to .gitignore diff --git a/VoxelCam/.project b/.project similarity index 95% rename from VoxelCam/.project rename to .project index 13aa8ef..04b938d 100644 --- a/VoxelCam/.project +++ b/.project @@ -1,17 +1,17 @@ - - - VoxelCam - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + + + VoxelCam + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/VoxelCam/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs similarity index 97% rename from VoxelCam/.settings/org.eclipse.core.resources.prefs rename to .settings/org.eclipse.core.resources.prefs index 36a723b..d94b43d 100644 --- a/VoxelCam/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,3 @@ -eclipse.preferences.version=1 -encoding//res/assets/voxelcam/lang/es_ES.lang=UTF-8 -encoding//res/assets/voxelcam/lang/sv_SE.lang=UTF-8 +eclipse.preferences.version=1 +encoding//res/assets/voxelcam/lang/es_ES.lang=UTF-8 +encoding//res/assets/voxelcam/lang/sv_SE.lang=UTF-8 diff --git a/VoxelCam/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs similarity index 98% rename from VoxelCam/.settings/org.eclipse.jdt.core.prefs rename to .settings/org.eclipse.jdt.core.prefs index 54e493c..8000cd6 100644 --- a/VoxelCam/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,11 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/VoxelCam/build/build.gradle b/build/build.gradle similarity index 100% rename from VoxelCam/build/build.gradle rename to build/build.gradle diff --git a/VoxelCam/build/build.xml b/build/build.xml similarity index 97% rename from VoxelCam/build/build.xml rename to build/build.xml index 9221992..f017a07 100644 --- a/VoxelCam/build/build.xml +++ b/build/build.xml @@ -1,140 +1,140 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VoxelCam/build/buildnumber.txt b/build/buildnumber.txt similarity index 96% rename from VoxelCam/build/buildnumber.txt rename to build/buildnumber.txt index 4b857da..4b3826d 100644 --- a/VoxelCam/build/buildnumber.txt +++ b/build/buildnumber.txt @@ -1,3 +1,3 @@ -#Build Number for ANT. Do not edit! -#Mon Apr 07 16:56:25 EDT 2014 -build.number=30 +#Build Number for ANT. Do not edit! +#Mon Apr 07 16:56:25 EDT 2014 +build.number=30 diff --git a/VoxelCam/build/gradle/wrapper/gradle-wrapper.jar b/build/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from VoxelCam/build/gradle/wrapper/gradle-wrapper.jar rename to build/gradle/wrapper/gradle-wrapper.jar diff --git a/VoxelCam/build/gradle/wrapper/gradle-wrapper.properties b/build/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from VoxelCam/build/gradle/wrapper/gradle-wrapper.properties rename to build/gradle/wrapper/gradle-wrapper.properties diff --git a/VoxelCam/build/gradlew b/build/gradlew similarity index 100% rename from VoxelCam/build/gradlew rename to build/gradlew diff --git a/VoxelCam/build/gradlew.bat b/build/gradlew.bat similarity index 100% rename from VoxelCam/build/gradlew.bat rename to build/gradlew.bat diff --git a/VoxelCam/build/litemod.template.json b/build/litemod.template.json similarity index 98% rename from VoxelCam/build/litemod.template.json rename to build/litemod.template.json index b7d7072..e300b5c 100644 --- a/VoxelCam/build/litemod.template.json +++ b/build/litemod.template.json @@ -1,9 +1,9 @@ -{ - "name": "${ant.project.name}", - "version": "${version}", - "mcversion": "${litemodversion}", - "revision": "${build.number}", - "author": "${author}", - "classTransformerClasses": "com.thatapplefreak.voxelcam.VoxelCamTransformer", - "description": " VoxelCam is a tool for taking, managing, editing, and posting screenshots to social networks within Minecraft. It also allows the player to take screenshots far beyond the size of his/her screen using a special openGL trick.\n\n Special Thanks:\n Mumfrey - FBO Help" +{ + "name": "${ant.project.name}", + "version": "${version}", + "mcversion": "${litemodversion}", + "revision": "${build.number}", + "author": "${author}", + "classTransformerClasses": "com.thatapplefreak.voxelcam.VoxelCamTransformer", + "description": " VoxelCam is a tool for taking, managing, editing, and posting screenshots to social networks within Minecraft. It also allows the player to take screenshots far beyond the size of his/her screen using a special openGL trick.\n\n Special Thanks:\n Mumfrey - FBO Help" } \ No newline at end of file diff --git a/VoxelCam/debug/litemod.json b/debug/litemod.json similarity index 98% rename from VoxelCam/debug/litemod.json rename to debug/litemod.json index 4bc28d0..f7af7c3 100644 --- a/VoxelCam/debug/litemod.json +++ b/debug/litemod.json @@ -1,7 +1,7 @@ -{ - "name": "VoxelCam", - "mcversion": "1.6.4", - "author": "thatapplefreak", - "classTransformerClasses": "com.thatapplefreak.voxelcam.VoxelCamTransformer", - "description": " VoxelCam is a tool for taking, managing, editing, and posting screenshots to social networks within Minecraft. It also allows the player to take screenshots far beyond the size of his/her screen using a special openGL trick.\n\n Special Thanks:\n Mumfrey - FBO Help" +{ + "name": "VoxelCam", + "mcversion": "1.6.4", + "author": "thatapplefreak", + "classTransformerClasses": "com.thatapplefreak.voxelcam.VoxelCamTransformer", + "description": " VoxelCam is a tool for taking, managing, editing, and posting screenshots to social networks within Minecraft. It also allows the player to take screenshots far beyond the size of his/her screen using a special openGL trick.\n\n Special Thanks:\n Mumfrey - FBO Help" } \ No newline at end of file diff --git a/VoxelCam/lib/facebook4j-core-2.0.0.jar b/lib/facebook4j-core-2.0.0.jar similarity index 100% rename from VoxelCam/lib/facebook4j-core-2.0.0.jar rename to lib/facebook4j-core-2.0.0.jar diff --git a/VoxelCam/lib/jreddit-1.0.1-SNAPSHOT.jar b/lib/jreddit-1.0.1-SNAPSHOT.jar similarity index 100% rename from VoxelCam/lib/jreddit-1.0.1-SNAPSHOT.jar rename to lib/jreddit-1.0.1-SNAPSHOT.jar diff --git a/VoxelCam/lib/twitter4j-core-3.0.6-SNAPSHOT.jar b/lib/twitter4j-core-3.0.6-SNAPSHOT.jar similarity index 100% rename from VoxelCam/lib/twitter4j-core-3.0.6-SNAPSHOT.jar rename to lib/twitter4j-core-3.0.6-SNAPSHOT.jar diff --git a/VoxelCam/res/assets/voxelcam/lang/de_DE.lang b/res/assets/voxelcam/lang/de_DE.lang similarity index 100% rename from VoxelCam/res/assets/voxelcam/lang/de_DE.lang rename to res/assets/voxelcam/lang/de_DE.lang diff --git a/VoxelCam/res/assets/voxelcam/lang/en_GB.lang b/res/assets/voxelcam/lang/en_GB.lang similarity index 97% rename from VoxelCam/res/assets/voxelcam/lang/en_GB.lang rename to res/assets/voxelcam/lang/en_GB.lang index 26ab172..208533e 100644 --- a/VoxelCam/res/assets/voxelcam/lang/en_GB.lang +++ b/res/assets/voxelcam/lang/en_GB.lang @@ -1,3 +1,3 @@ -#English (United Kingdom) - +#English (United Kingdom) + twitauthline2=first recieve authorisation from Twitter \ No newline at end of file diff --git a/VoxelCam/res/assets/voxelcam/lang/en_US.lang b/res/assets/voxelcam/lang/en_US.lang similarity index 96% rename from VoxelCam/res/assets/voxelcam/lang/en_US.lang rename to res/assets/voxelcam/lang/en_US.lang index e1c8e2b..f136b24 100644 --- a/VoxelCam/res/assets/voxelcam/lang/en_US.lang +++ b/res/assets/voxelcam/lang/en_US.lang @@ -1,81 +1,81 @@ -#English (US) - -camera=Camera -screenshot=Screenshot -screenshots=Screenshots -writing=writing -loading=Loading -savingscreenshot=Saving Screenshot -savingpleasewait=Saving Screenshot right now, please wait -done=Done -ok=Ok -delete=Delete -yes=Yes -no=No -areyousure=Are You Sure -back=Back -rename=Rename -edit=Edit -openscreenshotsfolder=Open Screenshots Folder -postto=Post to -uploading=Uploading -loadingimage=Loading Image -noscreenshots=No Screenshots -search=Search -megascreenshotsettings=Mega-Screenshot Settings -width=Width -height=Height -memorywarning=WARNING! Do not use higher resolutions on low end computers! -autouploadsocialmedia=Automatically Upload Screenshots to social media -to=To -savedscreenshotas=Saved screenshot as -dropboxnoinstallerror=Error uploading to Dropbox! Dropbox not installed! -googledrivenoinstallerror=Error uploading to Google Drive! Google Drive not installed! -imgurautouploaderror=Error uploading image to Imgur -clicktoview=Click to view -imgurautouploadsuccess=Auto upload to Imgur succeeded -dropboxautouploadsuccess=Auto upload to Dropbox succeeded -googledriveautouploadsuccess=Auto upload to Google Drive succeeded -imguruploadfail=Upload to Imgur failed -imguruploadsuccess=Upload to Imgur succeeded -uploadfailed=Upload failed -close=Close -undo=Undo -open=Open -copylink=Copy link -uploadsuccess=Upload completed successfully -postsuccess=Post completed successfully -errorcode=Error code -pleaseenterpin=Please enter the PIN you received -post=Post -composetweet=Compose Tweet -remainingletters=Remaining letters -twitterpostfailed=Post to Twitter failed -postfailed=Post failed -twitterpostsuccess=Post to Twitter succeeded -postcompletedsuccessfully=Post completed successfully -moreinfo=More info -keybindings=Keybindings -developer=Developer -login=Login -pleaseloginto=Please login to -loggingin= Logging in -loginfailpleasetryagain=Login failed! Please try again -username=Username -password=Password -failedtopost=Failed to post -posttitle=Post title -subreddit=Subreddit -posting=Posting -redditpostsuccess=Post to Reddit succeeded - -welcomeline1=Thank you for downloading VoxelCam version -welcomeline2=Open the screenshots manager while in game -welcomeline3=Take a HUGE screenhsot -welcomeline4=Open VoxelOptions - -twitauthline1=To post to Twitter VoxelCam must -twitauthline2=first receive authorization from Twitter -twitauthline3=to use your account. If you are not ok -twitauthline4=with this click "Cancel" otherwise click +#English (US) + +camera=Camera +screenshot=Screenshot +screenshots=Screenshots +writing=writing +loading=Loading +savingscreenshot=Saving Screenshot +savingpleasewait=Saving Screenshot right now, please wait +done=Done +ok=Ok +delete=Delete +yes=Yes +no=No +areyousure=Are You Sure +back=Back +rename=Rename +edit=Edit +openscreenshotsfolder=Open Screenshots Folder +postto=Post to +uploading=Uploading +loadingimage=Loading Image +noscreenshots=No Screenshots +search=Search +megascreenshotsettings=Mega-Screenshot Settings +width=Width +height=Height +memorywarning=WARNING! Do not use higher resolutions on low end computers! +autouploadsocialmedia=Automatically Upload Screenshots to social media +to=To +savedscreenshotas=Saved screenshot as +dropboxnoinstallerror=Error uploading to Dropbox! Dropbox not installed! +googledrivenoinstallerror=Error uploading to Google Drive! Google Drive not installed! +imgurautouploaderror=Error uploading image to Imgur +clicktoview=Click to view +imgurautouploadsuccess=Auto upload to Imgur succeeded +dropboxautouploadsuccess=Auto upload to Dropbox succeeded +googledriveautouploadsuccess=Auto upload to Google Drive succeeded +imguruploadfail=Upload to Imgur failed +imguruploadsuccess=Upload to Imgur succeeded +uploadfailed=Upload failed +close=Close +undo=Undo +open=Open +copylink=Copy link +uploadsuccess=Upload completed successfully +postsuccess=Post completed successfully +errorcode=Error code +pleaseenterpin=Please enter the PIN you received +post=Post +composetweet=Compose Tweet +remainingletters=Remaining letters +twitterpostfailed=Post to Twitter failed +postfailed=Post failed +twitterpostsuccess=Post to Twitter succeeded +postcompletedsuccessfully=Post completed successfully +moreinfo=More info +keybindings=Keybindings +developer=Developer +login=Login +pleaseloginto=Please login to +loggingin= Logging in +loginfailpleasetryagain=Login failed! Please try again +username=Username +password=Password +failedtopost=Failed to post +posttitle=Post title +subreddit=Subreddit +posting=Posting +redditpostsuccess=Post to Reddit succeeded + +welcomeline1=Thank you for downloading VoxelCam version +welcomeline2=Open the screenshots manager while in game +welcomeline3=Take a HUGE screenhsot +welcomeline4=Open VoxelOptions + +twitauthline1=To post to Twitter VoxelCam must +twitauthline2=first receive authorization from Twitter +twitauthline3=to use your account. If you are not ok +twitauthline4=with this click "Cancel" otherwise click twitauthline5="Ok" to continue. \ No newline at end of file diff --git a/VoxelCam/res/assets/voxelcam/lang/es_ES.lang b/res/assets/voxelcam/lang/es_ES.lang similarity index 100% rename from VoxelCam/res/assets/voxelcam/lang/es_ES.lang rename to res/assets/voxelcam/lang/es_ES.lang diff --git a/VoxelCam/res/assets/voxelcam/lang/nl_NL.lang b/res/assets/voxelcam/lang/nl_NL.lang similarity index 97% rename from VoxelCam/res/assets/voxelcam/lang/nl_NL.lang rename to res/assets/voxelcam/lang/nl_NL.lang index 6338987..53e35f1 100644 --- a/VoxelCam/res/assets/voxelcam/lang/nl_NL.lang +++ b/res/assets/voxelcam/lang/nl_NL.lang @@ -1,69 +1,69 @@ -#Dutch (Netherlands) - -camera=Camera -screenshot=Schermafbeelding -screenshots=Schermafbeeldingen -writing=Schrijven -loading=Laden -savingscreenshot=Schermafbeelding is bezig met opslaan -savingpleasewait=Schermafbeelding is nu bezig met opslaan, even geduld -done=Gedaan -ok=Ok -delete=Verwijder -yes=Ja -no=Nee -areyousure=Bent u zeker -back=Terug -rename=Hernoem -edit=Wijzig -openscreenshotsfolder=Open Schermafbeeldingsmap -postto=Verzend naar -uploading=Bezig met uploaden -loadingimage=Bezig met Laden van afbeelding -noscreenshots=Geen Schermafbeeldingen -search=Zoek -megascreenshotsettings=Mega-Schermafbeelding Instellingen -width=Breedte -height=Hoogte -memorywarning=PAS OP! Gebruik geen grote resoluties op zwakke computers! -autouploadsocialmedia=Upload automatisch schermafbeeldingen naar sociale media -to=Naar -savedscreenshotas=Schermafbeelding opgeslagen als -dropboxnoinstallerror=Fout bij het uploaden naar Dropbox! Dropbox is niet geïnstalleerd! -googledrivenoinstallerror=Fout bij het uploaden naar Google Drive! Google Drive is niet geïnstalleerd! -imgurautouploaderror=Fout bij het uploaden naar imgur -clicktoview=Klik om te bekijken -imgurautouploadsuccess=Automatische upload naar imgur geslaagd -dropboxautouploadsuccess=Automatische upload naar Dropbox geslaagd -googledriveautouploadsuccess=Automatische upload naar Google Drive geslaagd -imguruploadfail=Upload naar imgur is mislukt -imguruploadsuccess=Upload naar imgur is mislukt -uploadfailed=Upload is mislukt -close=Sluit -undo=Ongedaan maken -open=Open -copylink=Kopieer link -uploadsuccess=Upload is met succes voltooid -errorcode=Foutcode -pleaseenterpin=Gelieve de verkregen PIN in te geven -post=Verzend -composetweet=Stel Tweet op -remainingletters=Letters over -twitterpostfailed=Verzending naar Twitter is mislukt -postfailed=Verzending is mislukt -twitterpostsuccess=Verzending naar Twitter is gelukt -postcompletedsuccessfully=Verzending is met succes voltooid -moreinfo=Meer info -keybindings=Sneltoetsen -developer=Ontwikkelaar - -welcomeline1=Bedankt voor het downloaden van VoxelCam versie -welcomeline2=Open de schermafbeeldingsmanager tijdens het spel -welcomeline3=Neem een REUSACHTIGE schermafbeelding -welcomeline4=Open Voxel-Instellingen - -twitauthline1=Om naar Twitter te kunnen versturen moet VoxelCam -twitauthline2=eerst authorisatie van Twitter krijgen -twitauthline3=om uw account te kunnen gebruiken. Als u hier niet ok -twitauthline4=mee bent, klik dan op "Annuleer" anders klikt u -twitauthline5=op "Ok" om door te gaan. +#Dutch (Netherlands) + +camera=Camera +screenshot=Schermafbeelding +screenshots=Schermafbeeldingen +writing=Schrijven +loading=Laden +savingscreenshot=Schermafbeelding is bezig met opslaan +savingpleasewait=Schermafbeelding is nu bezig met opslaan, even geduld +done=Gedaan +ok=Ok +delete=Verwijder +yes=Ja +no=Nee +areyousure=Bent u zeker +back=Terug +rename=Hernoem +edit=Wijzig +openscreenshotsfolder=Open Schermafbeeldingsmap +postto=Verzend naar +uploading=Bezig met uploaden +loadingimage=Bezig met Laden van afbeelding +noscreenshots=Geen Schermafbeeldingen +search=Zoek +megascreenshotsettings=Mega-Schermafbeelding Instellingen +width=Breedte +height=Hoogte +memorywarning=PAS OP! Gebruik geen grote resoluties op zwakke computers! +autouploadsocialmedia=Upload automatisch schermafbeeldingen naar sociale media +to=Naar +savedscreenshotas=Schermafbeelding opgeslagen als +dropboxnoinstallerror=Fout bij het uploaden naar Dropbox! Dropbox is niet geïnstalleerd! +googledrivenoinstallerror=Fout bij het uploaden naar Google Drive! Google Drive is niet geïnstalleerd! +imgurautouploaderror=Fout bij het uploaden naar imgur +clicktoview=Klik om te bekijken +imgurautouploadsuccess=Automatische upload naar imgur geslaagd +dropboxautouploadsuccess=Automatische upload naar Dropbox geslaagd +googledriveautouploadsuccess=Automatische upload naar Google Drive geslaagd +imguruploadfail=Upload naar imgur is mislukt +imguruploadsuccess=Upload naar imgur is mislukt +uploadfailed=Upload is mislukt +close=Sluit +undo=Ongedaan maken +open=Open +copylink=Kopieer link +uploadsuccess=Upload is met succes voltooid +errorcode=Foutcode +pleaseenterpin=Gelieve de verkregen PIN in te geven +post=Verzend +composetweet=Stel Tweet op +remainingletters=Letters over +twitterpostfailed=Verzending naar Twitter is mislukt +postfailed=Verzending is mislukt +twitterpostsuccess=Verzending naar Twitter is gelukt +postcompletedsuccessfully=Verzending is met succes voltooid +moreinfo=Meer info +keybindings=Sneltoetsen +developer=Ontwikkelaar + +welcomeline1=Bedankt voor het downloaden van VoxelCam versie +welcomeline2=Open de schermafbeeldingsmanager tijdens het spel +welcomeline3=Neem een REUSACHTIGE schermafbeelding +welcomeline4=Open Voxel-Instellingen + +twitauthline1=Om naar Twitter te kunnen versturen moet VoxelCam +twitauthline2=eerst authorisatie van Twitter krijgen +twitauthline3=om uw account te kunnen gebruiken. Als u hier niet ok +twitauthline4=mee bent, klik dan op "Annuleer" anders klikt u +twitauthline5=op "Ok" om door te gaan. diff --git a/VoxelCam/res/assets/voxelcam/lang/sv_SE.lang b/res/assets/voxelcam/lang/sv_SE.lang similarity index 97% rename from VoxelCam/res/assets/voxelcam/lang/sv_SE.lang rename to res/assets/voxelcam/lang/sv_SE.lang index dc7ce33..b323bf3 100644 --- a/VoxelCam/res/assets/voxelcam/lang/sv_SE.lang +++ b/res/assets/voxelcam/lang/sv_SE.lang @@ -1,68 +1,68 @@ -#Sweedish (Sweeden) - -camera=Kamera -screenshot=Skärmdump -screenshots=Skärmdumpar -writing=skriver -loading=Laddar -savingscreenshot=Sparar Skärmdump -savingpleasewait=Sparar Skärmdump just nu, var vänlig vänta... -done=Klart -ok=Ok -delete=Radera -yes=Ja -no=Nej -areyousure=Är du säker -back=Tillbaka -rename=Byt namn -edit=Redigera -openscreenshotsfolder=Öppna Skärmdumpsmappen -postto=Skicka till -uploading=Laddar upp -loadingimage=Laddar bild -noscreenshots=Inga skärmdumpar -search=Sök -megascreenshotsettings=Mega-Skärmdump Inställningar -width=Bredd -height=Höjd -memorywarning=VARNING! Använd inte högre upplösningar på långsamma datorer! -autouploadsocialmedia=Automatiskt ladda upp bilder till socialt nätverk -to=Till -savedscreenshotas=Sparad skärmdump som -dropboxnoinstallerror=Uppladdning till Dropbox misslyckades! Dropbox ej installerad! -googledrivenoinstallerror=Uppladdning till Google Drive misslyckades! Google Drive ej installerad! -imgurautouploaderror=Uppladdning till Imgur misslyckades! -clicktoview=Klicka för att visa -imgurautouploadsuccess=Autouppladdning till Imgur lyckades -dropboxautouploadsuccess=Autouppladdning till Dropbox lyckades -googledriveautouploadsuccess=Autouppladdning till Google Drive lyckades -imguruploadfail=Uppladdning till Imgur misslyckades -imguruploadsuccess=Uppladdning till Imgur lyckades -uploadfailed=Uppladdning misslyckades -close=Stäng -undo=Ångra -open=Öppna -copylink=Kopiera länk -uploadsuccess=Uppladdnigen lyckades -errorcode=Felkod -pleaseenterpin=Var vänlig skriv ditt PIN du har mottagit -post=Posta -composetweet=Komponera Tweet -remainingletters=Återstående tecken -twitterpostfailed=Posta på Twitter misslyckades -postfailed=Misslyckades att posta -twitterpostsuccess=Posta på Twitter lyckades -postcompletedsuccessfully=Lyckades att posta -moreinfo=Mer info -keybindings=Tangentbindningar -developer=Utvecklare - -welcomeline1=Tack för att du har laddat ner VoxelCam version -welcomeline2=Öppna skärmdumpshanteraren medan du spelar -welcomeline3=Ta en JÄTTESTOR skärmdump -welcomeline4=Öppna VoxelOptions -twitauthline1=För att posta på Twitter VoxelCam måste du -twitauthline2=först ha tillstånd från Twitter -twitauthline3=för att använda ditt konto. Bekräfta val med -twitauthline4=, "Cancel" för att avbryta processen -twitauthline5=eller "Ok" för att fortsätta. +#Sweedish (Sweeden) + +camera=Kamera +screenshot=Skärmdump +screenshots=Skärmdumpar +writing=skriver +loading=Laddar +savingscreenshot=Sparar Skärmdump +savingpleasewait=Sparar Skärmdump just nu, var vänlig vänta... +done=Klart +ok=Ok +delete=Radera +yes=Ja +no=Nej +areyousure=Är du säker +back=Tillbaka +rename=Byt namn +edit=Redigera +openscreenshotsfolder=Öppna Skärmdumpsmappen +postto=Skicka till +uploading=Laddar upp +loadingimage=Laddar bild +noscreenshots=Inga skärmdumpar +search=Sök +megascreenshotsettings=Mega-Skärmdump Inställningar +width=Bredd +height=Höjd +memorywarning=VARNING! Använd inte högre upplösningar på långsamma datorer! +autouploadsocialmedia=Automatiskt ladda upp bilder till socialt nätverk +to=Till +savedscreenshotas=Sparad skärmdump som +dropboxnoinstallerror=Uppladdning till Dropbox misslyckades! Dropbox ej installerad! +googledrivenoinstallerror=Uppladdning till Google Drive misslyckades! Google Drive ej installerad! +imgurautouploaderror=Uppladdning till Imgur misslyckades! +clicktoview=Klicka för att visa +imgurautouploadsuccess=Autouppladdning till Imgur lyckades +dropboxautouploadsuccess=Autouppladdning till Dropbox lyckades +googledriveautouploadsuccess=Autouppladdning till Google Drive lyckades +imguruploadfail=Uppladdning till Imgur misslyckades +imguruploadsuccess=Uppladdning till Imgur lyckades +uploadfailed=Uppladdning misslyckades +close=Stäng +undo=Ångra +open=Öppna +copylink=Kopiera länk +uploadsuccess=Uppladdnigen lyckades +errorcode=Felkod +pleaseenterpin=Var vänlig skriv ditt PIN du har mottagit +post=Posta +composetweet=Komponera Tweet +remainingletters=Återstående tecken +twitterpostfailed=Posta på Twitter misslyckades +postfailed=Misslyckades att posta +twitterpostsuccess=Posta på Twitter lyckades +postcompletedsuccessfully=Lyckades att posta +moreinfo=Mer info +keybindings=Tangentbindningar +developer=Utvecklare + +welcomeline1=Tack för att du har laddat ner VoxelCam version +welcomeline2=Öppna skärmdumpshanteraren medan du spelar +welcomeline3=Ta en JÄTTESTOR skärmdump +welcomeline4=Öppna VoxelOptions +twitauthline1=För att posta på Twitter VoxelCam måste du +twitauthline2=först ha tillstånd från Twitter +twitauthline3=för att använda ditt konto. Bekräfta val med +twitauthline4=, "Cancel" för att avbryta processen +twitauthline5=eller "Ok" för att fortsätta. diff --git a/VoxelCam/res/assets/voxelcam/textures/avatar.png b/res/assets/voxelcam/textures/avatar.png similarity index 100% rename from VoxelCam/res/assets/voxelcam/textures/avatar.png rename to res/assets/voxelcam/textures/avatar.png diff --git a/VoxelCam/res/assets/voxelcam/textures/karmapony.png b/res/assets/voxelcam/textures/karmapony.png similarity index 100% rename from VoxelCam/res/assets/voxelcam/textures/karmapony.png rename to res/assets/voxelcam/textures/karmapony.png diff --git a/VoxelCam/res/assets/voxelcam/textures/photo.png b/res/assets/voxelcam/textures/photo.png similarity index 100% rename from VoxelCam/res/assets/voxelcam/textures/photo.png rename to res/assets/voxelcam/textures/photo.png diff --git a/VoxelCam/res/litemod.json b/res/litemod.json similarity index 100% rename from VoxelCam/res/litemod.json rename to res/litemod.json diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java b/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java similarity index 94% rename from VoxelCam/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java rename to src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java index 001c519..492920a 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java +++ b/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java @@ -1,18 +1,18 @@ -package com.thatapplefreak.voxelcam; - -import com.thevoxelbox.common.VoxelCommonLiteMod; - -public class LiteModVoxelCam extends VoxelCommonLiteMod{ - - public LiteModVoxelCam() { - super("com.thatapplefreak.voxelcam.VoxelCamCore"); - } - - public String getVersion() { - return "1.3.1"; - } - - public String getName() { - return "VoxelCam"; - } -} +package com.thatapplefreak.voxelcam; + +import com.thevoxelbox.common.VoxelCommonLiteMod; + +public class LiteModVoxelCam extends VoxelCommonLiteMod{ + + public LiteModVoxelCam() { + super("com.thatapplefreak.voxelcam.VoxelCamCore"); + } + + public String getVersion() { + return "1.3.1"; + } + + public String getName() { + return "VoxelCam"; + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java b/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java rename to src/com/thatapplefreak/voxelcam/VoxelCamConfig.java index bd8ce87..6522c57 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java @@ -1,62 +1,62 @@ -package com.thatapplefreak.voxelcam; - -import net.minecraft.client.settings.KeyBinding; - -import org.lwjgl.input.Keyboard; - -import com.thevoxelbox.common.interfaces.IVoxelPropertyProvider; -import com.thevoxelbox.common.util.ModConfig; - - -public class VoxelCamConfig extends ModConfig implements IVoxelPropertyProvider { - - // Keybinds that VoxelCam uses - public static final KeyBinding KEY_OPENSCREENSHOTMANAGER = new KeyBinding("ScreenShot Manager", Keyboard.KEY_H, "VoxelCam"); - - // Strings to access the settings - public static final String FIRSTRUN = "firstRun"; - - public static final String PHOTOWIDTH = "photoWidth"; - public static final String PHOTOHEIGHT = "photoHeight"; - - public static final String TWITTERUSERID = "twitterUserID"; - public static final String TWITTERAUTHTOKEN = "twitterAuthToken"; - public static final String TWITTERAUTHTOKENSECRET = "twitterAuthTokenSecret"; - - public static final String FACEBOOKAUTHTOKEN = "facebookauthtoken"; - public static final String FACEBOOKUSERID = "facebookUserID"; - - public static final String REDDITUSERNAME = "redditUsername"; - public static final String REDDITPASSWORD = "redditPassword"; - - public static final String AUTO_UPLOAD = "autoUplaod"; - public static final String AUTO_UPLOAD_IMGUR = "autoUploadToImgur"; - public static final String AUTO_UPLOAD_DROPBOX = "autoUploadToDropbox"; - public static final String AUTO_UPLOAD_GOOGLEDRIVE = "autoUploadToGoogleDrive"; - - public VoxelCamConfig() { - super("VoxelCam", "voxelcam.properties"); - } - - /** - * Sets the default values for the settings - */ - @Override - protected void setDefaults() { - defaults.put(FIRSTRUN, "true"); - defaults.put(PHOTOWIDTH, "1920"); - defaults.put(PHOTOHEIGHT, "1080"); - defaults.put(TWITTERUSERID, "needLogin"); - defaults.put(TWITTERAUTHTOKEN, "needLogin"); - defaults.put(TWITTERAUTHTOKENSECRET, "needLogin"); - defaults.put(FACEBOOKAUTHTOKEN, "needLogin"); +package com.thatapplefreak.voxelcam; + +import net.minecraft.client.settings.KeyBinding; + +import org.lwjgl.input.Keyboard; + +import com.thevoxelbox.common.interfaces.IVoxelPropertyProvider; +import com.thevoxelbox.common.util.ModConfig; + + +public class VoxelCamConfig extends ModConfig implements IVoxelPropertyProvider { + + // Keybinds that VoxelCam uses + public static final KeyBinding KEY_OPENSCREENSHOTMANAGER = new KeyBinding("ScreenShot Manager", Keyboard.KEY_H, "VoxelCam"); + + // Strings to access the settings + public static final String FIRSTRUN = "firstRun"; + + public static final String PHOTOWIDTH = "photoWidth"; + public static final String PHOTOHEIGHT = "photoHeight"; + + public static final String TWITTERUSERID = "twitterUserID"; + public static final String TWITTERAUTHTOKEN = "twitterAuthToken"; + public static final String TWITTERAUTHTOKENSECRET = "twitterAuthTokenSecret"; + + public static final String FACEBOOKAUTHTOKEN = "facebookauthtoken"; + public static final String FACEBOOKUSERID = "facebookUserID"; + + public static final String REDDITUSERNAME = "redditUsername"; + public static final String REDDITPASSWORD = "redditPassword"; + + public static final String AUTO_UPLOAD = "autoUplaod"; + public static final String AUTO_UPLOAD_IMGUR = "autoUploadToImgur"; + public static final String AUTO_UPLOAD_DROPBOX = "autoUploadToDropbox"; + public static final String AUTO_UPLOAD_GOOGLEDRIVE = "autoUploadToGoogleDrive"; + + public VoxelCamConfig() { + super("VoxelCam", "voxelcam.properties"); + } + + /** + * Sets the default values for the settings + */ + @Override + protected void setDefaults() { + defaults.put(FIRSTRUN, "true"); + defaults.put(PHOTOWIDTH, "1920"); + defaults.put(PHOTOHEIGHT, "1080"); + defaults.put(TWITTERUSERID, "needLogin"); + defaults.put(TWITTERAUTHTOKEN, "needLogin"); + defaults.put(TWITTERAUTHTOKENSECRET, "needLogin"); + defaults.put(FACEBOOKAUTHTOKEN, "needLogin"); defaults.put(FACEBOOKUSERID, "needLogin"); - defaults.put(REDDITUSERNAME, ""); + defaults.put(REDDITUSERNAME, ""); defaults.put(REDDITPASSWORD, ""); - defaults.put(AUTO_UPLOAD, "false"); - defaults.put(AUTO_UPLOAD_IMGUR, "false"); - defaults.put(AUTO_UPLOAD_DROPBOX, "false"); - defaults.put(AUTO_UPLOAD_GOOGLEDRIVE, "false"); - } - -} + defaults.put(AUTO_UPLOAD, "false"); + defaults.put(AUTO_UPLOAD_IMGUR, "false"); + defaults.put(AUTO_UPLOAD_DROPBOX, "false"); + defaults.put(AUTO_UPLOAD_GOOGLEDRIVE, "false"); + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamCore.java b/src/com/thatapplefreak/voxelcam/VoxelCamCore.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamCore.java rename to src/com/thatapplefreak/voxelcam/VoxelCamCore.java index a31dbb9..4795d48 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamCore.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamCore.java @@ -1,253 +1,253 @@ -package com.thatapplefreak.voxelcam; - -import java.io.File; -import java.lang.reflect.Method; -import java.util.HashSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiMainMenu; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.ScreenShotHelper; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -import com.mumfrey.liteloader.Configurable; -import com.mumfrey.liteloader.InitCompleteListener; -import com.mumfrey.liteloader.RenderListener; -import com.mumfrey.liteloader.Tickable; -import com.mumfrey.liteloader.core.LiteLoader; -import com.mumfrey.liteloader.modconfig.ConfigPanel; -import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; -import com.mumfrey.liteloader.util.ModUtilities; -import com.thatapplefreak.voxelcam.gui.mainmenu.FirstRunPopup; -import com.thatapplefreak.voxelcam.gui.mainmenu.GuiMainMenuWithPhotoButton; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.gui.settings.GuiVoxelCamSettingsPanel; -import com.thatapplefreak.voxelcam.imagehandle.BigScreenshotTaker; -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotTaker; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thevoxelbox.common.gui.SettingsPanelManager; -import com.thevoxelbox.common.status.StatusMessage; -import com.thevoxelbox.common.status.StatusMessageManager; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.ChatMessageBuilder; - -/** - * Main hook class for VoxelCam - * - * @author thatapplefreak - * - */ -public class VoxelCamCore implements Tickable, InitCompleteListener, RenderListener, Configurable { - - /** - * This is the configuration file for the mod - */ - private static VoxelCamConfig config = new VoxelCamConfig(); - - /** - * This is the directory minecraft stores screenshots in - */ - private static File screenshotsDir; - - /** - * This is a list of the keys that VoxelCam listens to that are currently in - * the down state - */ - private static HashSet heldKeys = new HashSet(); - - /** - * If the mod VoxelMenu is installed this will be true, adds soft dependancy - * on VoxelMenu - */ - public static boolean voxelMenuExists = false; - - public static boolean screenshotIsSaving = false; - - private static StatusMessage savingStatusMessage; - - /** - * Initialize the mod - */ - @Override - public void init(File configPath) { - screenshotsDir = new File(LiteLoader.getGameDirectory(), "/screenshots"); - if (!screenshotsDir.exists()) { - screenshotsDir.mkdir(); // Make sure that the screenshots directory - // is there, if not, create it - } - VoxelCamIO.updateScreenShotFilesList(""); - - // Register the Keys that VoxelCam uses - LiteLoader.getInput().registerKeyBinding(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER); - - // Add the configuation panel to VoxelCommons awareness - SettingsPanelManager.addSettingsPanel("Camera", GuiVoxelCamSettingsPanel.class); - } - - @Override - public void upgradeSettings(String version, File configPath, File oldConfigPath) { - } - - /** - * This method is called 20 times per second during the game - */ - @Override - public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock) { - // Tell the bigscreenshot taker that the next tick has happend - BigScreenshotTaker.onTick(); - // Check to see if the user wants to open the screenshot manager - if (isKeyDown(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode()) && !isKeyDown(Keyboard.KEY_F3)) { - if (!heldKeys.contains(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode())) { - if (minecraft.currentScreen instanceof GuiMainMenu || minecraft.currentScreen == null) { - if (!screenshotIsSaving) { - minecraft.displayGuiScreen(new GuiScreenShotManager()); - } else { +package com.thatapplefreak.voxelcam; + +import java.io.File; +import java.lang.reflect.Method; +import java.util.HashSet; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ScreenShotHelper; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import com.mumfrey.liteloader.Configurable; +import com.mumfrey.liteloader.InitCompleteListener; +import com.mumfrey.liteloader.RenderListener; +import com.mumfrey.liteloader.Tickable; +import com.mumfrey.liteloader.core.LiteLoader; +import com.mumfrey.liteloader.modconfig.ConfigPanel; +import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; +import com.mumfrey.liteloader.util.ModUtilities; +import com.thatapplefreak.voxelcam.gui.mainmenu.FirstRunPopup; +import com.thatapplefreak.voxelcam.gui.mainmenu.GuiMainMenuWithPhotoButton; +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thatapplefreak.voxelcam.gui.settings.GuiVoxelCamSettingsPanel; +import com.thatapplefreak.voxelcam.imagehandle.BigScreenshotTaker; +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotTaker; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; +import com.thevoxelbox.common.gui.SettingsPanelManager; +import com.thevoxelbox.common.status.StatusMessage; +import com.thevoxelbox.common.status.StatusMessageManager; +import com.thevoxelbox.common.util.AbstractionLayer; +import com.thevoxelbox.common.util.ChatMessageBuilder; + +/** + * Main hook class for VoxelCam + * + * @author thatapplefreak + * + */ +public class VoxelCamCore implements Tickable, InitCompleteListener, RenderListener, Configurable { + + /** + * This is the configuration file for the mod + */ + private static VoxelCamConfig config = new VoxelCamConfig(); + + /** + * This is the directory minecraft stores screenshots in + */ + private static File screenshotsDir; + + /** + * This is a list of the keys that VoxelCam listens to that are currently in + * the down state + */ + private static HashSet heldKeys = new HashSet(); + + /** + * If the mod VoxelMenu is installed this will be true, adds soft dependancy + * on VoxelMenu + */ + public static boolean voxelMenuExists = false; + + public static boolean screenshotIsSaving = false; + + private static StatusMessage savingStatusMessage; + + /** + * Initialize the mod + */ + @Override + public void init(File configPath) { + screenshotsDir = new File(LiteLoader.getGameDirectory(), "/screenshots"); + if (!screenshotsDir.exists()) { + screenshotsDir.mkdir(); // Make sure that the screenshots directory + // is there, if not, create it + } + VoxelCamIO.updateScreenShotFilesList(""); + + // Register the Keys that VoxelCam uses + LiteLoader.getInput().registerKeyBinding(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER); + + // Add the configuation panel to VoxelCommons awareness + SettingsPanelManager.addSettingsPanel("Camera", GuiVoxelCamSettingsPanel.class); + } + + @Override + public void upgradeSettings(String version, File configPath, File oldConfigPath) { + } + + /** + * This method is called 20 times per second during the game + */ + @Override + public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock) { + // Tell the bigscreenshot taker that the next tick has happend + BigScreenshotTaker.onTick(); + // Check to see if the user wants to open the screenshot manager + if (isKeyDown(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode()) && !isKeyDown(Keyboard.KEY_F3)) { + if (!heldKeys.contains(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode())) { + if (minecraft.currentScreen instanceof GuiMainMenu || minecraft.currentScreen == null) { + if (!screenshotIsSaving) { + minecraft.displayGuiScreen(new GuiScreenShotManager()); + } else { ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); cmb.append(" " + I18n.format("savingpleasewait")); - cmb.showChatMessageIngame(); - } - } else if (minecraft.currentScreen instanceof GuiScreenShotManager) { - // Dont turn the screenshot manager off if the user is - // typing into the searchbar - if (!((GuiScreenShotManager) minecraft.currentScreen).searchBar.isFocused()) { - minecraft.setIngameFocus(); - } - } - heldKeys.add(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode()); - } - } else { - heldKeys.remove(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode()); - } - - - //Status Message - if (minecraft.inGameHasFocus && !minecraft.gameSettings.showDebugInfo) { - savingStatusMessage.setText(I18n.format("savingscreenshot") + " (" + ScreenshotTaker.getSavePercent() + "%) " + (ScreenshotTaker.isWritingToFile() ? I18n.format("writing") + "..." : "")); - savingStatusMessage.setVisible(screenshotIsSaving); - } - } - - /** - * Wrapper for the LWJGL functions to deal with mouse button bindings or - * invalid values - */ - public static boolean isKeyDown(int keyCode) { - try { - if (keyCode < 0) { // If the code is less than 0 it is probably the - // mouse - return Mouse.isButtonDown(keyCode + 100); - } - return Keyboard.isKeyDown(keyCode); - } catch (Exception ex) { - return false; - } - } - - /** - * Get the configuration - */ - public static VoxelCamConfig getConfig() { - return config; - } - - /** - * Get the minecraft screenshot directiory - */ - public static File getScreenshotsDir() { - return screenshotsDir; - } - - @Override - public void onRender() { - } - - /** - * Called immediately before the current GUI is rendered - * - * @param currentScreen - * Current screen (if any) - */ - @Override - public void onRenderGui(GuiScreen currentScreen) { - // If VoxelMenu does not exist modify the Main Menu with the PhotoButton - if (!voxelMenuExists && currentScreen != null) { - if (currentScreen instanceof GuiMainMenu && !(currentScreen instanceof GuiMainMenuWithPhotoButton)) { - Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenuWithPhotoButton()); - } - } - - // If this is the users first time running the mod show a welcome screen - if (currentScreen != null && config.getBoolProperty(VoxelCamConfig.FIRSTRUN) && !(currentScreen instanceof FirstRunPopup)) { - Minecraft.getMinecraft().displayGuiScreen(new FirstRunPopup(currentScreen)); - } - } - - @Override - public void onRenderWorld() { - } - - @Override - public void onSetupCameraTransform() { - } - - /** - * Tell Liteloader the class of the settings panel - */ - @Override - public Class getConfigPanelClass() { - return GuiVoxelCamSettingsPanel.class; - } - - public static void takeScreenshot(ReturnEventInfo returnEventInfo, File arg1, int arg2, int arg3, Framebuffer buffer) { - if (!(AbstractionLayer.getMinecraft().currentScreen instanceof ScreenshotIncapable)) { - if (isKeyDown(Keyboard.KEY_LSHIFT) || isKeyDown(Keyboard.KEY_RSHIFT)) { - BigScreenshotTaker.run(); - } else { - ScreenshotTaker.capture(buffer.framebufferWidth, buffer.framebufferHeight); - } - } - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("savingscreenshot")); - returnEventInfo.setReturnValue(cmb.getMessage()); - } - - @Override - public void onInitCompleted(Minecraft minecraft, LiteLoader loader) { - - // Look for VoxelMenu - try { - Class customMainMenuClass = (Class) Class.forName("com.thevoxelbox.voxelmenu.GuiMainMenuVoxelBox"); - Method mRegisterCustomScreen = customMainMenuClass.getDeclaredMethod("registerCustomScreen", String.class, Class.class, String.class); - mRegisterCustomScreen.invoke(null, "right", GuiScreenShotManager.class, I18n.format("screenshots")); - Class ingameGuiClass = (Class) Class.forName("com.thevoxelbox.voxelmenu.ingame.GuiIngameMenu"); - mRegisterCustomScreen = ingameGuiClass.getDeclaredMethod("registerCustomScreen", String.class, Class.class, String.class); - mRegisterCustomScreen.invoke(null, "", GuiScreenShotManager.class, I18n.format("screenshots")); - voxelMenuExists = true; - } catch (ClassNotFoundException ex) { // This means VoxelMenu does not - // exist - voxelMenuExists = false; - } catch (Exception e) { - e.printStackTrace(); - } - - savingStatusMessage = StatusMessageManager.getInstance().getStatusMessage("savingStatus", 1); - savingStatusMessage.setTitle("VoxelCam"); - } - - //Leave empty - @Override - public String getName() {return null;} - @Override - public String getVersion() {return null;} - -} + cmb.showChatMessageIngame(); + } + } else if (minecraft.currentScreen instanceof GuiScreenShotManager) { + // Dont turn the screenshot manager off if the user is + // typing into the searchbar + if (!((GuiScreenShotManager) minecraft.currentScreen).searchBar.isFocused()) { + minecraft.setIngameFocus(); + } + } + heldKeys.add(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode()); + } + } else { + heldKeys.remove(VoxelCamConfig.KEY_OPENSCREENSHOTMANAGER.getKeyCode()); + } + + + //Status Message + if (minecraft.inGameHasFocus && !minecraft.gameSettings.showDebugInfo) { + savingStatusMessage.setText(I18n.format("savingscreenshot") + " (" + ScreenshotTaker.getSavePercent() + "%) " + (ScreenshotTaker.isWritingToFile() ? I18n.format("writing") + "..." : "")); + savingStatusMessage.setVisible(screenshotIsSaving); + } + } + + /** + * Wrapper for the LWJGL functions to deal with mouse button bindings or + * invalid values + */ + public static boolean isKeyDown(int keyCode) { + try { + if (keyCode < 0) { // If the code is less than 0 it is probably the + // mouse + return Mouse.isButtonDown(keyCode + 100); + } + return Keyboard.isKeyDown(keyCode); + } catch (Exception ex) { + return false; + } + } + + /** + * Get the configuration + */ + public static VoxelCamConfig getConfig() { + return config; + } + + /** + * Get the minecraft screenshot directiory + */ + public static File getScreenshotsDir() { + return screenshotsDir; + } + + @Override + public void onRender() { + } + + /** + * Called immediately before the current GUI is rendered + * + * @param currentScreen + * Current screen (if any) + */ + @Override + public void onRenderGui(GuiScreen currentScreen) { + // If VoxelMenu does not exist modify the Main Menu with the PhotoButton + if (!voxelMenuExists && currentScreen != null) { + if (currentScreen instanceof GuiMainMenu && !(currentScreen instanceof GuiMainMenuWithPhotoButton)) { + Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenuWithPhotoButton()); + } + } + + // If this is the users first time running the mod show a welcome screen + if (currentScreen != null && config.getBoolProperty(VoxelCamConfig.FIRSTRUN) && !(currentScreen instanceof FirstRunPopup)) { + Minecraft.getMinecraft().displayGuiScreen(new FirstRunPopup(currentScreen)); + } + } + + @Override + public void onRenderWorld() { + } + + @Override + public void onSetupCameraTransform() { + } + + /** + * Tell Liteloader the class of the settings panel + */ + @Override + public Class getConfigPanelClass() { + return GuiVoxelCamSettingsPanel.class; + } + + public static void takeScreenshot(ReturnEventInfo returnEventInfo, File arg1, int arg2, int arg3, Framebuffer buffer) { + if (!(AbstractionLayer.getMinecraft().currentScreen instanceof ScreenshotIncapable)) { + if (isKeyDown(Keyboard.KEY_LSHIFT) || isKeyDown(Keyboard.KEY_RSHIFT)) { + BigScreenshotTaker.run(); + } else { + ScreenshotTaker.capture(buffer.framebufferWidth, buffer.framebufferHeight); + } + } + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("savingscreenshot")); + returnEventInfo.setReturnValue(cmb.getMessage()); + } + + @Override + public void onInitCompleted(Minecraft minecraft, LiteLoader loader) { + + // Look for VoxelMenu + try { + Class customMainMenuClass = (Class) Class.forName("com.thevoxelbox.voxelmenu.GuiMainMenuVoxelBox"); + Method mRegisterCustomScreen = customMainMenuClass.getDeclaredMethod("registerCustomScreen", String.class, Class.class, String.class); + mRegisterCustomScreen.invoke(null, "right", GuiScreenShotManager.class, I18n.format("screenshots")); + Class ingameGuiClass = (Class) Class.forName("com.thevoxelbox.voxelmenu.ingame.GuiIngameMenu"); + mRegisterCustomScreen = ingameGuiClass.getDeclaredMethod("registerCustomScreen", String.class, Class.class, String.class); + mRegisterCustomScreen.invoke(null, "", GuiScreenShotManager.class, I18n.format("screenshots")); + voxelMenuExists = true; + } catch (ClassNotFoundException ex) { // This means VoxelMenu does not + // exist + voxelMenuExists = false; + } catch (Exception e) { + e.printStackTrace(); + } + + savingStatusMessage = StatusMessageManager.getInstance().getStatusMessage("savingStatus", 1); + savingStatusMessage.setTitle("VoxelCam"); + } + + //Leave empty + @Override + public String getName() {return null;} + @Override + public String getVersion() {return null;} + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java b/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java similarity index 98% rename from VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java rename to src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java index 93bdc2a..4d6b0f3 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java @@ -1,39 +1,39 @@ -package com.thatapplefreak.voxelcam; - -import java.io.File; -import java.lang.annotation.Annotation; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.util.ScreenShotHelper; - -import com.mumfrey.liteloader.ChatRenderListener; -import com.mumfrey.liteloader.core.runtime.Obf; -import com.mumfrey.liteloader.transformers.Callback; -import com.mumfrey.liteloader.transformers.Obfuscated; -import com.mumfrey.liteloader.transformers.Callback.CallbackType; -import com.mumfrey.liteloader.transformers.CallbackInjectionTransformer; -import com.mumfrey.liteloader.transformers.event.Event; -import com.mumfrey.liteloader.transformers.event.EventInjectionTransformer; -import com.mumfrey.liteloader.transformers.event.MethodInfo; -import com.mumfrey.liteloader.transformers.event.inject.BeforeInvoke; -import com.mumfrey.liteloader.transformers.event.inject.MethodHead; - -public class VoxelCamTransformer extends EventInjectionTransformer { - private static final String coreClassName = "com.thatapplefreak.voxelcam.VoxelCamCore"; - private static final String voxelCamScreenshotMethod = "takeScreenshot"; - - private static final Obf classChatComponent = new Obf("net.minecraft.util.IChatComponent", "fj") {}; - private static final Obf classFrameBuffer = new Obf("net.minecraft.client.shader.Framebuffer","bmg") {}; - private static final Obf classScreenShotHelper = new Obf("net.minecraft.util.ScreenShotHelper", "bbp") {}; - private static final Obf methodSaveScreenshot = new Obf("func_148260_a", "a", "saveScreenshot") {}; - - @Override - protected void addEvents() { - Event onTakeScreenshot = Event.getOrCreate("onTakeScreenshot", true); - MethodInfo target = new MethodInfo(classScreenShotHelper, methodSaveScreenshot, classChatComponent, File.class, Integer.TYPE, Integer.TYPE, classFrameBuffer); - MethodInfo callback = new MethodInfo(coreClassName, voxelCamScreenshotMethod); - - this.addEvent(onTakeScreenshot, target, new MethodHead()).addListener(callback); - } +package com.thatapplefreak.voxelcam; + +import java.io.File; +import java.lang.annotation.Annotation; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.util.ScreenShotHelper; + +import com.mumfrey.liteloader.ChatRenderListener; +import com.mumfrey.liteloader.core.runtime.Obf; +import com.mumfrey.liteloader.transformers.Callback; +import com.mumfrey.liteloader.transformers.Obfuscated; +import com.mumfrey.liteloader.transformers.Callback.CallbackType; +import com.mumfrey.liteloader.transformers.CallbackInjectionTransformer; +import com.mumfrey.liteloader.transformers.event.Event; +import com.mumfrey.liteloader.transformers.event.EventInjectionTransformer; +import com.mumfrey.liteloader.transformers.event.MethodInfo; +import com.mumfrey.liteloader.transformers.event.inject.BeforeInvoke; +import com.mumfrey.liteloader.transformers.event.inject.MethodHead; + +public class VoxelCamTransformer extends EventInjectionTransformer { + private static final String coreClassName = "com.thatapplefreak.voxelcam.VoxelCamCore"; + private static final String voxelCamScreenshotMethod = "takeScreenshot"; + + private static final Obf classChatComponent = new Obf("net.minecraft.util.IChatComponent", "fj") {}; + private static final Obf classFrameBuffer = new Obf("net.minecraft.client.shader.Framebuffer","bmg") {}; + private static final Obf classScreenShotHelper = new Obf("net.minecraft.util.ScreenShotHelper", "bbp") {}; + private static final Obf methodSaveScreenshot = new Obf("func_148260_a", "a", "saveScreenshot") {}; + + @Override + protected void addEvents() { + Event onTakeScreenshot = Event.getOrCreate("onTakeScreenshot", true); + MethodInfo target = new MethodInfo(classScreenShotHelper, methodSaveScreenshot, classChatComponent, File.class, Integer.TYPE, Integer.TYPE, classFrameBuffer); + MethodInfo callback = new MethodInfo(coreClassName, voxelCamScreenshotMethod); + + this.addEvent(onTakeScreenshot, target, new MethodHead()).addListener(callback); + } } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java b/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java rename to src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java index 296a94d..0c515a1 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java +++ b/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java @@ -1,78 +1,78 @@ -package com.thatapplefreak.voxelcam.gui.editor; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; - -import javax.imageio.ImageIO; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thevoxelbox.common.util.gui.AdvancedDrawGui; - -public class GuiEditScreenshot extends AdvancedDrawGui { - - private GuiScreen parentScreen; - - private GuiButton btnDone; - - /** - * File refrence of the Screenshot - */ - private final File screenshotFile; - - /** - * This is the raw data for the Screenshot before undergoing changes - */ - private BufferedImage uneditedScreenshot; - - /** - * This is the image created by adding the users edits - */ - private BufferedImage editedScreenshot; - - private boolean loading = true; - - public GuiEditScreenshot(GuiScreen parent, final File screenshot) { - this.parentScreen = parent; - this.screenshotFile = screenshot; - } - - @Override - public void initGui() { - new Thread("Editor Loading Thread") { - @Override - public void run() { - try { - uneditedScreenshot = ImageIO.read(screenshotFile); - loading = false; - } catch (IOException e) { - e.printStackTrace(); - } - }; - }.start(); - - buttonList.add(btnDone = new GuiButton(0, 10, height - 30, 70, 20, I18n.format("done"))); - } - - @Override - public void drawScreen(int par1, int par2, float par3) { - drawDefaultBackground(); - if (loading) { - drawCenteredString(fontRendererObj, I18n.format("loading") + "...", width / 2, height / 2, 0xffffff); - return; - } - - super.drawScreen(par1, par2, par3); - } - - @Override - protected void actionPerformed(GuiButton guibtn) { - if (guibtn == btnDone) { - Minecraft.getMinecraft().displayGuiScreen(parentScreen); - } - } -} +package com.thatapplefreak.voxelcam.gui.editor; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thevoxelbox.common.util.gui.AdvancedDrawGui; + +public class GuiEditScreenshot extends AdvancedDrawGui { + + private GuiScreen parentScreen; + + private GuiButton btnDone; + + /** + * File refrence of the Screenshot + */ + private final File screenshotFile; + + /** + * This is the raw data for the Screenshot before undergoing changes + */ + private BufferedImage uneditedScreenshot; + + /** + * This is the image created by adding the users edits + */ + private BufferedImage editedScreenshot; + + private boolean loading = true; + + public GuiEditScreenshot(GuiScreen parent, final File screenshot) { + this.parentScreen = parent; + this.screenshotFile = screenshot; + } + + @Override + public void initGui() { + new Thread("Editor Loading Thread") { + @Override + public void run() { + try { + uneditedScreenshot = ImageIO.read(screenshotFile); + loading = false; + } catch (IOException e) { + e.printStackTrace(); + } + }; + }.start(); + + buttonList.add(btnDone = new GuiButton(0, 10, height - 30, 70, 20, I18n.format("done"))); + } + + @Override + public void drawScreen(int par1, int par2, float par3) { + drawDefaultBackground(); + if (loading) { + drawCenteredString(fontRendererObj, I18n.format("loading") + "...", width / 2, height / 2, 0xffffff); + return; + } + + super.drawScreen(par1, par2, par3); + } + + @Override + protected void actionPerformed(GuiButton guibtn) { + if (guibtn == btnDone) { + Minecraft.getMinecraft().displayGuiScreen(parentScreen); + } + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java b/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java rename to src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java index b4b55b4..67afd65 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java +++ b/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java @@ -1,70 +1,70 @@ -package com.thatapplefreak.voxelcam.gui.mainmenu; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; -import net.minecraft.util.ResourceLocation; - -import com.mumfrey.liteloader.core.LiteLoader; -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thevoxelbox.common.util.BrowserOpener; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class FirstRunPopup extends GuiDialogBox { - - private static final ResourceLocation avatarPNG = new ResourceLocation("voxelcam", "textures/avatar.png"); - - private GuiButton forumLink; - - public FirstRunPopup(GuiScreen parentScreen) { - super(parentScreen, 320, 150, "VoxelCam"); - } - - @Override - protected void onInitDialog() { - btnCancel.visible = false; - btnOk.displayString = I18n.format("ok"); - forumLink = new GuiButton(-111195, btnCancel.xPosition, btnCancel.yPosition, 60, 20, I18n.format("moreinfo")); - buttonList.add(forumLink); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - try { - drawString(fontRendererObj, I18n.format("welcomeline1") + " " + LiteLoader.getInstance().getMod("VoxelCam").getVersion() + " ", dialogX + 5, dialogY + 5, 0xFFFFFF); - } catch (Exception e) { - } - drawString(fontRendererObj, I18n.format("keybindings") + ":", dialogX + 5, dialogY + 20, 0x990000); - drawString(fontRendererObj, "H - " + I18n.format("welcomeline2"), dialogX + 10, dialogY + 30, 0x990000); - drawString(fontRendererObj, "Shift + F2 - " + I18n.format("welcomeline3"), dialogX + 10, dialogY + 40, 0x990000); - drawString(fontRendererObj, "F7 - " + I18n.format("welcomeline4"), dialogX + 10, dialogY + 50, 0x990000); - - drawString(fontRendererObj, I18n.format("developer") + ":", dialogX + 5, dialogY + 70, 0x00FFFF); - drawTexturedModalRect(avatarPNG, dialogX + 10, dialogY + 80, dialogX + 75, dialogY + 140, 0, 0, 259, 256); - drawString(fontRendererObj, "thatapplefreak", dialogX + 6, dialogY + 141, 0xFFFF00); - - drawString(fontRendererObj, "Twitter: @xApplefreak", dialogX + 80, dialogY + 80, 0x4099FF); - drawString(fontRendererObj, "Reddit: thatapplefreak", dialogX + 80, dialogY + 90, 0xff4500); - drawString(fontRendererObj, "MinecraftForum: thatapplefreak", dialogX + 80, dialogY + 100, 0x80ba59); - } - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.equals(forumLink)) { - BrowserOpener.openURLstringInBrowser("http://bit.ly/16LXtjV"); - } - super.actionPerformed(guibutton); - } - - @Override - public void onSubmit() { - VoxelCamCore.getConfig().setProperty(VoxelCamConfig.FIRSTRUN, false); - } - - @Override - public boolean validateDialog() { - return true; - } - -} +package com.thatapplefreak.voxelcam.gui.mainmenu; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; + +import com.mumfrey.liteloader.core.LiteLoader; +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thevoxelbox.common.util.BrowserOpener; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class FirstRunPopup extends GuiDialogBox { + + private static final ResourceLocation avatarPNG = new ResourceLocation("voxelcam", "textures/avatar.png"); + + private GuiButton forumLink; + + public FirstRunPopup(GuiScreen parentScreen) { + super(parentScreen, 320, 150, "VoxelCam"); + } + + @Override + protected void onInitDialog() { + btnCancel.visible = false; + btnOk.displayString = I18n.format("ok"); + forumLink = new GuiButton(-111195, btnCancel.xPosition, btnCancel.yPosition, 60, 20, I18n.format("moreinfo")); + buttonList.add(forumLink); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + try { + drawString(fontRendererObj, I18n.format("welcomeline1") + " " + LiteLoader.getInstance().getMod("VoxelCam").getVersion() + " ", dialogX + 5, dialogY + 5, 0xFFFFFF); + } catch (Exception e) { + } + drawString(fontRendererObj, I18n.format("keybindings") + ":", dialogX + 5, dialogY + 20, 0x990000); + drawString(fontRendererObj, "H - " + I18n.format("welcomeline2"), dialogX + 10, dialogY + 30, 0x990000); + drawString(fontRendererObj, "Shift + F2 - " + I18n.format("welcomeline3"), dialogX + 10, dialogY + 40, 0x990000); + drawString(fontRendererObj, "F7 - " + I18n.format("welcomeline4"), dialogX + 10, dialogY + 50, 0x990000); + + drawString(fontRendererObj, I18n.format("developer") + ":", dialogX + 5, dialogY + 70, 0x00FFFF); + drawTexturedModalRect(avatarPNG, dialogX + 10, dialogY + 80, dialogX + 75, dialogY + 140, 0, 0, 259, 256); + drawString(fontRendererObj, "thatapplefreak", dialogX + 6, dialogY + 141, 0xFFFF00); + + drawString(fontRendererObj, "Twitter: @xApplefreak", dialogX + 80, dialogY + 80, 0x4099FF); + drawString(fontRendererObj, "Reddit: thatapplefreak", dialogX + 80, dialogY + 90, 0xff4500); + drawString(fontRendererObj, "MinecraftForum: thatapplefreak", dialogX + 80, dialogY + 100, 0x80ba59); + } + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.equals(forumLink)) { + BrowserOpener.openURLstringInBrowser("http://bit.ly/16LXtjV"); + } + super.actionPerformed(guibutton); + } + + @Override + public void onSubmit() { + VoxelCamCore.getConfig().setProperty(VoxelCamConfig.FIRSTRUN, false); + } + + @Override + public boolean validateDialog() { + return true; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java b/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java rename to src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java index 3d844e7..7fc2e70 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java +++ b/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java @@ -1,32 +1,32 @@ -package com.thatapplefreak.voxelcam.gui.mainmenu; - -import org.lwjgl.opengl.GL11; - -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.gui.AdvancedDrawGui; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiMainMenu; -import net.minecraft.util.ResourceLocation; - -public class GuiMainMenuWithPhotoButton extends GuiMainMenu { - - private PhotoButton photoBtn; - - @Override - public void initGui() { - super.initGui(); - this.photoBtn = new PhotoButton(width / 2 + 104, this.height / 4 + 132); - buttonList.add(photoBtn); - } - - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - super.actionPerformed(par1GuiButton); - if (par1GuiButton.equals(photoBtn)) { - mc.displayGuiScreen(new GuiScreenShotManager()); - } - } - +package com.thatapplefreak.voxelcam.gui.mainmenu; + +import org.lwjgl.opengl.GL11; + +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thevoxelbox.common.util.AbstractionLayer; +import com.thevoxelbox.common.util.gui.AdvancedDrawGui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.util.ResourceLocation; + +public class GuiMainMenuWithPhotoButton extends GuiMainMenu { + + private PhotoButton photoBtn; + + @Override + public void initGui() { + super.initGui(); + this.photoBtn = new PhotoButton(width / 2 + 104, this.height / 4 + 132); + buttonList.add(photoBtn); + } + + @Override + protected void actionPerformed(GuiButton par1GuiButton) { + super.actionPerformed(par1GuiButton); + if (par1GuiButton.equals(photoBtn)) { + mc.displayGuiScreen(new GuiScreenShotManager()); + } + } + } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java b/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java rename to src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java index 8805f51..a7a640e 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java +++ b/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java @@ -1,27 +1,27 @@ -package com.thatapplefreak.voxelcam.gui.mainmenu; - -import org.lwjgl.opengl.GL11; - -import com.thevoxelbox.common.util.AbstractionLayer; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; - -public class PhotoButton extends GuiButton { - - static ResourceLocation photoBtnPic = new ResourceLocation("voxelcam", "textures/photo.png"); - - public PhotoButton(int xPos, int yPos) { - super(111195, xPos, yPos, 20, 20, ""); - - } - - @Override - public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { - super.drawButton(p_146112_1_, p_146112_2_, p_146112_3_); - AbstractionLayer.bindTexture(photoBtnPic); - GL11.glColor4f(1, 1, 1, 1); - drawTexturedModalRect(this.xPosition + 2, this.yPosition + 1, 0, 0, this.width, this.height); - } +package com.thatapplefreak.voxelcam.gui.mainmenu; + +import org.lwjgl.opengl.GL11; + +import com.thevoxelbox.common.util.AbstractionLayer; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; + +public class PhotoButton extends GuiButton { + + static ResourceLocation photoBtnPic = new ResourceLocation("voxelcam", "textures/photo.png"); + + public PhotoButton(int xPos, int yPos) { + super(111195, xPos, yPos, 20, 20, ""); + + } + + @Override + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { + super.drawButton(p_146112_1_, p_146112_2_, p_146112_3_); + AbstractionLayer.bindTexture(photoBtnPic); + GL11.glColor4f(1, 1, 1, 1); + drawTexturedModalRect(this.xPosition + 2, this.yPosition + 1, 0, 0, this.width, this.height); + } } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java b/src/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java rename to src/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java index 6b500af..1c2835e 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/DeletePopup.java @@ -1,48 +1,48 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class DeletePopup extends GuiDialogBox implements ScreenshotIncapable { - - public DeletePopup(GuiScreen parentScreen) { - super(parentScreen, 200, 75, I18n.format("delete")); - } - - @Override - public void onSubmit() { - VoxelCamIO.delete(); - } - - @Override - protected void onInitDialog() { - this.btnOk.displayString = I18n.format("yes"); - this.btnCancel.displayString = I18n.format("no"); - - } - - @Override - protected void onKeyTyped(char keyChar, int keyCode) { - if (keyChar == 'y') { - actionPerformed(btnOk); - } else if (keyChar == 'n') { - actionPerformed(btnCancel); - } - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - drawCenteredString(fontRendererObj, I18n.format("areyousure") + "?", width / 2, height / 2 - 12, 0xffffff); - } - -} +package com.thatapplefreak.voxelcam.gui.manager; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class DeletePopup extends GuiDialogBox implements ScreenshotIncapable { + + public DeletePopup(GuiScreen parentScreen) { + super(parentScreen, 200, 75, I18n.format("delete")); + } + + @Override + public void onSubmit() { + VoxelCamIO.delete(); + } + + @Override + protected void onInitDialog() { + this.btnOk.displayString = I18n.format("yes"); + this.btnCancel.displayString = I18n.format("no"); + + } + + @Override + protected void onKeyTyped(char keyChar, int keyCode) { + if (keyChar == 'y') { + actionPerformed(btnOk); + } else if (keyChar == 'n') { + actionPerformed(btnCancel); + } + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + drawCenteredString(fontRendererObj, I18n.format("areyousure") + "?", width / 2, height / 2 - 12, 0xffffff); + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java b/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java rename to src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java index 2786b33..9bb3af9 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java @@ -1,192 +1,192 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import java.awt.Desktop; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; - -import javax.imageio.ImageIO; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import org.lwjgl.input.Keyboard; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.gui.editor.GuiEditScreenshot; -import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; -import com.thatapplefreak.voxelcam.imagehandle.ImageDrawer; -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.imagehandle.metadata.MetaDataHandler; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; - -/** - * This Gui shows the player the screenshots he/she has taken and can - * rename/delete/post to imgur,facebook,twitter - * - * @author thatapplefreak - * - */ -public class GuiScreenShotManager extends GuiScreen implements ScreenshotIncapable { - - /** - * Frame for the currently displaying picture - */ - private ScalePhotoFrame frame; - - /** - * Selector for the user to pic the photo they want to view - */ - private PhotoSelector selector; - - /** - * Button to go to previous screen - */ - private GuiButton btnBack, btnRename, btnDelete, btnPost, btnOpenFolder, btnEditPicture; - - public SearchBar searchBar; - - private static final float frameScale = 22F / 30F; - - public GuiScreenShotManager() { - frame = new ScalePhotoFrame(this, (int) (width - (width * (frameScale))), 10, frameScale, VoxelCamIO.getSelectedPhoto()); - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() { - - searchBar = new SearchBar(fontRendererObj, 11, 14, 50, 13); - - selector = new PhotoSelector(this, 125); - selector.registerScrollButtons(buttonList, 7, 8); - - - btnBack = new GuiButton(0, 10, height - 30, 70, 20, I18n.format("back")); - buttonList.add(btnBack); - - btnRename = new GuiButton(1, width - (70 * 3) - 5, height - 45, 70, 20, I18n.format("rename")); - buttonList.add(btnRename); - - btnDelete = new GuiButton(2, width - (70 * 2) - 5, height - 45, 70, 20, I18n.format("delete")); - buttonList.add(btnDelete); - - btnEditPicture = new GuiButton(3, width - (70 * 1) - 5, height - 45, 70, 20, I18n.format("edit")); - buttonList.add(btnEditPicture); - btnEditPicture.enabled = false; - - btnOpenFolder = new GuiButton(4, width - (70 * 3) - 5, height - 25, 140, 20, I18n.format("openscreenshotsfolder")); - buttonList.add(btnOpenFolder); - - btnPost = new GuiButton(5, width - (70 * 1) - 5, height - 25, 70, 20, I18n.format("postto") + "..."); - buttonList.add(btnPost); - - } - - @Override - public void drawScreen(int xPos, int yPos, float partialTicks) { - if (!mc.isSingleplayer()) { - drawDefaultBackground(); - } else { - drawBackground(0); - } - - super.drawScreen(xPos, yPos, partialTicks); - frame.draw(xPos, yPos, partialTicks); - selector.drawScreen(xPos, yPos, partialTicks); - searchBar.drawTextBox(); - } - - @Override - public void updateScreen() { - super.updateScreen(); - VoxelCamIO.updateScreenShotFilesList(searchBar.getText()); - if (frame.getPhoto() != VoxelCamIO.getSelectedPhoto()) { - if (VoxelCamIO.getSelectedPhoto() == null) { - frame.setPhoto(null); - } else if (frame.getPhoto() == null && VoxelCamIO.getSelectedPhoto() != null) { - frame.setPhoto(VoxelCamIO.getSelectedPhoto()); - } else if (!frame.getPhoto().equals(VoxelCamIO.getSelectedPhoto())) { - frame.setPhoto(VoxelCamIO.getSelectedPhoto()); - } - } - frame.update((int) (btnPost.xPosition + 70 - (width * frameScale)), 13); - selector.setDimensionsAndPosition(10, 28, frame.x, frame.y + frame.height); - searchBar.setWidth(selector.right - selector.left - 2); - } - - @Override - protected void actionPerformed(GuiButton btn) { - if (btn.equals(btnBack)) { - keyTyped('`', 1); - } else if (btn.equals(btnRename)) { - mc.displayGuiScreen(new RenamePopup(this, VoxelCamIO.getSelectedPhoto().getName())); - } else if (btn.equals(btnDelete)) { - mc.displayGuiScreen(new DeletePopup(this)); - } else if (btn.equals(btnEditPicture)) { - mc.displayGuiScreen(new GuiEditScreenshot(this, VoxelCamIO.getSelectedPhoto())); - } else if (btn.equals(btnOpenFolder)) { - try { - Desktop.getDesktop().browse(VoxelCamCore.getScreenshotsDir().toURI()); - } catch (IOException e) { - e.printStackTrace(); - } - } else if (btn.equals(btnPost)) { - mc.displayGuiScreen(new PostPopup(this)); - } - } - - public void enableButtons(boolean b) { - if (b) { - btnRename.enabled = true; - btnDelete.enabled = true; - btnEditPicture.enabled = true; - btnPost.enabled = true; - } else { - btnRename.enabled = false; - btnDelete.enabled = false; - btnEditPicture.enabled = false; - btnPost.enabled = false; - } - btnBack.enabled = true; - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int button) { - super.mouseClicked(mouseX, mouseY, button); - searchBar.mouseClicked(mouseX, mouseY, button); - } - - @Override - protected void keyTyped(char keyChar, int keyCode) { - if (keyCode == 1) { - GLImageMemoryHandler.requestImageFlush(); - this.mc.displayGuiScreen((GuiScreen) null); - this.mc.setIngameFocus(); - } - searchBar.textboxKeyTyped(keyChar, keyCode); - if (!searchBar.isFocused() && btnDelete.enabled) { - if (keyChar == 'r') { - actionPerformed(btnRename); - } else if (keyChar == 'd') { - actionPerformed(btnDelete); - } else if (keyChar == 'p') { - actionPerformed(btnPost); - } else if (keyCode == Keyboard.KEY_UP || keyCode == Keyboard.KEY_W) { - if (VoxelCamIO.selected > 0) { - VoxelCamIO.selected--; - } - } else if (keyCode == Keyboard.KEY_DOWN || keyCode == Keyboard.KEY_S) { - if (VoxelCamIO.selected < VoxelCamIO.getScreenShotFiles().size() - 1) { - VoxelCamIO.selected++; - } - } - } - } - -} +package com.thatapplefreak.voxelcam.gui.manager; + +import java.awt.Desktop; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; + +import javax.imageio.ImageIO; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import org.lwjgl.input.Keyboard; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.gui.editor.GuiEditScreenshot; +import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; +import com.thatapplefreak.voxelcam.imagehandle.ImageDrawer; +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.imagehandle.metadata.MetaDataHandler; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; + +/** + * This Gui shows the player the screenshots he/she has taken and can + * rename/delete/post to imgur,facebook,twitter + * + * @author thatapplefreak + * + */ +public class GuiScreenShotManager extends GuiScreen implements ScreenshotIncapable { + + /** + * Frame for the currently displaying picture + */ + private ScalePhotoFrame frame; + + /** + * Selector for the user to pic the photo they want to view + */ + private PhotoSelector selector; + + /** + * Button to go to previous screen + */ + private GuiButton btnBack, btnRename, btnDelete, btnPost, btnOpenFolder, btnEditPicture; + + public SearchBar searchBar; + + private static final float frameScale = 22F / 30F; + + public GuiScreenShotManager() { + frame = new ScalePhotoFrame(this, (int) (width - (width * (frameScale))), 10, frameScale, VoxelCamIO.getSelectedPhoto()); + } + + @SuppressWarnings("unchecked") + @Override + public void initGui() { + + searchBar = new SearchBar(fontRendererObj, 11, 14, 50, 13); + + selector = new PhotoSelector(this, 125); + selector.registerScrollButtons(buttonList, 7, 8); + + + btnBack = new GuiButton(0, 10, height - 30, 70, 20, I18n.format("back")); + buttonList.add(btnBack); + + btnRename = new GuiButton(1, width - (70 * 3) - 5, height - 45, 70, 20, I18n.format("rename")); + buttonList.add(btnRename); + + btnDelete = new GuiButton(2, width - (70 * 2) - 5, height - 45, 70, 20, I18n.format("delete")); + buttonList.add(btnDelete); + + btnEditPicture = new GuiButton(3, width - (70 * 1) - 5, height - 45, 70, 20, I18n.format("edit")); + buttonList.add(btnEditPicture); + btnEditPicture.enabled = false; + + btnOpenFolder = new GuiButton(4, width - (70 * 3) - 5, height - 25, 140, 20, I18n.format("openscreenshotsfolder")); + buttonList.add(btnOpenFolder); + + btnPost = new GuiButton(5, width - (70 * 1) - 5, height - 25, 70, 20, I18n.format("postto") + "..."); + buttonList.add(btnPost); + + } + + @Override + public void drawScreen(int xPos, int yPos, float partialTicks) { + if (!mc.isSingleplayer()) { + drawDefaultBackground(); + } else { + drawBackground(0); + } + + super.drawScreen(xPos, yPos, partialTicks); + frame.draw(xPos, yPos, partialTicks); + selector.drawScreen(xPos, yPos, partialTicks); + searchBar.drawTextBox(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + VoxelCamIO.updateScreenShotFilesList(searchBar.getText()); + if (frame.getPhoto() != VoxelCamIO.getSelectedPhoto()) { + if (VoxelCamIO.getSelectedPhoto() == null) { + frame.setPhoto(null); + } else if (frame.getPhoto() == null && VoxelCamIO.getSelectedPhoto() != null) { + frame.setPhoto(VoxelCamIO.getSelectedPhoto()); + } else if (!frame.getPhoto().equals(VoxelCamIO.getSelectedPhoto())) { + frame.setPhoto(VoxelCamIO.getSelectedPhoto()); + } + } + frame.update((int) (btnPost.xPosition + 70 - (width * frameScale)), 13); + selector.setDimensionsAndPosition(10, 28, frame.x, frame.y + frame.height); + searchBar.setWidth(selector.right - selector.left - 2); + } + + @Override + protected void actionPerformed(GuiButton btn) { + if (btn.equals(btnBack)) { + keyTyped('`', 1); + } else if (btn.equals(btnRename)) { + mc.displayGuiScreen(new RenamePopup(this, VoxelCamIO.getSelectedPhoto().getName())); + } else if (btn.equals(btnDelete)) { + mc.displayGuiScreen(new DeletePopup(this)); + } else if (btn.equals(btnEditPicture)) { + mc.displayGuiScreen(new GuiEditScreenshot(this, VoxelCamIO.getSelectedPhoto())); + } else if (btn.equals(btnOpenFolder)) { + try { + Desktop.getDesktop().browse(VoxelCamCore.getScreenshotsDir().toURI()); + } catch (IOException e) { + e.printStackTrace(); + } + } else if (btn.equals(btnPost)) { + mc.displayGuiScreen(new PostPopup(this)); + } + } + + public void enableButtons(boolean b) { + if (b) { + btnRename.enabled = true; + btnDelete.enabled = true; + btnEditPicture.enabled = true; + btnPost.enabled = true; + } else { + btnRename.enabled = false; + btnDelete.enabled = false; + btnEditPicture.enabled = false; + btnPost.enabled = false; + } + btnBack.enabled = true; + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int button) { + super.mouseClicked(mouseX, mouseY, button); + searchBar.mouseClicked(mouseX, mouseY, button); + } + + @Override + protected void keyTyped(char keyChar, int keyCode) { + if (keyCode == 1) { + GLImageMemoryHandler.requestImageFlush(); + this.mc.displayGuiScreen((GuiScreen) null); + this.mc.setIngameFocus(); + } + searchBar.textboxKeyTyped(keyChar, keyCode); + if (!searchBar.isFocused() && btnDelete.enabled) { + if (keyChar == 'r') { + actionPerformed(btnRename); + } else if (keyChar == 'd') { + actionPerformed(btnDelete); + } else if (keyChar == 'p') { + actionPerformed(btnPost); + } else if (keyCode == Keyboard.KEY_UP || keyCode == Keyboard.KEY_W) { + if (VoxelCamIO.selected > 0) { + VoxelCamIO.selected--; + } + } else if (keyCode == Keyboard.KEY_DOWN || keyCode == Keyboard.KEY_S) { + if (VoxelCamIO.selected < VoxelCamIO.getScreenShotFiles().size() - 1) { + VoxelCamIO.selected++; + } + } + } + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java b/src/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java rename to src/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java index 6f37751..aba950f 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/GuiTextSlot.java @@ -1,393 +1,393 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import static org.lwjgl.opengl.GL11.*; - -import java.nio.DoubleBuffer; -import java.util.List; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.BufferUtils; -import org.lwjgl.input.Mouse; - - -@SuppressWarnings({ "rawtypes", "cast" }) -public abstract class GuiTextSlot { - protected int listWidth; - protected int listHeight; - protected int top; - protected int bottom; - protected int right; - protected int left; - protected int slotHeight; - protected int scrollUpActionId; - protected int scrollDownActionId; - protected int mouseX; - protected int mouseY; - protected float initialMouseClickY = -2.0F; - protected float scrollFactor; - protected float scrollDistance; - protected int selectedIndex = -1; - protected long lastClickTime = 0L; - protected boolean field_25123_p = true; - protected boolean field_27262_q; - protected int field_27261_r; - protected DoubleBuffer doubleBuffer; - - public GuiTextSlot(int width, int height, int top, int bottom, int left, int entryHeight) { - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) - - { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - protected void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this.getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - this.enableClipping(this.top, this.bottom); - - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - Tessellator var18 = Tessellator.instance; - // glBindTexture(GL_TEXTURE_2D, - // this.client.renderEngine.getTexture("/gui/background.png")); - glEnable(GL_BLEND); - glDisable(GL_TEXTURE_2D); - glColor4f(0.0F, 0.0F, 0.0F, 0.5F); - float var17 = 32.0F; - var18.startDrawingQuads(); - // var18.setColorOpaque_I(2105376); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - glDisable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - glDisable(GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - glEnable(GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - glDisable(GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_ALPHA_TEST); - glShadeModel(GL_SMOOTH); - glDisable(GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - glEnable(GL_TEXTURE_2D); - glShadeModel(GL_FLAT); - glEnable(GL_ALPHA_TEST); - glDisable(GL_BLEND); - - this.disableClipping(); - } - - // protected void overlayBackground(int p_22239_1_, int p_22239_2_, int - // p_22239_3_, int p_22239_4_) - // { - // Tessellator var5 = Tessellator.instance; - // glBindTexture(GL_TEXTURE_2D, - // this.client.renderEngine.getTexture("/gui/background.png")); - // glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // float var6 = 32.0F; - // var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, p_22239_4_); - // var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, - // (double)((float)p_22239_2_ / var6)); - // var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, - // 0.0D, (double)((float)(this.listWidth + 30) / var6), - // (double)((float)p_22239_2_ / var6)); - // var5.setColorRGBA_I(4210752, p_22239_3_); - // var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, - // 0.0D, (double)((float)(this.listWidth + 30) / var6), - // (double)((float)p_22239_1_ / var6)); - // var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, - // (double)((float)p_22239_1_ / var6)); - // var5.draw(); - // } - - protected final void enableClipping(int yTop, int yBottom) { - if (doubleBuffer == null) { - doubleBuffer = BufferUtils.createByteBuffer(32).asDoubleBuffer(); - } - - doubleBuffer.clear(); - doubleBuffer.put(0).put(1).put(0).put(-yTop).flip(); - glClipPlane(GL_CLIP_PLANE0, doubleBuffer); - - doubleBuffer.clear(); - doubleBuffer.put(0).put(-1).put(0).put(yBottom).flip(); - glClipPlane(GL_CLIP_PLANE1, doubleBuffer); - - glEnable(GL_CLIP_PLANE0); - glEnable(GL_CLIP_PLANE1); - } - - protected final void disableClipping() { - glDisable(GL_CLIP_PLANE1); - glDisable(GL_CLIP_PLANE0); - } -} +package com.thatapplefreak.voxelcam.gui.manager; + +import static org.lwjgl.opengl.GL11.*; + +import java.nio.DoubleBuffer; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.Tessellator; + +import org.lwjgl.BufferUtils; +import org.lwjgl.input.Mouse; + + +@SuppressWarnings({ "rawtypes", "cast" }) +public abstract class GuiTextSlot { + protected int listWidth; + protected int listHeight; + protected int top; + protected int bottom; + protected int right; + protected int left; + protected int slotHeight; + protected int scrollUpActionId; + protected int scrollDownActionId; + protected int mouseX; + protected int mouseY; + protected float initialMouseClickY = -2.0F; + protected float scrollFactor; + protected float scrollDistance; + protected int selectedIndex = -1; + protected long lastClickTime = 0L; + protected boolean field_25123_p = true; + protected boolean field_27262_q; + protected int field_27261_r; + protected DoubleBuffer doubleBuffer; + + public GuiTextSlot(int width, int height, int top, int bottom, int left, int entryHeight) { + this.listWidth = width; + this.listHeight = height; + this.top = top; + this.bottom = bottom; + this.slotHeight = entryHeight; + this.left = left; + this.right = width + this.left; + } + + public void func_27258_a(boolean p_27258_1_) { + this.field_25123_p = p_27258_1_; + } + + protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { + this.field_27262_q = p_27259_1_; + this.field_27261_r = p_27259_2_; + + if (!p_27259_1_) { + this.field_27261_r = 0; + } + } + + protected abstract int getSize(); + + protected abstract void elementClicked(int index, boolean doubleClick); + + protected abstract boolean isSelected(int index); + + protected int getContentHeight() { + return this.getSize() * this.slotHeight + this.field_27261_r; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); + + protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { + } + + protected void func_27255_a(int p_27255_1_, int p_27255_2_) { + } + + protected void func_27257_b(int p_27257_1_, int p_27257_2_) { + } + + public int func_27256_c(int p_27256_1_, int p_27256_2_) + + { + int var3 = this.left + 1; + int var4 = this.left + this.listWidth - 7; + int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; + int var6 = var5 / this.slotHeight; + return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; + } + + public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { + this.scrollUpActionId = p_22240_2_; + this.scrollDownActionId = p_22240_3_; + } + + protected void applyScrollLimits() { + int var1 = this.getContentHeight() - (this.bottom - this.top - 4); + + if (var1 < 0) { + var1 /= 2; + } + + if (this.scrollDistance < 0.0F) { + this.scrollDistance = 0.0F; + } + + if (this.scrollDistance > var1) { + this.scrollDistance = var1; + } + } + + public void actionPerformed(GuiButton button) { + if (button.enabled) { + if (button.id == this.scrollUpActionId) { + this.scrollDistance -= this.slotHeight * 2 / 3; + this.initialMouseClickY = -2.0F; + this.applyScrollLimits(); + } else if (button.id == this.scrollDownActionId) { + this.scrollDistance += this.slotHeight * 2 / 3; + this.initialMouseClickY = -2.0F; + this.applyScrollLimits(); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { + this.mouseX = mouseX; + this.mouseY = mouseY; + this.drawBackground(); + int listLength = this.getSize(); + int scrollBarXStart = this.left + this.listWidth - 6; + int scrollBarXEnd = scrollBarXStart + 6; + int boxLeft = this.left; + int boxRight = scrollBarXStart - 1; + int var10; + int var11; + int var13; + int var19; + + if (Mouse.isButtonDown(0)) { + if (this.initialMouseClickY == -1.0F) { + boolean var7 = true; + + if (mouseY >= this.top && mouseY <= this.bottom) { + var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; + var11 = var10 / this.slotHeight; + + if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { + boolean var12 = var11 == this.selectedIndex && System.currentTimeMillis() - this.lastClickTime < 250L; + this.elementClicked(var11, var12); + this.selectedIndex = var11; + this.lastClickTime = System.currentTimeMillis(); + } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { + this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); + var7 = false; + } + + if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { + this.scrollFactor = -1.0F; + var19 = this.getContentHeight() - (this.bottom - this.top - 4); + + if (var19 < 1) { + var19 = 1; + } + + var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this.getContentHeight()); + + if (var13 < 32) { + var13 = 32; + } + + if (var13 > this.bottom - this.top - 8) { + var13 = this.bottom - this.top - 8; + } + + this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; + } else { + this.scrollFactor = 1.0F; + } + + if (var7) { + this.initialMouseClickY = mouseY; + } else { + this.initialMouseClickY = -2.0F; + } + } else { + this.initialMouseClickY = -2.0F; + } + } else if (this.initialMouseClickY >= 0.0F) { + this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; + this.initialMouseClickY = mouseY; + } + } else { + while (Mouse.next()) { + int var16 = Mouse.getEventDWheel(); + + if (var16 != 0) { + if (var16 > 0) { + var16 = -1; + } else if (var16 < 0) { + var16 = 1; + } + + this.scrollDistance += var16 * this.slotHeight / 2; + } + } + + this.initialMouseClickY = -1.0F; + } + + this.applyScrollLimits(); + this.enableClipping(this.top, this.bottom); + + glDisable(GL_LIGHTING); + glDisable(GL_FOG); + Tessellator var18 = Tessellator.instance; + // glBindTexture(GL_TEXTURE_2D, + // this.client.renderEngine.getTexture("/gui/background.png")); + glEnable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + glColor4f(0.0F, 0.0F, 0.0F, 0.5F); + float var17 = 32.0F; + var18.startDrawingQuads(); + // var18.setColorOpaque_I(2105376); + var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, (this.bottom + (int) this.scrollDistance) / var17); + var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, (this.bottom + (int) this.scrollDistance) / var17); + var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, (this.top + (int) this.scrollDistance) / var17); + var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, (this.top + (int) this.scrollDistance) / var17); + var18.draw(); + glDisable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + var10 = this.top + 4 - (int) this.scrollDistance; + + if (this.field_27262_q) { + this.func_27260_a(boxRight, var10, var18); + } + + int var14; + + for (var11 = 0; var11 < listLength; ++var11) { + var19 = var10 + var11 * this.slotHeight + this.field_27261_r; + var13 = this.slotHeight - 4; + + if (var19 <= this.bottom && var19 + var13 >= this.top) { + if (this.field_25123_p && this.isSelected(var11)) { + var14 = boxLeft; + int var15 = boxRight; + glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + glDisable(GL_TEXTURE_2D); + var18.startDrawingQuads(); + var18.setColorOpaque_I(8421504); + var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); + var18.setColorOpaque_I(0); + var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); + var18.draw(); + glEnable(GL_TEXTURE_2D); + } + + this.drawSlot(var11, boxRight, var19, var13, var18); + } + } + + glDisable(GL_DEPTH_TEST); + byte var20 = 4; + // this.overlayBackground(0, this.top, 255, 255); + // this.overlayBackground(this.bottom, this.listHeight, 255, 255); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable(GL_ALPHA_TEST); + glShadeModel(GL_SMOOTH); + glDisable(GL_TEXTURE_2D); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 0); + var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 0); + var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); + var18.draw(); + var19 = this.getContentHeight() - (this.bottom - this.top - 4); + + if (var19 > 0) { + var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); + + if (var13 < 32) { + var13 = 32; + } + + if (var13 > this.bottom - this.top - 8) { + var13 = this.bottom - this.top - 8; + } + + var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; + + if (var14 < this.top) { + var14 = this.top; + } + + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(8421504, 255); + var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(12632256, 255); + var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); + var18.draw(); + } + + this.func_27257_b(mouseX, mouseY); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); + glEnable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + + this.disableClipping(); + } + + // protected void overlayBackground(int p_22239_1_, int p_22239_2_, int + // p_22239_3_, int p_22239_4_) + // { + // Tessellator var5 = Tessellator.instance; + // glBindTexture(GL_TEXTURE_2D, + // this.client.renderEngine.getTexture("/gui/background.png")); + // glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + // float var6 = 32.0F; + // var5.startDrawingQuads(); + // var5.setColorRGBA_I(4210752, p_22239_4_); + // var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, + // (double)((float)p_22239_2_ / var6)); + // var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, + // 0.0D, (double)((float)(this.listWidth + 30) / var6), + // (double)((float)p_22239_2_ / var6)); + // var5.setColorRGBA_I(4210752, p_22239_3_); + // var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, + // 0.0D, (double)((float)(this.listWidth + 30) / var6), + // (double)((float)p_22239_1_ / var6)); + // var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, + // (double)((float)p_22239_1_ / var6)); + // var5.draw(); + // } + + protected final void enableClipping(int yTop, int yBottom) { + if (doubleBuffer == null) { + doubleBuffer = BufferUtils.createByteBuffer(32).asDoubleBuffer(); + } + + doubleBuffer.clear(); + doubleBuffer.put(0).put(1).put(0).put(-yTop).flip(); + glClipPlane(GL_CLIP_PLANE0, doubleBuffer); + + doubleBuffer.clear(); + doubleBuffer.put(0).put(-1).put(0).put(yBottom).flip(); + glClipPlane(GL_CLIP_PLANE1, doubleBuffer); + + glEnable(GL_CLIP_PLANE0); + glEnable(GL_CLIP_PLANE1); + } + + protected final void disableClipping() { + glDisable(GL_CLIP_PLANE1); + glDisable(GL_CLIP_PLANE0); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java b/src/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java rename to src/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java index c04b126..ad5b1e7 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/PhotoSelector.java @@ -1,66 +1,66 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import java.io.File; -import java.text.SimpleDateFormat; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; - -import com.thatapplefreak.voxelcam.io.VoxelCamIO; - - -public class PhotoSelector extends GuiTextSlot { - final GuiScreenShotManager parent; - SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm aa"); - - public PhotoSelector(GuiScreenShotManager parent, int listWidth) { - super(listWidth, parent.height, 32, (parent.height - 55) + 4, 10, 35); - this.parent = parent; - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * 35 + 1; - } - - @Override - protected int getSize() { - return VoxelCamIO.getScreenShotFiles().size(); - } - - @Override - protected boolean isSelected(int i) { - return VoxelCamIO.isSelected(i); - } - - @Override - protected void drawBackground() { - } - - @Override - protected void drawSlot(int i, int j, int k, int l, Tessellator tessellator) { - File pic = VoxelCamIO.getScreenShotFiles().get(i); - if (pic != null) { - GL11.glEnable(GL11.GL_BLEND); - FontRenderer font = Minecraft.getMinecraft().fontRendererObj; - font.drawString(font.trimStringToWidth(pic.getName().replace(".png", ""), listWidth - 10), 13, k + 2, 0xFFFFFF); - font.drawString(font.trimStringToWidth(sdf.format(pic.lastModified()), listWidth - 10), 13, k + 12, 0xCCCCCC); - } - } - - @Override - protected void elementClicked(int i, boolean flag) { - VoxelCamIO.selectPhotoIndex(i); - } - - public void setDimensionsAndPosition(int x, int y, int x2, int y2) { - this.left = x; - this.top = y; - this.right = x2; - this.bottom = y2; - this.listWidth = x2 - x + 7; - } +package com.thatapplefreak.voxelcam.gui.manager; + +import java.io.File; +import java.text.SimpleDateFormat; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.Tessellator; + +import org.lwjgl.opengl.GL11; + +import com.thatapplefreak.voxelcam.io.VoxelCamIO; + + +public class PhotoSelector extends GuiTextSlot { + final GuiScreenShotManager parent; + SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm aa"); + + public PhotoSelector(GuiScreenShotManager parent, int listWidth) { + super(listWidth, parent.height, 32, (parent.height - 55) + 4, 10, 35); + this.parent = parent; + } + + @Override + protected int getContentHeight() { + return (this.getSize()) * 35 + 1; + } + + @Override + protected int getSize() { + return VoxelCamIO.getScreenShotFiles().size(); + } + + @Override + protected boolean isSelected(int i) { + return VoxelCamIO.isSelected(i); + } + + @Override + protected void drawBackground() { + } + + @Override + protected void drawSlot(int i, int j, int k, int l, Tessellator tessellator) { + File pic = VoxelCamIO.getScreenShotFiles().get(i); + if (pic != null) { + GL11.glEnable(GL11.GL_BLEND); + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; + font.drawString(font.trimStringToWidth(pic.getName().replace(".png", ""), listWidth - 10), 13, k + 2, 0xFFFFFF); + font.drawString(font.trimStringToWidth(sdf.format(pic.lastModified()), listWidth - 10), 13, k + 12, 0xCCCCCC); + } + } + + @Override + protected void elementClicked(int i, boolean flag) { + VoxelCamIO.selectPhotoIndex(i); + } + + public void setDimensionsAndPosition(int x, int y, int x2, int y2) { + this.left = x; + this.top = y; + this.right = x2; + this.bottom = y2; + this.listWidth = x2 - x + 7; + } } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java b/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java rename to src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java index 246a546..2c44294 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java @@ -1,125 +1,125 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.FileChannel; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thatapplefreak.voxelcam.upload.dropbox.DropboxHandler; -import com.thatapplefreak.voxelcam.upload.googleDrive.GoogleDriveHandler; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurHandler; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; -import com.thatapplefreak.voxelcam.upload.reddit.RedditHandler; -import com.thatapplefreak.voxelcam.upload.reddit.RedditLoginPopup; -import com.thatapplefreak.voxelcam.upload.reddit.RedditPostPopup; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterLoginPopup; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterPostPopup; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class PostPopup extends GuiDialogBox implements ScreenshotIncapable { - - GuiButton btnImgur, btnFacebook, btnTwitter, btnDropBox, btnGoogleDrive, btnReddit; - - private volatile GuiScreen completeDialog; - - private boolean uploading = false; - - public PostPopup(GuiScreen parentScreen) { - super(parentScreen, 180, 120, I18n.format("postto") + "..."); - } - - @SuppressWarnings("unchecked") - @Override - protected void onInitDialog() { - buttonList.remove(btnOk); - btnCancel.xPosition = dialogX + 60; - - buttonList.add(btnImgur = new GuiButton(0, dialogX + 15, dialogY + 40, 70, 20, "Imgur")); - buttonList.add(btnFacebook = new GuiButton(2, dialogX + 95, dialogY + 10, 70, 20, "Facebook")); - buttonList.add(btnTwitter = new GuiButton(3, dialogX + 15, dialogY + 10, 70, 20, "Twitter")); - buttonList.add(btnReddit = new GuiButton(5, dialogX + 95, dialogY + 40, 70, 20, "Reddit")); - - btnDropBox = new GuiButton(1, dialogX + 15, dialogY + 70, 70, 20, "Dropbox"); - btnGoogleDrive = new GuiButton(4, dialogX + 95, dialogY + 70, 70, 20, "Google Drive"); - buttonList.add(btnDropBox); - buttonList.add(btnGoogleDrive); - - if (!(new File(System.getProperty("user.home"), "/dropbox/").exists())) { - btnDropBox.enabled = false; - } - if (!(new File(System.getProperty("user.home"), "/Google Drive/").exists())) { - btnGoogleDrive.enabled = false; - } - - btnFacebook.enabled = false; - } - - @Override - public void onSubmit() { - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - - if (uploading) { - buttonList.clear(); - drawCenteredString(fontRendererObj, I18n.format("uploading") + "...", width / 2, height / 2, 0xffffff); - } - - if (this.completeDialog != null) { - this.mc.displayGuiScreen(this.completeDialog); - this.completeDialog = null; - } - } - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.equals(btnCancel)) { - closeDialog(); - } else if (guibutton.equals(btnImgur)) { - ImgurHandler.doImgur(this, VoxelCamIO.getSelectedPhoto()); - this.uploading = true; - } else if (guibutton.equals(btnDropBox)) { - DropboxHandler.doDropBox(VoxelCamIO.getSelectedPhoto(), true); - mc.displayGuiScreen(getParentScreen()); - } else if (guibutton.equals(btnTwitter)) { - if (VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERAUTHTOKEN).equals("needLogin")) { - mc.displayGuiScreen(new TwitterLoginPopup(getParentScreen())); - } else { - mc.displayGuiScreen(new TwitterPostPopup(getParentScreen())); - } - } else if (guibutton.equals(btnGoogleDrive)) { - GoogleDriveHandler.doGoogleDrive(VoxelCamIO.getSelectedPhoto(), true); - mc.displayGuiScreen(getParentScreen()); - } else if (guibutton.equals(btnReddit)) { - if (!RedditHandler.isLoggedIn()) { - mc.displayGuiScreen(new RedditLoginPopup(getParentScreen())); - } else { - mc.displayGuiScreen(new RedditPostPopup(getParentScreen())); - } - } - } - - public void onUploadCompleted(GuiScreen g) { - completeDialog = g; - } - -} +package com.thatapplefreak.voxelcam.gui.manager; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.channels.FileChannel; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; +import com.thatapplefreak.voxelcam.upload.dropbox.DropboxHandler; +import com.thatapplefreak.voxelcam.upload.googleDrive.GoogleDriveHandler; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurHandler; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; +import com.thatapplefreak.voxelcam.upload.reddit.RedditHandler; +import com.thatapplefreak.voxelcam.upload.reddit.RedditLoginPopup; +import com.thatapplefreak.voxelcam.upload.reddit.RedditPostPopup; +import com.thatapplefreak.voxelcam.upload.twitter.TwitterLoginPopup; +import com.thatapplefreak.voxelcam.upload.twitter.TwitterPostPopup; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class PostPopup extends GuiDialogBox implements ScreenshotIncapable { + + GuiButton btnImgur, btnFacebook, btnTwitter, btnDropBox, btnGoogleDrive, btnReddit; + + private volatile GuiScreen completeDialog; + + private boolean uploading = false; + + public PostPopup(GuiScreen parentScreen) { + super(parentScreen, 180, 120, I18n.format("postto") + "..."); + } + + @SuppressWarnings("unchecked") + @Override + protected void onInitDialog() { + buttonList.remove(btnOk); + btnCancel.xPosition = dialogX + 60; + + buttonList.add(btnImgur = new GuiButton(0, dialogX + 15, dialogY + 40, 70, 20, "Imgur")); + buttonList.add(btnFacebook = new GuiButton(2, dialogX + 95, dialogY + 10, 70, 20, "Facebook")); + buttonList.add(btnTwitter = new GuiButton(3, dialogX + 15, dialogY + 10, 70, 20, "Twitter")); + buttonList.add(btnReddit = new GuiButton(5, dialogX + 95, dialogY + 40, 70, 20, "Reddit")); + + btnDropBox = new GuiButton(1, dialogX + 15, dialogY + 70, 70, 20, "Dropbox"); + btnGoogleDrive = new GuiButton(4, dialogX + 95, dialogY + 70, 70, 20, "Google Drive"); + buttonList.add(btnDropBox); + buttonList.add(btnGoogleDrive); + + if (!(new File(System.getProperty("user.home"), "/dropbox/").exists())) { + btnDropBox.enabled = false; + } + if (!(new File(System.getProperty("user.home"), "/Google Drive/").exists())) { + btnGoogleDrive.enabled = false; + } + + btnFacebook.enabled = false; + } + + @Override + public void onSubmit() { + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + + if (uploading) { + buttonList.clear(); + drawCenteredString(fontRendererObj, I18n.format("uploading") + "...", width / 2, height / 2, 0xffffff); + } + + if (this.completeDialog != null) { + this.mc.displayGuiScreen(this.completeDialog); + this.completeDialog = null; + } + } + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.equals(btnCancel)) { + closeDialog(); + } else if (guibutton.equals(btnImgur)) { + ImgurHandler.doImgur(this, VoxelCamIO.getSelectedPhoto()); + this.uploading = true; + } else if (guibutton.equals(btnDropBox)) { + DropboxHandler.doDropBox(VoxelCamIO.getSelectedPhoto(), true); + mc.displayGuiScreen(getParentScreen()); + } else if (guibutton.equals(btnTwitter)) { + if (VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERAUTHTOKEN).equals("needLogin")) { + mc.displayGuiScreen(new TwitterLoginPopup(getParentScreen())); + } else { + mc.displayGuiScreen(new TwitterPostPopup(getParentScreen())); + } + } else if (guibutton.equals(btnGoogleDrive)) { + GoogleDriveHandler.doGoogleDrive(VoxelCamIO.getSelectedPhoto(), true); + mc.displayGuiScreen(getParentScreen()); + } else if (guibutton.equals(btnReddit)) { + if (!RedditHandler.isLoggedIn()) { + mc.displayGuiScreen(new RedditLoginPopup(getParentScreen())); + } else { + mc.displayGuiScreen(new RedditPostPopup(getParentScreen())); + } + } + } + + public void onUploadCompleted(GuiScreen g) { + completeDialog = g; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java b/src/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java rename to src/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java index 4c5be5c..2f93f4a 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/RenamePopup.java @@ -1,56 +1,56 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class RenamePopup extends GuiDialogBox implements ScreenshotIncapable { - - private GuiTextField renameBox; - - private String oldText; - - public RenamePopup(GuiScreen parentScreen, String oldName) { - super(parentScreen, 200, 75, I18n.format("rename")); - this.oldText = oldName.replaceAll(".png", ""); - } - - @Override - protected void onInitDialog() { - renameBox = new GuiTextField(fontRendererObj, width / 2 - (150 / 2), height / 2 - (16 / 2) - 8, 150, 16); - renameBox.setText(oldText); - renameBox.setFocused(true); - } - - @Override - public void onSubmit() { - VoxelCamIO.rename(renameBox.getText()); - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - renameBox.drawTextBox(); - } - - @Override - protected void mouseClickedEx(int mouseX, int mouseY, int button) { - super.mouseClickedEx(mouseX, mouseY, button); - renameBox.mouseClicked(mouseX, mouseY, button); - } - - @Override - protected void onKeyTyped(char keyChar, int keyCode) { - renameBox.textboxKeyTyped(keyChar, keyCode); - } - +package com.thatapplefreak.voxelcam.gui.manager; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class RenamePopup extends GuiDialogBox implements ScreenshotIncapable { + + private GuiTextField renameBox; + + private String oldText; + + public RenamePopup(GuiScreen parentScreen, String oldName) { + super(parentScreen, 200, 75, I18n.format("rename")); + this.oldText = oldName.replaceAll(".png", ""); + } + + @Override + protected void onInitDialog() { + renameBox = new GuiTextField(fontRendererObj, width / 2 - (150 / 2), height / 2 - (16 / 2) - 8, 150, 16); + renameBox.setText(oldText); + renameBox.setFocused(true); + } + + @Override + public void onSubmit() { + VoxelCamIO.rename(renameBox.getText()); + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + renameBox.drawTextBox(); + } + + @Override + protected void mouseClickedEx(int mouseX, int mouseY, int button) { + super.mouseClickedEx(mouseX, mouseY, button); + renameBox.mouseClicked(mouseX, mouseY, button); + } + + @Override + protected void onKeyTyped(char keyChar, int keyCode) { + renameBox.textboxKeyTyped(keyChar, keyCode); + } + } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java b/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java rename to src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java index 9291d9d..01c6d29 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java @@ -1,141 +1,141 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import static org.lwjgl.opengl.GL11.*; - -import java.awt.LinearGradientPaint; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; - -import javax.imageio.ImageIO; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; -import com.thatapplefreak.voxelcam.imagehandle.ImageDrawer; - -public class ScalePhotoFrame extends Gui { - - private final float scale; - - public int x, y, width, height; - private File currentPhoto; - private GuiScreenShotManager parentScreen; - - private BufferedImage img = null; - - public ScalePhotoFrame(GuiScreenShotManager parent, int x, int y, float scale, File photo) { - this.x = x; - this.y = y; - this.scale = scale; - this.parentScreen = parent; - this.width = (int) (parent.width * scale); - this.height = (int) (parent.height * scale); - setPhoto(photo); - } - - public void setPhoto(File photo) { - currentPhoto = photo; - if (currentPhoto != null) { - try { - img = ImageIO.read(photo); - GLImageMemoryHandler.tryPutTextureIntoMem(photo); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - public File getPhoto() { - return currentPhoto; - } - - public void update(int x, int y) { - this.x = x; - this.y = y; - this.width = (int) (parentScreen.width * scale); - this.height = (int) (parentScreen.height * scale); - } - - public void draw(int mouseX, int mouseY, float partialTicks) { - - if (currentPhoto != null && GLImageMemoryHandler.loadingImage(GLImageMemoryHandler.getImageGLName(currentPhoto))) { - drawBackground(); - parentScreen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, I18n.format("loadingiamge") + "...", x + width / 2, y + height / 2, 0xffffff); - return; - } - - if (currentPhoto != null && img != null) { - parentScreen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, currentPhoto.getName().replace(".png", ""), x + width / 2, y - 10, 0xffffff); - float frameAspect = (float) width / (float) height; - float picAspect = (float) img.getWidth() / (float) img.getHeight(); - int photoX = 0; - int photoY = 0; - int photoX2 = 0; - int photoY2 = 0; - if (picAspect == frameAspect) { - photoX = x; - photoY = y; - photoX2 = x + width; - photoY2 = y + height; - } else if (picAspect > frameAspect) { - photoX = x; - photoX2 = x + width; - float picHeight = width * (float) img.getHeight() / img.getWidth(); - photoY = (int) (y + height / 2 - picHeight / 2); - photoY2 = (int) (y + height / 2 + picHeight / 2); - } else if (picAspect < frameAspect) { - photoY = y; - photoY2 = y + height; - float picWidth = height * (float) img.getWidth() / img.getHeight(); - photoX = (int) (x + (width / 2) - (picWidth / 2)); - photoX2 = (int) (x + (width / 2) + (picWidth / 2)); - } - drawBackground(); - ImageDrawer.drawImageToGui(GLImageMemoryHandler.getImageGLName(currentPhoto), photoX, photoY, photoX2, photoY2); - parentScreen.enableButtons(true); - } else { - drawBackground(); - parentScreen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, I18n.format("noscreenshots"), x + width / 2, y + height / 2, 0xffffff); - parentScreen.enableButtons(false); - } - } - - private void drawBackground() { - Tessellator t = Tessellator.instance; - glEnable(GL_BLEND); - glDisable(GL_TEXTURE_2D); - glColor4f(0.0F, 0.0F, 0.0F, 0.5F); - float blendArea = 32.0F; - t.startDrawingQuads(); - t.addVertexWithUV(x, y + height, 0.0D, x / blendArea, (y + height) / blendArea); - t.addVertexWithUV(x + width, y + height, 0.0D, (x + width) / blendArea, (y + height) / blendArea); - t.addVertexWithUV(x + width, y, 0.0D, (x + width) / blendArea, (x + height) / blendArea); - t.addVertexWithUV(x, y, 0.0D, x / blendArea, (y + height) / blendArea); - t.draw(); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_ALPHA_TEST); - glShadeModel(GL_SMOOTH); - byte four = 4; - t.startDrawingQuads(); - t.setColorRGBA_I(0, 0); - t.addVertexWithUV(x, y + four, 0.0D, 0.0D, 1.0D); - t.addVertexWithUV(x + width, y + four, 0.0D, 1.0D, 1.0D); - t.setColorRGBA_I(0, 255); - t.addVertexWithUV(x + width, y, 0.0D, 1.0D, 0.0D); - t.addVertexWithUV(x, y, 0.0D, 0.0D, 0.0D); - t.draw(); - t.startDrawingQuads(); - t.setColorRGBA_I(0, 255); - t.addVertexWithUV(x, y + height, 0.0D, 0.0D, 1.0D); - t.addVertexWithUV(x + width, y + height, 0.0D, 1.0D, 1.0D); - t.setColorRGBA_I(0, 0); - t.addVertexWithUV(x + width, y + height - four, 0.0D, 1.0D, 0.0D); - t.addVertexWithUV(x, y + height - four, 0.0D, 0.0D, 0.0D); - t.draw(); - glEnable(GL_TEXTURE_2D); - } -} +package com.thatapplefreak.voxelcam.gui.manager; + +import static org.lwjgl.opengl.GL11.*; + +import java.awt.LinearGradientPaint; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; +import com.thatapplefreak.voxelcam.imagehandle.ImageDrawer; + +public class ScalePhotoFrame extends Gui { + + private final float scale; + + public int x, y, width, height; + private File currentPhoto; + private GuiScreenShotManager parentScreen; + + private BufferedImage img = null; + + public ScalePhotoFrame(GuiScreenShotManager parent, int x, int y, float scale, File photo) { + this.x = x; + this.y = y; + this.scale = scale; + this.parentScreen = parent; + this.width = (int) (parent.width * scale); + this.height = (int) (parent.height * scale); + setPhoto(photo); + } + + public void setPhoto(File photo) { + currentPhoto = photo; + if (currentPhoto != null) { + try { + img = ImageIO.read(photo); + GLImageMemoryHandler.tryPutTextureIntoMem(photo); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + public File getPhoto() { + return currentPhoto; + } + + public void update(int x, int y) { + this.x = x; + this.y = y; + this.width = (int) (parentScreen.width * scale); + this.height = (int) (parentScreen.height * scale); + } + + public void draw(int mouseX, int mouseY, float partialTicks) { + + if (currentPhoto != null && GLImageMemoryHandler.loadingImage(GLImageMemoryHandler.getImageGLName(currentPhoto))) { + drawBackground(); + parentScreen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, I18n.format("loadingiamge") + "...", x + width / 2, y + height / 2, 0xffffff); + return; + } + + if (currentPhoto != null && img != null) { + parentScreen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, currentPhoto.getName().replace(".png", ""), x + width / 2, y - 10, 0xffffff); + float frameAspect = (float) width / (float) height; + float picAspect = (float) img.getWidth() / (float) img.getHeight(); + int photoX = 0; + int photoY = 0; + int photoX2 = 0; + int photoY2 = 0; + if (picAspect == frameAspect) { + photoX = x; + photoY = y; + photoX2 = x + width; + photoY2 = y + height; + } else if (picAspect > frameAspect) { + photoX = x; + photoX2 = x + width; + float picHeight = width * (float) img.getHeight() / img.getWidth(); + photoY = (int) (y + height / 2 - picHeight / 2); + photoY2 = (int) (y + height / 2 + picHeight / 2); + } else if (picAspect < frameAspect) { + photoY = y; + photoY2 = y + height; + float picWidth = height * (float) img.getWidth() / img.getHeight(); + photoX = (int) (x + (width / 2) - (picWidth / 2)); + photoX2 = (int) (x + (width / 2) + (picWidth / 2)); + } + drawBackground(); + ImageDrawer.drawImageToGui(GLImageMemoryHandler.getImageGLName(currentPhoto), photoX, photoY, photoX2, photoY2); + parentScreen.enableButtons(true); + } else { + drawBackground(); + parentScreen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, I18n.format("noscreenshots"), x + width / 2, y + height / 2, 0xffffff); + parentScreen.enableButtons(false); + } + } + + private void drawBackground() { + Tessellator t = Tessellator.instance; + glEnable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + glColor4f(0.0F, 0.0F, 0.0F, 0.5F); + float blendArea = 32.0F; + t.startDrawingQuads(); + t.addVertexWithUV(x, y + height, 0.0D, x / blendArea, (y + height) / blendArea); + t.addVertexWithUV(x + width, y + height, 0.0D, (x + width) / blendArea, (y + height) / blendArea); + t.addVertexWithUV(x + width, y, 0.0D, (x + width) / blendArea, (x + height) / blendArea); + t.addVertexWithUV(x, y, 0.0D, x / blendArea, (y + height) / blendArea); + t.draw(); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable(GL_ALPHA_TEST); + glShadeModel(GL_SMOOTH); + byte four = 4; + t.startDrawingQuads(); + t.setColorRGBA_I(0, 0); + t.addVertexWithUV(x, y + four, 0.0D, 0.0D, 1.0D); + t.addVertexWithUV(x + width, y + four, 0.0D, 1.0D, 1.0D); + t.setColorRGBA_I(0, 255); + t.addVertexWithUV(x + width, y, 0.0D, 1.0D, 0.0D); + t.addVertexWithUV(x, y, 0.0D, 0.0D, 0.0D); + t.draw(); + t.startDrawingQuads(); + t.setColorRGBA_I(0, 255); + t.addVertexWithUV(x, y + height, 0.0D, 0.0D, 1.0D); + t.addVertexWithUV(x + width, y + height, 0.0D, 1.0D, 1.0D); + t.setColorRGBA_I(0, 0); + t.addVertexWithUV(x + width, y + height - four, 0.0D, 1.0D, 0.0D); + t.addVertexWithUV(x, y + height - four, 0.0D, 0.0D, 0.0D); + t.draw(); + glEnable(GL_TEXTURE_2D); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java b/src/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java rename to src/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java index 0fdec69..3b03217 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/SearchBar.java @@ -1,651 +1,651 @@ -package com.thatapplefreak.voxelcam.gui.manager; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.resources.I18n; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.opengl.GL11; - - -public class SearchBar extends Gui { - - /** - * Have the font renderer from GuiScreen to render the textbox text into the - * screen. - */ - private final FontRenderer fontRenderer; - private final int xPos; - private final int yPos; - - /** The width of this text field. */ - private int width; - private final int height; - - /** Have the current text beign edited on the textbox. */ - private String text = ""; - private int maxStringLength = 32; - private int cursorCounter; - private boolean enableBackgroundDrawing = true; - - /** - * if true the textbox can lose focus by clicking elsewhere on the screen - */ - private boolean canLoseFocus = true; - - /** - * If this value is true along isEnabled, keyTyped will process the keys. - */ - private boolean isFocused; - - /** - * If this value is true along isFocused, keyTyped will process the keys. - */ - private boolean isEnabled = true; - - /** - * The current character index that should be used as start of the rendered - * text. - */ - private int lineScrollOffset; - private int cursorPosition; - - /** other selection position, maybe the same as the cursor */ - private int selectionEnd; - private int enabledColor = 14737632; - private int disabledColor = 7368816; - - /** True if this textbox is visible */ - private boolean visible = true; - - public SearchBar(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5) { - this.fontRenderer = par1FontRenderer; - this.xPos = par2; - this.yPos = par3; - this.width = par4; - this.height = par5; - } - - public void setWidth(int x) { - this.width = x; - } - - /** - * Increments the cursor counter - */ - public void updateCursorCounter() { - ++this.cursorCounter; - } - - /** - * Sets the text of the textbox. - */ - public void setText(String par1Str) { - if (par1Str.length() > this.maxStringLength) { - this.text = par1Str.substring(0, this.maxStringLength); - } else { - this.text = par1Str; - } - - this.setCursorPositionEnd(); - } - - /** - * Returns the text beign edited on the textbox. - */ - public String getText() { - return this.text; - } - - /** - * @return returns the text between the cursor and selectionEnd - */ - public String getSelectedtext() { - int var1 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; - int var2 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; - return this.text.substring(var1, var2); - } - - /** - * replaces selected text, or inserts text at the position on the cursor - */ - public void writeText(String par1Str) { - String var2 = ""; - String var3 = ChatAllowedCharacters.filterAllowedCharacters(par1Str); - int var4 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; - int var5 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; - int var6 = this.maxStringLength - this.text.length() - (var4 - this.selectionEnd); - boolean var7 = false; - - if (this.text.length() > 0) { - var2 = var2 + this.text.substring(0, var4); - } - - int var8; - - if (var6 < var3.length()) { - var2 = var2 + var3.substring(0, var6); - var8 = var6; - } else { - var2 = var2 + var3; - var8 = var3.length(); - } - - if (this.text.length() > 0 && var5 < this.text.length()) { - var2 = var2 + this.text.substring(var5); - } - - this.text = var2; - this.moveCursorBy(var4 - this.selectionEnd + var8); - } - - /** - * Deletes the specified number of words starting at the cursor position. - * Negative numbers will delete words left of the cursor. - */ - public void deleteWords(int par1) { - if (this.text.length() != 0) { - if (this.selectionEnd != this.cursorPosition) { - this.writeText(""); - } else { - this.deleteFromCursor(this.getNthWordFromCursor(par1) - this.cursorPosition); - } - } - } - - /** - * delete the selected text, otherwsie deletes characters from either side - * of the cursor. params: delete num - */ - public void deleteFromCursor(int par1) { - if (this.text.length() != 0) { - if (this.selectionEnd != this.cursorPosition) { - this.writeText(""); - } else { - boolean var2 = par1 < 0; - int var3 = var2 ? this.cursorPosition + par1 : this.cursorPosition; - int var4 = var2 ? this.cursorPosition : this.cursorPosition + par1; - String var5 = ""; - - if (var3 >= 0) { - var5 = this.text.substring(0, var3); - } - - if (var4 < this.text.length()) { - var5 = var5 + this.text.substring(var4); - } - - this.text = var5; - - if (var2) { - this.moveCursorBy(par1); - } - } - } - } - - /** - * see @getNthNextWordFromPos() params: N, position - */ - public int getNthWordFromCursor(int par1) { - return this.getNthWordFromPos(par1, this.getCursorPosition()); - } - - /** - * gets the position of the nth word. N may be negative, then it looks - * backwards. params: N, position - */ - public int getNthWordFromPos(int par1, int par2) { - return this.func_73798_a(par1, this.getCursorPosition(), true); - } - - public int func_73798_a(int par1, int par2, boolean par3) { - int var4 = par2; - boolean var5 = par1 < 0; - int var6 = Math.abs(par1); - - for (int var7 = 0; var7 < var6; ++var7) { - if (var5) { - while (par3 && var4 > 0 && this.text.charAt(var4 - 1) == 32) { - --var4; - } - - while (var4 > 0 && this.text.charAt(var4 - 1) != 32) { - --var4; - } - } else { - int var8 = this.text.length(); - var4 = this.text.indexOf(32, var4); - - if (var4 == -1) { - var4 = var8; - } else { - while (par3 && var4 < var8 && this.text.charAt(var4) == 32) { - ++var4; - } - } - } - } - - return var4; - } - - /** - * Moves the text cursor by a specified number of characters and clears the - * selection - */ - public void moveCursorBy(int par1) { - this.setCursorPosition(this.selectionEnd + par1); - } - - /** - * sets the position of the cursor to the provided index - */ - public void setCursorPosition(int par1) { - this.cursorPosition = par1; - int var2 = this.text.length(); - - if (this.cursorPosition < 0) { - this.cursorPosition = 0; - } - - if (this.cursorPosition > var2) { - this.cursorPosition = var2; - } - - this.setSelectionPos(this.cursorPosition); - } - - /** - * sets the cursors position to the beginning - */ - public void setCursorPositionZero() { - this.setCursorPosition(0); - } - - /** - * sets the cursors position to after the text - */ - public void setCursorPositionEnd() { - this.setCursorPosition(this.text.length()); - } - - /** - * Call this method from you GuiScreen to process the keys into textbox. - */ - public boolean textboxKeyTyped(char par1, int par2) { - if (this.isEnabled && this.isFocused) { - switch (par1) { - case 1: - this.setCursorPositionEnd(); - this.setSelectionPos(0); - return true; - - case 3: - GuiScreen.setClipboardString(this.getSelectedtext()); - return true; - - case 22: - this.writeText(GuiScreen.getClipboardString()); - return true; - - case 24: - GuiScreen.setClipboardString(this.getSelectedtext()); - this.writeText(""); - return true; - - default: - switch (par2) { - case 14: - if (GuiScreen.isCtrlKeyDown()) { - this.deleteWords(-1); - } else { - this.deleteFromCursor(-1); - } - - return true; - - case 199: - if (GuiScreen.isShiftKeyDown()) { - this.setSelectionPos(0); - } else { - this.setCursorPositionZero(); - } - - return true; - - case 203: - if (GuiScreen.isShiftKeyDown()) { - if (GuiScreen.isCtrlKeyDown()) { - this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); - } else { - this.setSelectionPos(this.getSelectionEnd() - 1); - } - } else if (GuiScreen.isCtrlKeyDown()) { - this.setCursorPosition(this.getNthWordFromCursor(-1)); - } else { - this.moveCursorBy(-1); - } - - return true; - - case 205: - if (GuiScreen.isShiftKeyDown()) { - if (GuiScreen.isCtrlKeyDown()) { - this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); - } else { - this.setSelectionPos(this.getSelectionEnd() + 1); - } - } else if (GuiScreen.isCtrlKeyDown()) { - this.setCursorPosition(this.getNthWordFromCursor(1)); - } else { - this.moveCursorBy(1); - } - - return true; - - case 207: - if (GuiScreen.isShiftKeyDown()) { - this.setSelectionPos(this.text.length()); - } else { - this.setCursorPositionEnd(); - } - - return true; - - case 211: - if (GuiScreen.isCtrlKeyDown()) { - this.deleteWords(1); - } else { - this.deleteFromCursor(1); - } - - return true; - - default: - if (ChatAllowedCharacters.isAllowedCharacter(par1)) { - this.writeText(Character.toString(par1)); - return true; - } else { - return false; - } - } - } - } else { - return false; - } - } - - /** - * Args: x, y, buttonClicked - */ - public void mouseClicked(int par1, int par2, int par3) { - boolean var4 = par1 >= this.xPos && par1 < this.xPos + this.width && par2 >= this.yPos && par2 < this.yPos + this.height; - - if (this.canLoseFocus) { - this.setFocused(this.isEnabled && var4); - } - - if (this.isFocused && par3 == 0) { - int var5 = par1 - this.xPos; - - if (this.enableBackgroundDrawing) { - var5 -= 4; - } - - String var6 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); - this.setCursorPosition(this.fontRenderer.trimStringToWidth(var6, var5).length() + this.lineScrollOffset); - } - } - - /** - * Draws the textbox - */ - public void drawTextBox() { - if (this.getVisible()) { - if (this.getEnableBackgroundDrawing()) { - drawRect(this.xPos - 1, this.yPos - 1, this.xPos + this.width + 1, this.yPos + this.height + 1, -6250336); - drawRect(this.xPos, this.yPos, this.xPos + this.width, this.yPos + this.height, -16777216); - } - - int var1 = this.isEnabled ? this.enabledColor : this.disabledColor; - int var2 = this.cursorPosition - this.lineScrollOffset; - int var3 = this.selectionEnd - this.lineScrollOffset; - String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); - boolean var5 = var2 >= 0 && var2 <= var4.length(); - boolean var6 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && var5; - int var7 = this.enableBackgroundDrawing ? this.xPos + 4 : this.xPos; - int var8 = this.enableBackgroundDrawing ? this.yPos + (this.height - 8) / 2 : this.yPos; - int var9 = var7; - - if (var3 > var4.length()) { - var3 = var4.length(); - } - - if (var4.length() > 0) { - String var10 = var5 ? var4.substring(0, var2) : var4; - var9 = this.fontRenderer.drawStringWithShadow(var10, var7, var8, var1); - } else { - if (!isFocused) { - drawString(fontRenderer, I18n.format("search"), var7, var8, 0xa0a0a0); - } - } - - boolean var13 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); - int var11 = var9; - - if (!var5) { - var11 = var2 > 0 ? var7 + this.width : var7; - } else if (var13) { - var11 = var9 - 1; - --var9; - } - - if (var4.length() > 0 && var5 && var2 < var4.length()) { - this.fontRenderer.drawStringWithShadow(var4.substring(var2), var9, var8, var1); - } - - if (var6) { - if (var13) { - Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272); - } else { - this.fontRenderer.drawStringWithShadow("_", var11, var8, var1); - } - } - - if (var3 != var2) { - int var12 = var7 + this.fontRenderer.getStringWidth(var4.substring(0, var3)); - this.drawCursorVertical(var11, var8 - 1, var12 - 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT); - } - } - } - - /** - * draws the vertical line cursor in the textbox - */ - private void drawCursorVertical(int par1, int par2, int par3, int par4) { - int var5; - - if (par1 < par3) { - var5 = par1; - par1 = par3; - par3 = var5; - } - - if (par2 < par4) { - var5 = par2; - par2 = par4; - par4 = var5; - } - - Tessellator var6 = Tessellator.instance; - GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); - GL11.glLogicOp(GL11.GL_OR_REVERSE); - var6.startDrawingQuads(); - var6.addVertex((double) par1, (double) par4, 0.0D); - var6.addVertex((double) par3, (double) par4, 0.0D); - var6.addVertex((double) par3, (double) par2, 0.0D); - var6.addVertex((double) par1, (double) par2, 0.0D); - var6.draw(); - GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - public void setMaxStringLength(int par1) { - this.maxStringLength = par1; - - if (this.text.length() > par1) { - this.text = this.text.substring(0, par1); - } - } - - /** - * returns the maximum number of character that can be contained in this - * textbox - */ - public int getMaxStringLength() { - return this.maxStringLength; - } - - /** - * returns the current position of the cursor - */ - public int getCursorPosition() { - return this.cursorPosition; - } - - /** - * get enable drawing background and outline - */ - public boolean getEnableBackgroundDrawing() { - return this.enableBackgroundDrawing; - } - - /** - * enable drawing background and outline - */ - public void setEnableBackgroundDrawing(boolean par1) { - this.enableBackgroundDrawing = par1; - } - - /** - * Sets the text colour for this textbox (disabled text will not use this - * colour) - */ - public void setTextColor(int par1) { - this.enabledColor = par1; - } - - public void setDisabledTextColour(int par1) { - this.disabledColor = par1; - } - - /** - * setter for the focused field - */ - public void setFocused(boolean par1) { - if (par1 && !this.isFocused) { - this.cursorCounter = 0; - } - - this.isFocused = par1; - } - - /** - * getter for the focused field - */ - public boolean isFocused() { - return this.isFocused; - } - - public void setEnabled(boolean par1) { - this.isEnabled = par1; - } - - /** - * the side of the selection that is not the cursor, maye be the same as the - * cursor - */ - public int getSelectionEnd() { - return this.selectionEnd; - } - - /** - * returns the width of the textbox depending on if the the box is enabled - */ - public int getWidth() { - return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; - } - - /** - * Sets the position of the selection anchor (i.e. position the selection - * was started at) - */ - public void setSelectionPos(int par1) { - int var2 = this.text.length(); - - if (par1 > var2) { - par1 = var2; - } - - if (par1 < 0) { - par1 = 0; - } - - this.selectionEnd = par1; - - if (this.fontRenderer != null) { - if (this.lineScrollOffset > var2) { - this.lineScrollOffset = var2; - } - - int var3 = this.getWidth(); - String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), var3); - int var5 = var4.length() + this.lineScrollOffset; - - if (par1 == this.lineScrollOffset) { - this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.text, var3, true).length(); - } - - if (par1 > var5) { - this.lineScrollOffset += par1 - var5; - } else if (par1 <= this.lineScrollOffset) { - this.lineScrollOffset -= this.lineScrollOffset - par1; - } - - if (this.lineScrollOffset < 0) { - this.lineScrollOffset = 0; - } - - if (this.lineScrollOffset > var2) { - this.lineScrollOffset = var2; - } - } - } - - /** - * if true the textbox can lose focus by clicking elsewhere on the screen - */ - public void setCanLoseFocus(boolean par1) { - this.canLoseFocus = par1; - } - - /** - * @return {@code true} if this textbox is visible - */ - public boolean getVisible() { - return this.visible; - } - - /** - * Sets whether or not this textbox is visible - */ - public void setVisible(boolean par1) { - this.visible = par1; - } - -} +package com.thatapplefreak.voxelcam.gui.manager; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatAllowedCharacters; + +import org.lwjgl.opengl.GL11; + + +public class SearchBar extends Gui { + + /** + * Have the font renderer from GuiScreen to render the textbox text into the + * screen. + */ + private final FontRenderer fontRenderer; + private final int xPos; + private final int yPos; + + /** The width of this text field. */ + private int width; + private final int height; + + /** Have the current text beign edited on the textbox. */ + private String text = ""; + private int maxStringLength = 32; + private int cursorCounter; + private boolean enableBackgroundDrawing = true; + + /** + * if true the textbox can lose focus by clicking elsewhere on the screen + */ + private boolean canLoseFocus = true; + + /** + * If this value is true along isEnabled, keyTyped will process the keys. + */ + private boolean isFocused; + + /** + * If this value is true along isFocused, keyTyped will process the keys. + */ + private boolean isEnabled = true; + + /** + * The current character index that should be used as start of the rendered + * text. + */ + private int lineScrollOffset; + private int cursorPosition; + + /** other selection position, maybe the same as the cursor */ + private int selectionEnd; + private int enabledColor = 14737632; + private int disabledColor = 7368816; + + /** True if this textbox is visible */ + private boolean visible = true; + + public SearchBar(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5) { + this.fontRenderer = par1FontRenderer; + this.xPos = par2; + this.yPos = par3; + this.width = par4; + this.height = par5; + } + + public void setWidth(int x) { + this.width = x; + } + + /** + * Increments the cursor counter + */ + public void updateCursorCounter() { + ++this.cursorCounter; + } + + /** + * Sets the text of the textbox. + */ + public void setText(String par1Str) { + if (par1Str.length() > this.maxStringLength) { + this.text = par1Str.substring(0, this.maxStringLength); + } else { + this.text = par1Str; + } + + this.setCursorPositionEnd(); + } + + /** + * Returns the text beign edited on the textbox. + */ + public String getText() { + return this.text; + } + + /** + * @return returns the text between the cursor and selectionEnd + */ + public String getSelectedtext() { + int var1 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int var2 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; + return this.text.substring(var1, var2); + } + + /** + * replaces selected text, or inserts text at the position on the cursor + */ + public void writeText(String par1Str) { + String var2 = ""; + String var3 = ChatAllowedCharacters.filterAllowedCharacters(par1Str); + int var4 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int var5 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; + int var6 = this.maxStringLength - this.text.length() - (var4 - this.selectionEnd); + boolean var7 = false; + + if (this.text.length() > 0) { + var2 = var2 + this.text.substring(0, var4); + } + + int var8; + + if (var6 < var3.length()) { + var2 = var2 + var3.substring(0, var6); + var8 = var6; + } else { + var2 = var2 + var3; + var8 = var3.length(); + } + + if (this.text.length() > 0 && var5 < this.text.length()) { + var2 = var2 + this.text.substring(var5); + } + + this.text = var2; + this.moveCursorBy(var4 - this.selectionEnd + var8); + } + + /** + * Deletes the specified number of words starting at the cursor position. + * Negative numbers will delete words left of the cursor. + */ + public void deleteWords(int par1) { + if (this.text.length() != 0) { + if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { + this.deleteFromCursor(this.getNthWordFromCursor(par1) - this.cursorPosition); + } + } + } + + /** + * delete the selected text, otherwsie deletes characters from either side + * of the cursor. params: delete num + */ + public void deleteFromCursor(int par1) { + if (this.text.length() != 0) { + if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { + boolean var2 = par1 < 0; + int var3 = var2 ? this.cursorPosition + par1 : this.cursorPosition; + int var4 = var2 ? this.cursorPosition : this.cursorPosition + par1; + String var5 = ""; + + if (var3 >= 0) { + var5 = this.text.substring(0, var3); + } + + if (var4 < this.text.length()) { + var5 = var5 + this.text.substring(var4); + } + + this.text = var5; + + if (var2) { + this.moveCursorBy(par1); + } + } + } + } + + /** + * see @getNthNextWordFromPos() params: N, position + */ + public int getNthWordFromCursor(int par1) { + return this.getNthWordFromPos(par1, this.getCursorPosition()); + } + + /** + * gets the position of the nth word. N may be negative, then it looks + * backwards. params: N, position + */ + public int getNthWordFromPos(int par1, int par2) { + return this.func_73798_a(par1, this.getCursorPosition(), true); + } + + public int func_73798_a(int par1, int par2, boolean par3) { + int var4 = par2; + boolean var5 = par1 < 0; + int var6 = Math.abs(par1); + + for (int var7 = 0; var7 < var6; ++var7) { + if (var5) { + while (par3 && var4 > 0 && this.text.charAt(var4 - 1) == 32) { + --var4; + } + + while (var4 > 0 && this.text.charAt(var4 - 1) != 32) { + --var4; + } + } else { + int var8 = this.text.length(); + var4 = this.text.indexOf(32, var4); + + if (var4 == -1) { + var4 = var8; + } else { + while (par3 && var4 < var8 && this.text.charAt(var4) == 32) { + ++var4; + } + } + } + } + + return var4; + } + + /** + * Moves the text cursor by a specified number of characters and clears the + * selection + */ + public void moveCursorBy(int par1) { + this.setCursorPosition(this.selectionEnd + par1); + } + + /** + * sets the position of the cursor to the provided index + */ + public void setCursorPosition(int par1) { + this.cursorPosition = par1; + int var2 = this.text.length(); + + if (this.cursorPosition < 0) { + this.cursorPosition = 0; + } + + if (this.cursorPosition > var2) { + this.cursorPosition = var2; + } + + this.setSelectionPos(this.cursorPosition); + } + + /** + * sets the cursors position to the beginning + */ + public void setCursorPositionZero() { + this.setCursorPosition(0); + } + + /** + * sets the cursors position to after the text + */ + public void setCursorPositionEnd() { + this.setCursorPosition(this.text.length()); + } + + /** + * Call this method from you GuiScreen to process the keys into textbox. + */ + public boolean textboxKeyTyped(char par1, int par2) { + if (this.isEnabled && this.isFocused) { + switch (par1) { + case 1: + this.setCursorPositionEnd(); + this.setSelectionPos(0); + return true; + + case 3: + GuiScreen.setClipboardString(this.getSelectedtext()); + return true; + + case 22: + this.writeText(GuiScreen.getClipboardString()); + return true; + + case 24: + GuiScreen.setClipboardString(this.getSelectedtext()); + this.writeText(""); + return true; + + default: + switch (par2) { + case 14: + if (GuiScreen.isCtrlKeyDown()) { + this.deleteWords(-1); + } else { + this.deleteFromCursor(-1); + } + + return true; + + case 199: + if (GuiScreen.isShiftKeyDown()) { + this.setSelectionPos(0); + } else { + this.setCursorPositionZero(); + } + + return true; + + case 203: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); + } else { + this.setSelectionPos(this.getSelectionEnd() - 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.setCursorPosition(this.getNthWordFromCursor(-1)); + } else { + this.moveCursorBy(-1); + } + + return true; + + case 205: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); + } else { + this.setSelectionPos(this.getSelectionEnd() + 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.setCursorPosition(this.getNthWordFromCursor(1)); + } else { + this.moveCursorBy(1); + } + + return true; + + case 207: + if (GuiScreen.isShiftKeyDown()) { + this.setSelectionPos(this.text.length()); + } else { + this.setCursorPositionEnd(); + } + + return true; + + case 211: + if (GuiScreen.isCtrlKeyDown()) { + this.deleteWords(1); + } else { + this.deleteFromCursor(1); + } + + return true; + + default: + if (ChatAllowedCharacters.isAllowedCharacter(par1)) { + this.writeText(Character.toString(par1)); + return true; + } else { + return false; + } + } + } + } else { + return false; + } + } + + /** + * Args: x, y, buttonClicked + */ + public void mouseClicked(int par1, int par2, int par3) { + boolean var4 = par1 >= this.xPos && par1 < this.xPos + this.width && par2 >= this.yPos && par2 < this.yPos + this.height; + + if (this.canLoseFocus) { + this.setFocused(this.isEnabled && var4); + } + + if (this.isFocused && par3 == 0) { + int var5 = par1 - this.xPos; + + if (this.enableBackgroundDrawing) { + var5 -= 4; + } + + String var6 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + this.setCursorPosition(this.fontRenderer.trimStringToWidth(var6, var5).length() + this.lineScrollOffset); + } + } + + /** + * Draws the textbox + */ + public void drawTextBox() { + if (this.getVisible()) { + if (this.getEnableBackgroundDrawing()) { + drawRect(this.xPos - 1, this.yPos - 1, this.xPos + this.width + 1, this.yPos + this.height + 1, -6250336); + drawRect(this.xPos, this.yPos, this.xPos + this.width, this.yPos + this.height, -16777216); + } + + int var1 = this.isEnabled ? this.enabledColor : this.disabledColor; + int var2 = this.cursorPosition - this.lineScrollOffset; + int var3 = this.selectionEnd - this.lineScrollOffset; + String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + boolean var5 = var2 >= 0 && var2 <= var4.length(); + boolean var6 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && var5; + int var7 = this.enableBackgroundDrawing ? this.xPos + 4 : this.xPos; + int var8 = this.enableBackgroundDrawing ? this.yPos + (this.height - 8) / 2 : this.yPos; + int var9 = var7; + + if (var3 > var4.length()) { + var3 = var4.length(); + } + + if (var4.length() > 0) { + String var10 = var5 ? var4.substring(0, var2) : var4; + var9 = this.fontRenderer.drawStringWithShadow(var10, var7, var8, var1); + } else { + if (!isFocused) { + drawString(fontRenderer, I18n.format("search"), var7, var8, 0xa0a0a0); + } + } + + boolean var13 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); + int var11 = var9; + + if (!var5) { + var11 = var2 > 0 ? var7 + this.width : var7; + } else if (var13) { + var11 = var9 - 1; + --var9; + } + + if (var4.length() > 0 && var5 && var2 < var4.length()) { + this.fontRenderer.drawStringWithShadow(var4.substring(var2), var9, var8, var1); + } + + if (var6) { + if (var13) { + Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272); + } else { + this.fontRenderer.drawStringWithShadow("_", var11, var8, var1); + } + } + + if (var3 != var2) { + int var12 = var7 + this.fontRenderer.getStringWidth(var4.substring(0, var3)); + this.drawCursorVertical(var11, var8 - 1, var12 - 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT); + } + } + } + + /** + * draws the vertical line cursor in the textbox + */ + private void drawCursorVertical(int par1, int par2, int par3, int par4) { + int var5; + + if (par1 < par3) { + var5 = par1; + par1 = par3; + par3 = var5; + } + + if (par2 < par4) { + var5 = par2; + par2 = par4; + par4 = var5; + } + + Tessellator var6 = Tessellator.instance; + GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); + GL11.glLogicOp(GL11.GL_OR_REVERSE); + var6.startDrawingQuads(); + var6.addVertex((double) par1, (double) par4, 0.0D); + var6.addVertex((double) par3, (double) par4, 0.0D); + var6.addVertex((double) par3, (double) par2, 0.0D); + var6.addVertex((double) par1, (double) par2, 0.0D); + var6.draw(); + GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public void setMaxStringLength(int par1) { + this.maxStringLength = par1; + + if (this.text.length() > par1) { + this.text = this.text.substring(0, par1); + } + } + + /** + * returns the maximum number of character that can be contained in this + * textbox + */ + public int getMaxStringLength() { + return this.maxStringLength; + } + + /** + * returns the current position of the cursor + */ + public int getCursorPosition() { + return this.cursorPosition; + } + + /** + * get enable drawing background and outline + */ + public boolean getEnableBackgroundDrawing() { + return this.enableBackgroundDrawing; + } + + /** + * enable drawing background and outline + */ + public void setEnableBackgroundDrawing(boolean par1) { + this.enableBackgroundDrawing = par1; + } + + /** + * Sets the text colour for this textbox (disabled text will not use this + * colour) + */ + public void setTextColor(int par1) { + this.enabledColor = par1; + } + + public void setDisabledTextColour(int par1) { + this.disabledColor = par1; + } + + /** + * setter for the focused field + */ + public void setFocused(boolean par1) { + if (par1 && !this.isFocused) { + this.cursorCounter = 0; + } + + this.isFocused = par1; + } + + /** + * getter for the focused field + */ + public boolean isFocused() { + return this.isFocused; + } + + public void setEnabled(boolean par1) { + this.isEnabled = par1; + } + + /** + * the side of the selection that is not the cursor, maye be the same as the + * cursor + */ + public int getSelectionEnd() { + return this.selectionEnd; + } + + /** + * returns the width of the textbox depending on if the the box is enabled + */ + public int getWidth() { + return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; + } + + /** + * Sets the position of the selection anchor (i.e. position the selection + * was started at) + */ + public void setSelectionPos(int par1) { + int var2 = this.text.length(); + + if (par1 > var2) { + par1 = var2; + } + + if (par1 < 0) { + par1 = 0; + } + + this.selectionEnd = par1; + + if (this.fontRenderer != null) { + if (this.lineScrollOffset > var2) { + this.lineScrollOffset = var2; + } + + int var3 = this.getWidth(); + String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), var3); + int var5 = var4.length() + this.lineScrollOffset; + + if (par1 == this.lineScrollOffset) { + this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.text, var3, true).length(); + } + + if (par1 > var5) { + this.lineScrollOffset += par1 - var5; + } else if (par1 <= this.lineScrollOffset) { + this.lineScrollOffset -= this.lineScrollOffset - par1; + } + + if (this.lineScrollOffset < 0) { + this.lineScrollOffset = 0; + } + + if (this.lineScrollOffset > var2) { + this.lineScrollOffset = var2; + } + } + } + + /** + * if true the textbox can lose focus by clicking elsewhere on the screen + */ + public void setCanLoseFocus(boolean par1) { + this.canLoseFocus = par1; + } + + /** + * @return {@code true} if this textbox is visible + */ + public boolean getVisible() { + return this.visible; + } + + /** + * Sets whether or not this textbox is visible + */ + public void setVisible(boolean par1) { + this.visible = par1; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java b/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java rename to src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java index 42b3e98..0f554af 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java +++ b/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java @@ -1,90 +1,90 @@ -package com.thatapplefreak.voxelcam.gui.settings; - -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thevoxelbox.common.gui.GuiVoxelBoxSettingsPanel; -import com.thevoxelbox.common.util.properties.VoxelPropertyAbstractButton; -import com.thevoxelbox.common.util.properties.VoxelPropertyCheckBox; -import com.thevoxelbox.common.util.properties.VoxelPropertyIntField; -import com.thevoxelbox.common.util.properties.VoxelPropertyLabel; - -public class GuiVoxelCamSettingsPanel extends GuiVoxelBoxSettingsPanel { - - private static final int max = 999999999; - private static final int min = 30; - - private VoxelPropertyIntField widthField; - private VoxelPropertyIntField heightField; - - public GuiVoxelCamSettingsPanel() { - config = VoxelCamCore.getConfig(); - } - - @Override - public void initGui() { - super.initGui(); - - // Mega Screenshot settings - properties.add(new VoxelPropertyLabel(I18n.format("megascreenshotsettings"), PANEL_LEFT + 15, PANEL_TOP + 10)); - widthField = new VoxelPropertyIntFieldEX(VoxelCamCore.getConfig(), VoxelCamConfig.PHOTOWIDTH, I18n.format("width"), PANEL_LEFT + 20, PANEL_TOP + 25, 40); - heightField = new VoxelPropertyIntFieldEX(VoxelCamCore.getConfig(), VoxelCamConfig.PHOTOHEIGHT, I18n.format("height"), PANEL_LEFT + 20, PANEL_TOP + 45, 40); - widthField.setMaxFieldValue(max); - widthField.setMinFieldValue(min); - properties.add(widthField); - heightField.setMaxFieldValue(max); - heightField.setMinFieldValue(min); - properties.add(heightField); - properties.add(new VoxelPropertyAbstractButton(config, null, "720p", PANEL_LEFT + 70, PANEL_TOP + 24) { - @Override - protected void onClick() { - config.setProperty(VoxelCamConfig.PHOTOWIDTH, 1280); - config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 720); - updateFields(); - } - }); - properties.add(new VoxelPropertyAbstractButton(config, null, "1080p", PANEL_LEFT + 70, PANEL_TOP + 44) { - @Override - protected void onClick() { - config.setProperty(VoxelCamConfig.PHOTOWIDTH, 1920); - config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 1080); - updateFields(); - } - }); - properties.add(new VoxelPropertyAbstractButton(config, null, "4K (2160p)", PANEL_LEFT + 145, PANEL_TOP + 24) { - @Override - protected void onClick() { - config.setProperty(VoxelCamConfig.PHOTOWIDTH, 3840); - config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 2160); - updateFields(); - } - }); - properties.add(new VoxelPropertyAbstractButton(config, null, "IMAX", PANEL_LEFT + 145, PANEL_TOP + 44) { - @Override - protected void onClick() { - config.setProperty(VoxelCamConfig.PHOTOWIDTH, 10000); - config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 7000); - updateFields(); - } - }); - properties.add(new VoxelPropertyLabel(I18n.format("memorywarning"), PANEL_LEFT + 10, PANEL_TOP + 65, 0xFF0000)); - - properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD, I18n.format("autouploadsocialmedia"), PANEL_LEFT + 10, PANEL_TOP + 80)); - - properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_IMGUR, I18n.format("to") + " Imgur", PANEL_LEFT + 20, PANEL_TOP + 95)); - properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_DROPBOX, I18n.format("to") + " Dropbox", PANEL_LEFT + 20, PANEL_TOP + 110)); - properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_GOOGLEDRIVE, I18n.format("to") + " Google Drive", PANEL_LEFT + 20, PANEL_TOP + 125)); - } - - private void updateFields() { - widthField.update(); - heightField.update(); - } - - @Override - public String getPanelTitle() { - return "VoxelCam Settings"; - } - +package com.thatapplefreak.voxelcam.gui.settings; + +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thevoxelbox.common.gui.GuiVoxelBoxSettingsPanel; +import com.thevoxelbox.common.util.properties.VoxelPropertyAbstractButton; +import com.thevoxelbox.common.util.properties.VoxelPropertyCheckBox; +import com.thevoxelbox.common.util.properties.VoxelPropertyIntField; +import com.thevoxelbox.common.util.properties.VoxelPropertyLabel; + +public class GuiVoxelCamSettingsPanel extends GuiVoxelBoxSettingsPanel { + + private static final int max = 999999999; + private static final int min = 30; + + private VoxelPropertyIntField widthField; + private VoxelPropertyIntField heightField; + + public GuiVoxelCamSettingsPanel() { + config = VoxelCamCore.getConfig(); + } + + @Override + public void initGui() { + super.initGui(); + + // Mega Screenshot settings + properties.add(new VoxelPropertyLabel(I18n.format("megascreenshotsettings"), PANEL_LEFT + 15, PANEL_TOP + 10)); + widthField = new VoxelPropertyIntFieldEX(VoxelCamCore.getConfig(), VoxelCamConfig.PHOTOWIDTH, I18n.format("width"), PANEL_LEFT + 20, PANEL_TOP + 25, 40); + heightField = new VoxelPropertyIntFieldEX(VoxelCamCore.getConfig(), VoxelCamConfig.PHOTOHEIGHT, I18n.format("height"), PANEL_LEFT + 20, PANEL_TOP + 45, 40); + widthField.setMaxFieldValue(max); + widthField.setMinFieldValue(min); + properties.add(widthField); + heightField.setMaxFieldValue(max); + heightField.setMinFieldValue(min); + properties.add(heightField); + properties.add(new VoxelPropertyAbstractButton(config, null, "720p", PANEL_LEFT + 70, PANEL_TOP + 24) { + @Override + protected void onClick() { + config.setProperty(VoxelCamConfig.PHOTOWIDTH, 1280); + config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 720); + updateFields(); + } + }); + properties.add(new VoxelPropertyAbstractButton(config, null, "1080p", PANEL_LEFT + 70, PANEL_TOP + 44) { + @Override + protected void onClick() { + config.setProperty(VoxelCamConfig.PHOTOWIDTH, 1920); + config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 1080); + updateFields(); + } + }); + properties.add(new VoxelPropertyAbstractButton(config, null, "4K (2160p)", PANEL_LEFT + 145, PANEL_TOP + 24) { + @Override + protected void onClick() { + config.setProperty(VoxelCamConfig.PHOTOWIDTH, 3840); + config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 2160); + updateFields(); + } + }); + properties.add(new VoxelPropertyAbstractButton(config, null, "IMAX", PANEL_LEFT + 145, PANEL_TOP + 44) { + @Override + protected void onClick() { + config.setProperty(VoxelCamConfig.PHOTOWIDTH, 10000); + config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 7000); + updateFields(); + } + }); + properties.add(new VoxelPropertyLabel(I18n.format("memorywarning"), PANEL_LEFT + 10, PANEL_TOP + 65, 0xFF0000)); + + properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD, I18n.format("autouploadsocialmedia"), PANEL_LEFT + 10, PANEL_TOP + 80)); + + properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_IMGUR, I18n.format("to") + " Imgur", PANEL_LEFT + 20, PANEL_TOP + 95)); + properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_DROPBOX, I18n.format("to") + " Dropbox", PANEL_LEFT + 20, PANEL_TOP + 110)); + properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_GOOGLEDRIVE, I18n.format("to") + " Google Drive", PANEL_LEFT + 20, PANEL_TOP + 125)); + } + + private void updateFields() { + widthField.update(); + heightField.update(); + } + + @Override + public String getPanelTitle() { + return "VoxelCam Settings"; + } + } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java b/src/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java rename to src/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java index 4e63c34..bdad957 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java +++ b/src/com/thatapplefreak/voxelcam/gui/settings/VoxelPropertyIntFieldEX.java @@ -1,47 +1,47 @@ -package com.thatapplefreak.voxelcam.gui.settings; - -import org.lwjgl.input.Keyboard; - -import com.thevoxelbox.common.interfaces.IVoxelPropertyProvider; -import com.thevoxelbox.common.util.properties.VoxelPropertyIntField; - - -public class VoxelPropertyIntFieldEX extends VoxelPropertyIntField { - - public VoxelPropertyIntFieldEX(IVoxelPropertyProvider parent, String binding, String text, int xPos, int yPos, int fieldOffset) { - super(parent, binding, text, xPos, yPos, fieldOffset); - fieldWidth = 62; - } - - @Override - public void keyTyped(char keyChar, int keyCode) { - if (this.focused) { - if (keyCode == Keyboard.KEY_RETURN || keyCode == Keyboard.KEY_NUMPADENTER || keyCode == Keyboard.KEY_ESCAPE) { - onLostFocus(); - } - - if (keyCode == Keyboard.KEY_BACK && fieldValue.length() > 0) { - fieldValue = fieldValue.substring(0, fieldValue.length() - 1); - } - - if (keyCode == Keyboard.KEY_PERIOD && allowedCharacters.indexOf('.') >= 0) { - if (fieldValue.indexOf(keyChar) >= 0) { - return; - } - if (fieldValue.length() == 0) { - fieldValue += "0"; - } - } - - String lastVal = fieldValue; - if (allowedCharacters.indexOf(keyChar) >= 0 && fieldValue.length() < 6) { - fieldValue += keyChar; - } - - if (checkInvalidValue()) { - fieldValue = lastVal; - } - } - } - -} +package com.thatapplefreak.voxelcam.gui.settings; + +import org.lwjgl.input.Keyboard; + +import com.thevoxelbox.common.interfaces.IVoxelPropertyProvider; +import com.thevoxelbox.common.util.properties.VoxelPropertyIntField; + + +public class VoxelPropertyIntFieldEX extends VoxelPropertyIntField { + + public VoxelPropertyIntFieldEX(IVoxelPropertyProvider parent, String binding, String text, int xPos, int yPos, int fieldOffset) { + super(parent, binding, text, xPos, yPos, fieldOffset); + fieldWidth = 62; + } + + @Override + public void keyTyped(char keyChar, int keyCode) { + if (this.focused) { + if (keyCode == Keyboard.KEY_RETURN || keyCode == Keyboard.KEY_NUMPADENTER || keyCode == Keyboard.KEY_ESCAPE) { + onLostFocus(); + } + + if (keyCode == Keyboard.KEY_BACK && fieldValue.length() > 0) { + fieldValue = fieldValue.substring(0, fieldValue.length() - 1); + } + + if (keyCode == Keyboard.KEY_PERIOD && allowedCharacters.indexOf('.') >= 0) { + if (fieldValue.indexOf(keyChar) >= 0) { + return; + } + if (fieldValue.length() == 0) { + fieldValue += "0"; + } + } + + String lastVal = fieldValue; + if (allowedCharacters.indexOf(keyChar) >= 0 && fieldValue.length() < 6) { + fieldValue += keyChar; + } + + if (checkInvalidValue()) { + fieldValue = lastVal; + } + } + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java b/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java rename to src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java index 2e24118..03266e5 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java @@ -1,86 +1,86 @@ -package com.thatapplefreak.voxelcam.imagehandle; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.imageio.ImageIO; - -import net.minecraft.client.Minecraft; - -import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.GL11; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thevoxelbox.common.gl.FBO; -import com.thevoxelbox.common.util.PrivateFields; -import com.thevoxelbox.common.util.PrivateMethods; - -/** - * Takes a big screenshot - * - * @author thatapplefreak - * - */ -public abstract class BigScreenshotTaker { - - /** - * The original width of minecraft - */ - private static int originalWidthOfScreen; - - /** - * The original height of minecraft - */ - private static int originalHeightOfScreen; - - /** - * Waiting for minecraft to render to take a screenshot - */ - private static boolean waiting; - - /** - * The FrameBuffer that the big screenshot gets rendered to - */ - private static FBO fbo; - - public static void run() { - Minecraft.getMinecraft().gameSettings.hideGUI = true; - originalWidthOfScreen = Minecraft.getMinecraft().displayWidth; - originalHeightOfScreen = Minecraft.getMinecraft().displayHeight; - resizeMinecraft(VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOWIDTH), VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOHEIGHT)); - fbo = new FBO(); - fbo.begin(VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOWIDTH), VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOHEIGHT)); - waiting = true; - } - - /** - * Sets minecraft to a custom size - */ - private static void resizeMinecraft(final int width, final int height) { - PrivateMethods.resizeMinecraft.invokeVoid(Minecraft.getMinecraft(), width, height); - } - - /** - * Returns Minecraft to it's original width and height - */ - private static void returnMinecraftToNormal() { - PrivateMethods.resizeMinecraft.invokeVoid(Minecraft.getMinecraft(), originalWidthOfScreen, originalHeightOfScreen); - } - - public static void onTick() { - if (waiting) { - ScreenshotTaker.capture(VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOWIDTH), VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOHEIGHT)); - fbo.end(); - fbo.dispose(); - returnMinecraftToNormal(); - Minecraft.getMinecraft().gameSettings.hideGUI = false; - waiting = false; - } - } - -} +package com.thatapplefreak.voxelcam.imagehandle; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.SimpleDateFormat; +import java.util.Date; + +import javax.imageio.ImageIO; + +import net.minecraft.client.Minecraft; + +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thevoxelbox.common.gl.FBO; +import com.thevoxelbox.common.util.PrivateFields; +import com.thevoxelbox.common.util.PrivateMethods; + +/** + * Takes a big screenshot + * + * @author thatapplefreak + * + */ +public abstract class BigScreenshotTaker { + + /** + * The original width of minecraft + */ + private static int originalWidthOfScreen; + + /** + * The original height of minecraft + */ + private static int originalHeightOfScreen; + + /** + * Waiting for minecraft to render to take a screenshot + */ + private static boolean waiting; + + /** + * The FrameBuffer that the big screenshot gets rendered to + */ + private static FBO fbo; + + public static void run() { + Minecraft.getMinecraft().gameSettings.hideGUI = true; + originalWidthOfScreen = Minecraft.getMinecraft().displayWidth; + originalHeightOfScreen = Minecraft.getMinecraft().displayHeight; + resizeMinecraft(VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOWIDTH), VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOHEIGHT)); + fbo = new FBO(); + fbo.begin(VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOWIDTH), VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOHEIGHT)); + waiting = true; + } + + /** + * Sets minecraft to a custom size + */ + private static void resizeMinecraft(final int width, final int height) { + PrivateMethods.resizeMinecraft.invokeVoid(Minecraft.getMinecraft(), width, height); + } + + /** + * Returns Minecraft to it's original width and height + */ + private static void returnMinecraftToNormal() { + PrivateMethods.resizeMinecraft.invokeVoid(Minecraft.getMinecraft(), originalWidthOfScreen, originalHeightOfScreen); + } + + public static void onTick() { + if (waiting) { + ScreenshotTaker.capture(VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOWIDTH), VoxelCamCore.getConfig().getIntProperty(VoxelCamConfig.PHOTOHEIGHT)); + fbo.end(); + fbo.dispose(); + returnMinecraftToNormal(); + Minecraft.getMinecraft().gameSettings.hideGUI = false; + waiting = false; + } + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java b/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java rename to src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java index 946cd95..9e2b2b8 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java @@ -1,86 +1,86 @@ -package com.thatapplefreak.voxelcam.imagehandle; - -import static org.lwjgl.opengl.GL11.glDeleteTextures; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.imageio.ImageIO; - -import net.minecraft.client.renderer.texture.TextureUtil; - -import org.lwjgl.LWJGLException; -import org.lwjgl.opengl.Display; - - -public abstract class GLImageMemoryHandler { - - /** - * Map of all the GL binding integers Key is always the files absolute path - */ - private static Map imageMap = new HashMap(); - - private static HashSet loadingImages = new HashSet(); - - /** - * Open GL magic voodoo - * - * @param imageFile - * @return - */ - public static void tryPutTextureIntoMem(final File imageFile) { - if (!imageMap.containsKey(imageFile.getAbsolutePath())) { - int textureName = TextureUtil.glGenTextures(); - imageMap.put(imageFile.getAbsolutePath(), textureName); -// new Thread("GL Image Loader") { -// @Override -// public void run() { - loadingImages.add(textureName); - try { - BufferedImage image = ImageIO.read(imageFile); - TextureUtil.uploadTextureImageAllocate(textureName, image, true, false); - loadingImages.remove(textureName); - } catch (IOException e) { - } -// } -// }.start(); - } - } - - /** - * If the image can be removed from memory free some up - * - * @param imageFile - */ - public static void requestImageRemovalFromMem(File imageFile) { - if (imageMap.containsKey(imageFile.getAbsolutePath())) { - glDeleteTextures(imageMap.get(imageFile.getAbsolutePath())); - imageMap.remove(imageFile.getAbsolutePath()); - } - } - - /** - * Flushes All images from memory - */ - public static void requestImageFlush() { - Set keyset = imageMap.keySet(); - for (String s : keyset) { - glDeleteTextures(imageMap.get(s)); - } - imageMap.clear(); - } - - public static int getImageGLName(File f) { - return imageMap.get(f.getAbsolutePath()); - } - - public static boolean loadingImage(int i) { - return loadingImages.contains(i); - } - -} +package com.thatapplefreak.voxelcam.imagehandle; + +import static org.lwjgl.opengl.GL11.glDeleteTextures; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.imageio.ImageIO; + +import net.minecraft.client.renderer.texture.TextureUtil; + +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.Display; + + +public abstract class GLImageMemoryHandler { + + /** + * Map of all the GL binding integers Key is always the files absolute path + */ + private static Map imageMap = new HashMap(); + + private static HashSet loadingImages = new HashSet(); + + /** + * Open GL magic voodoo + * + * @param imageFile + * @return + */ + public static void tryPutTextureIntoMem(final File imageFile) { + if (!imageMap.containsKey(imageFile.getAbsolutePath())) { + int textureName = TextureUtil.glGenTextures(); + imageMap.put(imageFile.getAbsolutePath(), textureName); +// new Thread("GL Image Loader") { +// @Override +// public void run() { + loadingImages.add(textureName); + try { + BufferedImage image = ImageIO.read(imageFile); + TextureUtil.uploadTextureImageAllocate(textureName, image, true, false); + loadingImages.remove(textureName); + } catch (IOException e) { + } +// } +// }.start(); + } + } + + /** + * If the image can be removed from memory free some up + * + * @param imageFile + */ + public static void requestImageRemovalFromMem(File imageFile) { + if (imageMap.containsKey(imageFile.getAbsolutePath())) { + glDeleteTextures(imageMap.get(imageFile.getAbsolutePath())); + imageMap.remove(imageFile.getAbsolutePath()); + } + } + + /** + * Flushes All images from memory + */ + public static void requestImageFlush() { + Set keyset = imageMap.keySet(); + for (String s : keyset) { + glDeleteTextures(imageMap.get(s)); + } + imageMap.clear(); + } + + public static int getImageGLName(File f) { + return imageMap.get(f.getAbsolutePath()); + } + + public static boolean loadingImage(int i) { + return loadingImages.contains(i); + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java b/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java rename to src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java index 8d33ba5..bf7e37e 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java @@ -1,46 +1,46 @@ -package com.thatapplefreak.voxelcam.imagehandle; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.imageio.ImageIO; - -import net.minecraft.client.renderer.Tessellator; -import static org.lwjgl.opengl.GL11.*; - -/** - * Utility Class that can take any File that is an image and draw it to a gui - * - * @author thatapplefreak - */ -public abstract class ImageDrawer { - - /** - * Draws the image given the top left and bottom right corners - * - * @param img - * GL integer name of the texture - * @param x - * x coordinate of the top left corner - * @param y - * y coordinate of the top left corner - * @param x2 - * x coordinate of the bottom right corner - * @param y2 - * y coordinate of the bottom right corner - */ - public static void drawImageToGui(int img, int x, int y, int x2, int y2) { - glBindTexture(GL_TEXTURE_2D, img); - glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(x, y2, 0, 0, 1); - tessellator.addVertexWithUV(x2, y2, 0, 1, 1); - tessellator.addVertexWithUV(x2, y, 0, 1, 0); - tessellator.addVertexWithUV(x, y, 0, 0, 0); - tessellator.draw(); - } -} +package com.thatapplefreak.voxelcam.imagehandle; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.imageio.ImageIO; + +import net.minecraft.client.renderer.Tessellator; +import static org.lwjgl.opengl.GL11.*; + +/** + * Utility Class that can take any File that is an image and draw it to a gui + * + * @author thatapplefreak + */ +public abstract class ImageDrawer { + + /** + * Draws the image given the top left and bottom right corners + * + * @param img + * GL integer name of the texture + * @param x + * x coordinate of the top left corner + * @param y + * y coordinate of the top left corner + * @param x2 + * x coordinate of the bottom right corner + * @param y2 + * y coordinate of the bottom right corner + */ + public static void drawImageToGui(int img, int x, int y, int x2, int y2) { + glBindTexture(GL_TEXTURE_2D, img); + glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(x, y2, 0, 0, 1); + tessellator.addVertexWithUV(x2, y2, 0, 1, 1); + tessellator.addVertexWithUV(x2, y, 0, 1, 0); + tessellator.addVertexWithUV(x, y, 0, 0, 0); + tessellator.draw(); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java rename to src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java index 9ae922b..c3bec0c 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotIncapable.java @@ -1,6 +1,6 @@ -package com.thatapplefreak.voxelcam.imagehandle; - -/** - * implemented in GuiScreens that cannot be screenshoted due to image saving on diffenent thread - */ +package com.thatapplefreak.voxelcam.imagehandle; + +/** + * implemented in GuiScreens that cannot be screenshoted due to image saving on diffenent thread + */ public interface ScreenshotIncapable {} \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java rename to src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java index 72bb09e..b22638f 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java @@ -1,30 +1,30 @@ -package com.thatapplefreak.voxelcam.imagehandle; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; - -import net.minecraft.client.Minecraft; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thevoxelbox.common.util.PrivateFields; - -public abstract class ScreenshotNamer { - - public static File getScreenshotName() { - - String name = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(new Date()); - - int var3 = 1; - - while (true) { - File var1 = new File(VoxelCamCore.getScreenshotsDir(), name + (var3 == 1 ? "" : "_" + var3) + ".png"); - - if (!var1.exists()) { - return var1; - } - - ++var3; - } - } -} +package com.thatapplefreak.voxelcam.imagehandle; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; + +import net.minecraft.client.Minecraft; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thevoxelbox.common.util.PrivateFields; + +public abstract class ScreenshotNamer { + + public static File getScreenshotName() { + + String name = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(new Date()); + + int var3 = 1; + + while (true) { + File var1 = new File(VoxelCamCore.getScreenshotsDir(), name + (var3 == 1 ? "" : "_" + var3) + ".png"); + + if (!var1.exists()) { + return var1; + } + + ++var3; + } + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java rename to src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java index 623b3df..27220fb 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java @@ -1,128 +1,128 @@ -package com.thatapplefreak.voxelcam.imagehandle; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import javax.imageio.ImageIO; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.texture.TextureUtil; -import net.minecraft.client.resources.I18n; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; - -import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.imagehandle.metadata.MetaDataHandler; -import com.thatapplefreak.voxelcam.upload.AutoUploader; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.ChatMessageBuilder; - -public abstract class ScreenshotTaker { - - public static void capture(int width, int height) { - Minecraft mc = Minecraft.getMinecraft(); - if (OpenGlHelper.isFramebufferEnabled()) { - width = mc.getFramebuffer().framebufferTextureWidth; - height = mc.getFramebuffer().framebufferTextureHeight; - } - int totalPixels = width * height; - - IntBuffer pixelBuffer = BufferUtils.createIntBuffer(totalPixels); - int[] pixelValues = new int[totalPixels]; - - GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); - GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); - - if (OpenGlHelper.isFramebufferEnabled()) { - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.getFramebuffer().framebufferTexture); - GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); - } else { - GL11.glReadPixels(0, 0, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); - } - - pixelBuffer.get(pixelValues); - TextureUtil.func_147953_a(pixelValues, width, height); - - - final File screenshotName = ScreenshotNamer.getScreenshotName(); - save(pixelValues, width, height, screenshotName); - } - - private static int savepercent = 0; - private static boolean isWritingToFile = false; - - private static void save(final int[] pixelValues, final int width, final int height, final File saveTo) { - Thread imageSaveThread = new Thread("ImageSaver") { - @Override - public void run() { - VoxelCamCore.screenshotIsSaving = true; - BufferedImage image; - if (OpenGlHelper.isFramebufferEnabled()) { - image = new BufferedImage(width, height, 1); - - double currentPixel = 0; - double totalPixels = pixelValues.length; - - for (int h = 0; h < height; ++h) { - for (int w = 0; w < width; ++w) { - image.setRGB(w, h, pixelValues[h * width + w]); - currentPixel++; - savepercent = (int) ((currentPixel / totalPixels) * 100); - } - } - - } else { - image = new BufferedImage(width, height, 1); - savepercent = 100; - image.setRGB(0, 0, width, height, pixelValues, 0, width); - } - - try { - isWritingToFile = true; - ImageIO.write(image, "png", saveTo); - MetaDataHandler.writeMetaData(saveTo); - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("savedscreenshotas") + ": "); - cmb.append(saveTo.getName(), saveTo.getPath(), false); - cmb.showChatMessageIngame(); - VoxelCamCore.screenshotIsSaving = false; - isWritingToFile = false; - upload(saveTo); - } catch (IOException e) { - e.printStackTrace(); - } - } - }; - imageSaveThread.setPriority(5); - imageSaveThread.start(); - } - - public static boolean isWritingToFile() { - return isWritingToFile; - } - - public static int getSavePercent() { - return savepercent; - } - - private static void upload(final File saveTo) { - if (VoxelCamCore.getConfig().getBoolProperty(VoxelCamConfig.AUTO_UPLOAD)) { - AutoUploader.upload(saveTo); - } - } - -} +package com.thatapplefreak.voxelcam.imagehandle; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import javax.imageio.ImageIO; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.imagehandle.metadata.MetaDataHandler; +import com.thatapplefreak.voxelcam.upload.AutoUploader; +import com.thevoxelbox.common.util.AbstractionLayer; +import com.thevoxelbox.common.util.ChatMessageBuilder; + +public abstract class ScreenshotTaker { + + public static void capture(int width, int height) { + Minecraft mc = Minecraft.getMinecraft(); + if (OpenGlHelper.isFramebufferEnabled()) { + width = mc.getFramebuffer().framebufferTextureWidth; + height = mc.getFramebuffer().framebufferTextureHeight; + } + int totalPixels = width * height; + + IntBuffer pixelBuffer = BufferUtils.createIntBuffer(totalPixels); + int[] pixelValues = new int[totalPixels]; + + GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); + GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); + + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.getFramebuffer().framebufferTexture); + GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); + } else { + GL11.glReadPixels(0, 0, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); + } + + pixelBuffer.get(pixelValues); + TextureUtil.func_147953_a(pixelValues, width, height); + + + final File screenshotName = ScreenshotNamer.getScreenshotName(); + save(pixelValues, width, height, screenshotName); + } + + private static int savepercent = 0; + private static boolean isWritingToFile = false; + + private static void save(final int[] pixelValues, final int width, final int height, final File saveTo) { + Thread imageSaveThread = new Thread("ImageSaver") { + @Override + public void run() { + VoxelCamCore.screenshotIsSaving = true; + BufferedImage image; + if (OpenGlHelper.isFramebufferEnabled()) { + image = new BufferedImage(width, height, 1); + + double currentPixel = 0; + double totalPixels = pixelValues.length; + + for (int h = 0; h < height; ++h) { + for (int w = 0; w < width; ++w) { + image.setRGB(w, h, pixelValues[h * width + w]); + currentPixel++; + savepercent = (int) ((currentPixel / totalPixels) * 100); + } + } + + } else { + image = new BufferedImage(width, height, 1); + savepercent = 100; + image.setRGB(0, 0, width, height, pixelValues, 0, width); + } + + try { + isWritingToFile = true; + ImageIO.write(image, "png", saveTo); + MetaDataHandler.writeMetaData(saveTo); + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("savedscreenshotas") + ": "); + cmb.append(saveTo.getName(), saveTo.getPath(), false); + cmb.showChatMessageIngame(); + VoxelCamCore.screenshotIsSaving = false; + isWritingToFile = false; + upload(saveTo); + } catch (IOException e) { + e.printStackTrace(); + } + } + }; + imageSaveThread.setPriority(5); + imageSaveThread.start(); + } + + public static boolean isWritingToFile() { + return isWritingToFile; + } + + public static int getSavePercent() { + return savepercent; + } + + private static void upload(final File saveTo) { + if (VoxelCamCore.getConfig().getBoolProperty(VoxelCamConfig.AUTO_UPLOAD)) { + AutoUploader.upload(saveTo); + } + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java b/src/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java rename to src/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java index fd30bd4..3889e4d 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/filters/Filter.java @@ -1,9 +1,9 @@ -package com.thatapplefreak.voxelcam.imagehandle.filters; - -import java.awt.image.BufferedImage; - -public interface Filter { - - public BufferedImage getFilteredImage(BufferedImage img); - -} +package com.thatapplefreak.voxelcam.imagehandle.filters; + +import java.awt.image.BufferedImage; + +public interface Filter { + + public BufferedImage getFilteredImage(BufferedImage img); + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java b/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java rename to src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java index dae2758..309cc27 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java @@ -1,34 +1,34 @@ -package com.thatapplefreak.voxelcam.imagehandle.metadata; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import net.minecraft.client.Minecraft; - -import com.mumfrey.liteloader.core.LiteLoader; - -public abstract class MetaDataHandler { - - public static void writeMetaData(File screenshot) { - Minecraft mc = Minecraft.getMinecraft(); - HashMap map = new HashMap(); - //Username - map.put("username", ""); - //Biome Taken in - map.put("biome", mc.theWorld != null ? mc.theWorld.getBiomeGenForCoords(mc.thePlayer.chunkCoordX, mc.thePlayer.chunkCoordZ).biomeName : "menu"); - - //TODO - } - - public static void readMetaData(File screenshot, String key) { - //TODO - } - - +package com.thatapplefreak.voxelcam.imagehandle.metadata; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import net.minecraft.client.Minecraft; + +import com.mumfrey.liteloader.core.LiteLoader; + +public abstract class MetaDataHandler { + + public static void writeMetaData(File screenshot) { + Minecraft mc = Minecraft.getMinecraft(); + HashMap map = new HashMap(); + //Username + map.put("username", ""); + //Biome Taken in + map.put("biome", mc.theWorld != null ? mc.theWorld.getBiomeGenForCoords(mc.thePlayer.chunkCoordX, mc.thePlayer.chunkCoordZ).biomeName : "menu"); + + //TODO + } + + public static void readMetaData(File screenshot, String key) { + //TODO + } + + } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java b/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java rename to src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java index 89168ed..855061a 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java +++ b/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java @@ -1,84 +1,84 @@ -package com.thatapplefreak.voxelcam.io; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; - -public abstract class VoxelCamIO { - - /** - * List of all PNG files in the screenshot directory - */ - private static ArrayList screenShotFiles; - - /** - * Index of the currently selected photo - */ - public static int selected = 0; - - public static ArrayList getScreenShotFiles() { - return screenShotFiles; - } - - public static void selectPhotoIndex(int i) { - selected = i; - } - - public static boolean isSelected(int i) { - return i == selected; - } - - public static void updateScreenShotFilesList(String filter) { - File[] filesInScreenshotDir = VoxelCamCore.getScreenshotsDir().listFiles(); - Arrays.sort(filesInScreenshotDir, new Comparator() { - @Override - public int compare(File f, File g) { - if (f.lastModified() > g.lastModified()) { - return -1; - } else if (f.lastModified() < g.lastModified()) { - return 1; - } else { - return 0; - } - } - }); - VoxelCamIO.screenShotFiles = new ArrayList(Arrays.asList(filesInScreenshotDir)); - for (int i = getScreenShotFiles().size() - 1; i >= 0; i--) { - if (!getScreenShotFiles().get(i).getName().endsWith(".png")) { - getScreenShotFiles().remove(i); - } - } - for (int i = getScreenShotFiles().size() - 1; i >= 0; i--) { - if (!getScreenShotFiles().get(i).getName().contains(filter)) { - getScreenShotFiles().remove(i); - } - } - if (getScreenShotFiles().isEmpty()) { - getScreenShotFiles().add(null); - } - } - - public static void rename(String string) { - File newFile = new File(VoxelCamCore.getScreenshotsDir(), string + ".png"); - getSelectedPhoto().renameTo(newFile); - } - - public static void delete() { - GLImageMemoryHandler.requestImageRemovalFromMem(getSelectedPhoto()); - getSelectedPhoto().delete(); // EXTERMINATE! - getScreenShotFiles().remove(VoxelCamIO.selected); // remove refrence - if (selected > 0) { - selected--; - } - } - - public static File getSelectedPhoto() { - return getScreenShotFiles().get(selected); - } - -} +package com.thatapplefreak.voxelcam.io; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; + +public abstract class VoxelCamIO { + + /** + * List of all PNG files in the screenshot directory + */ + private static ArrayList screenShotFiles; + + /** + * Index of the currently selected photo + */ + public static int selected = 0; + + public static ArrayList getScreenShotFiles() { + return screenShotFiles; + } + + public static void selectPhotoIndex(int i) { + selected = i; + } + + public static boolean isSelected(int i) { + return i == selected; + } + + public static void updateScreenShotFilesList(String filter) { + File[] filesInScreenshotDir = VoxelCamCore.getScreenshotsDir().listFiles(); + Arrays.sort(filesInScreenshotDir, new Comparator() { + @Override + public int compare(File f, File g) { + if (f.lastModified() > g.lastModified()) { + return -1; + } else if (f.lastModified() < g.lastModified()) { + return 1; + } else { + return 0; + } + } + }); + VoxelCamIO.screenShotFiles = new ArrayList(Arrays.asList(filesInScreenshotDir)); + for (int i = getScreenShotFiles().size() - 1; i >= 0; i--) { + if (!getScreenShotFiles().get(i).getName().endsWith(".png")) { + getScreenShotFiles().remove(i); + } + } + for (int i = getScreenShotFiles().size() - 1; i >= 0; i--) { + if (!getScreenShotFiles().get(i).getName().contains(filter)) { + getScreenShotFiles().remove(i); + } + } + if (getScreenShotFiles().isEmpty()) { + getScreenShotFiles().add(null); + } + } + + public static void rename(String string) { + File newFile = new File(VoxelCamCore.getScreenshotsDir(), string + ".png"); + getSelectedPhoto().renameTo(newFile); + } + + public static void delete() { + GLImageMemoryHandler.requestImageRemovalFromMem(getSelectedPhoto()); + getSelectedPhoto().delete(); // EXTERMINATE! + getScreenShotFiles().remove(VoxelCamIO.selected); // remove refrence + if (selected > 0) { + selected--; + } + } + + public static File getSelectedPhoto() { + return getScreenShotFiles().get(selected); + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java b/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java rename to src/com/thatapplefreak/voxelcam/upload/AutoUploader.java index 0563b9d..fdab3d4 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java +++ b/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java @@ -1,93 +1,93 @@ -package com.thatapplefreak.voxelcam.upload; - -import java.io.File; - -import net.minecraft.client.resources.I18n; -import net.minecraft.util.EnumChatFormatting; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.upload.dropbox.DropboxHandler; -import com.thatapplefreak.voxelcam.upload.googleDrive.GoogleDriveHandler; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.ChatMessageBuilder; - -public abstract class AutoUploader { - - public static void upload(File image) { - VoxelCamConfig config = VoxelCamCore.getConfig(); - if (config.getBoolProperty(config.AUTO_UPLOAD_DROPBOX)) { - if (new File(System.getProperty("user.home"), "/dropbox/").exists()) { - uploadToDropbox(image); - } else { - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("dropboxnoinstallerror")); - cmb.showChatMessageIngame(); - } - } - if (config.getBoolProperty(config.AUTO_UPLOAD_GOOGLEDRIVE)) { - if (new File(System.getProperty("user.home"), "/Google Drive/").exists()) { - uploadToGoogleDrive(image); - } else { - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("googledrivenoinstallerror")); - cmb.showChatMessageIngame(); - } - } - if (config.getBoolProperty(config.AUTO_UPLOAD_IMGUR)) { - uploadToImgur(image); - } - } - - private static void uploadToImgur(File image) { - final ImgurUpload poster = new ImgurUpload(image, image.getName(), ""); - poster.start(new ImgurCallback() { - - @Override - public void onHTTPFailure(int responseCode, String responseMessage) { - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("imgurautouploaderror") + " ("); - cmb.append(String.valueOf(responseCode)); - cmb.append("): "); - cmb.append(responseMessage); - cmb.showChatMessageIngame(); - } - - @Override - public void onCompleted(ImgurResponse response) { - ImgurUploadResponse uploadResponse = (ImgurUploadResponse) poster.getResponse(); - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("imgurautouploadsuccess") + ": "); - cmb.append(uploadResponse.getLink(), uploadResponse.getLink(), true); - cmb.showChatMessageIngame(); - } - }); - } - - private static void uploadToDropbox(File image) { - File dropbox = DropboxHandler.doDropBox(image, false); - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("dropboxautouploadsuccess") + " "); - cmb.append(I18n.format("clicktoview"), dropbox.getPath(), false); - cmb.showChatMessageIngame(); - } - - private static void uploadToGoogleDrive(File image) { - File googleDrive = GoogleDriveHandler.doGoogleDrive(image, false); - ChatMessageBuilder cmb = new ChatMessageBuilder(); - cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); - cmb.append(" " + I18n.format("googledriveautouploadsuccess") + " "); - cmb.append(I18n.format("clicktoview"), googleDrive.getPath(), false); - cmb.showChatMessageIngame(); - } - -} +package com.thatapplefreak.voxelcam.upload; + +import java.io.File; + +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.upload.dropbox.DropboxHandler; +import com.thatapplefreak.voxelcam.upload.googleDrive.GoogleDriveHandler; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; +import com.thevoxelbox.common.util.AbstractionLayer; +import com.thevoxelbox.common.util.ChatMessageBuilder; + +public abstract class AutoUploader { + + public static void upload(File image) { + VoxelCamConfig config = VoxelCamCore.getConfig(); + if (config.getBoolProperty(config.AUTO_UPLOAD_DROPBOX)) { + if (new File(System.getProperty("user.home"), "/dropbox/").exists()) { + uploadToDropbox(image); + } else { + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("dropboxnoinstallerror")); + cmb.showChatMessageIngame(); + } + } + if (config.getBoolProperty(config.AUTO_UPLOAD_GOOGLEDRIVE)) { + if (new File(System.getProperty("user.home"), "/Google Drive/").exists()) { + uploadToGoogleDrive(image); + } else { + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("googledrivenoinstallerror")); + cmb.showChatMessageIngame(); + } + } + if (config.getBoolProperty(config.AUTO_UPLOAD_IMGUR)) { + uploadToImgur(image); + } + } + + private static void uploadToImgur(File image) { + final ImgurUpload poster = new ImgurUpload(image, image.getName(), ""); + poster.start(new ImgurCallback() { + + @Override + public void onHTTPFailure(int responseCode, String responseMessage) { + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("imgurautouploaderror") + " ("); + cmb.append(String.valueOf(responseCode)); + cmb.append("): "); + cmb.append(responseMessage); + cmb.showChatMessageIngame(); + } + + @Override + public void onCompleted(ImgurResponse response) { + ImgurUploadResponse uploadResponse = (ImgurUploadResponse) poster.getResponse(); + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("imgurautouploadsuccess") + ": "); + cmb.append(uploadResponse.getLink(), uploadResponse.getLink(), true); + cmb.showChatMessageIngame(); + } + }); + } + + private static void uploadToDropbox(File image) { + File dropbox = DropboxHandler.doDropBox(image, false); + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("dropboxautouploadsuccess") + " "); + cmb.append(I18n.format("clicktoview"), dropbox.getPath(), false); + cmb.showChatMessageIngame(); + } + + private static void uploadToGoogleDrive(File image) { + File googleDrive = GoogleDriveHandler.doGoogleDrive(image, false); + ChatMessageBuilder cmb = new ChatMessageBuilder(); + cmb.append("[VoxelCam]", EnumChatFormatting.DARK_RED, false); + cmb.append(" " + I18n.format("googledriveautouploadsuccess") + " "); + cmb.append(I18n.format("clicktoview"), googleDrive.getPath(), false); + cmb.showChatMessageIngame(); + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java b/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java rename to src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java index fb95b50..6b03dd0 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java @@ -1,77 +1,77 @@ -package com.thatapplefreak.voxelcam.upload.dropbox; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.FileChannel; - -import net.minecraft.util.Util.EnumOS; - -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; - -public abstract class DropboxHandler { - - /** - * Copies a file into the dropbox folder /mcScreenshots/ and opens native - * file browser and highlights it - */ - public static File doDropBox(File screenshot, boolean openFileManager) { - makeDropboxDir(); - File dropboxCopy = new File(System.getProperty("user.home") + "/dropbox/mcScreenshots/", screenshot.getName()); - FileChannel source = null; - FileChannel destination = null; - FileInputStream inputStream = null; - FileOutputStream outputStream = null; - try { - inputStream = new FileInputStream(screenshot); - outputStream = new FileOutputStream(dropboxCopy); - source = inputStream.getChannel(); - destination = outputStream.getChannel(); - destination.transferFrom(source, 0, source.size()); - if (openFileManager) { - EnumOS os = net.minecraft.util.Util.getOSType(); - if (os.equals(EnumOS.WINDOWS)) { - new ProcessBuilder("explorer.exe", "/select,", - dropboxCopy.toString()).start(); - } else if (os.equals(EnumOS.OSX)) { - new ProcessBuilder("open", "-R", dropboxCopy.toString()) - .start(); - } - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - // Close any memory leaks - if (inputStream != null) { - inputStream.close(); - } - if (outputStream != null) { - outputStream.close(); - } - if (source != null) { - source.close(); - } - if (destination != null) { - destination.close(); - } - } catch (IOException e) { - } - } - return dropboxCopy; - } - - - - /** - * Creates the Dropbox folder /mcScreenshots/ - */ - private static void makeDropboxDir() { - File t = new File(System.getProperty("user.home") + "/dropbox/mcScreenshots/"); - if (!t.exists()) { - t.mkdirs(); - } - } - -} +package com.thatapplefreak.voxelcam.upload.dropbox; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.channels.FileChannel; + +import net.minecraft.util.Util.EnumOS; + +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; + +public abstract class DropboxHandler { + + /** + * Copies a file into the dropbox folder /mcScreenshots/ and opens native + * file browser and highlights it + */ + public static File doDropBox(File screenshot, boolean openFileManager) { + makeDropboxDir(); + File dropboxCopy = new File(System.getProperty("user.home") + "/dropbox/mcScreenshots/", screenshot.getName()); + FileChannel source = null; + FileChannel destination = null; + FileInputStream inputStream = null; + FileOutputStream outputStream = null; + try { + inputStream = new FileInputStream(screenshot); + outputStream = new FileOutputStream(dropboxCopy); + source = inputStream.getChannel(); + destination = outputStream.getChannel(); + destination.transferFrom(source, 0, source.size()); + if (openFileManager) { + EnumOS os = net.minecraft.util.Util.getOSType(); + if (os.equals(EnumOS.WINDOWS)) { + new ProcessBuilder("explorer.exe", "/select,", + dropboxCopy.toString()).start(); + } else if (os.equals(EnumOS.OSX)) { + new ProcessBuilder("open", "-R", dropboxCopy.toString()) + .start(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + // Close any memory leaks + if (inputStream != null) { + inputStream.close(); + } + if (outputStream != null) { + outputStream.close(); + } + if (source != null) { + source.close(); + } + if (destination != null) { + destination.close(); + } + } catch (IOException e) { + } + } + return dropboxCopy; + } + + + + /** + * Creates the Dropbox folder /mcScreenshots/ + */ + private static void makeDropboxDir() { + File t = new File(System.getProperty("user.home") + "/dropbox/mcScreenshots/"); + if (!t.exists()) { + t.mkdirs(); + } + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java b/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java rename to src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java index 93795a9..532d6f5 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java @@ -1,41 +1,41 @@ -package com.thatapplefreak.voxelcam.upload.facebook; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterHandler; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterPINPopup; - -import facebook4j.Facebook; -import facebook4j.FacebookException; -import facebook4j.FacebookFactory; -import facebook4j.auth.AccessToken; - -public abstract class FacebookHandler { - - public static final String APP_ID = "321963097941455"; - public static final String App_Secret = "7fe4138a051faddffc05f055ef59a015"; - - public static final Facebook facebook = FacebookFactory.getSingleton(); - static { - facebook.setOAuthAppId(APP_ID, App_Secret); - } - - class FacebookAuthGrabber implements Runnable { - - public FacebookAuthGrabber() { - - } - - @Override - public void run() { - - } - - - private void storeAuth() { - - } - - } - +package com.thatapplefreak.voxelcam.upload.facebook; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.upload.twitter.TwitterHandler; +import com.thatapplefreak.voxelcam.upload.twitter.TwitterPINPopup; + +import facebook4j.Facebook; +import facebook4j.FacebookException; +import facebook4j.FacebookFactory; +import facebook4j.auth.AccessToken; + +public abstract class FacebookHandler { + + public static final String APP_ID = "321963097941455"; + public static final String App_Secret = "7fe4138a051faddffc05f055ef59a015"; + + public static final Facebook facebook = FacebookFactory.getSingleton(); + static { + facebook.setOAuthAppId(APP_ID, App_Secret); + } + + class FacebookAuthGrabber implements Runnable { + + public FacebookAuthGrabber() { + + } + + @Override + public void run() { + + } + + + private void storeAuth() { + + } + + } + } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java b/src/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java rename to src/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java index 8f2cd65..48081ed 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/googleDrive/GoogleDriveHandler.java @@ -1,73 +1,73 @@ -package com.thatapplefreak.voxelcam.upload.googleDrive; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.FileChannel; - -import net.minecraft.util.Util.EnumOS; - -public abstract class GoogleDriveHandler { - /** - * Copies a file into the google drive folder /mcScreenshots/ and opens native - * file browser and highlights it - */ - public static File doGoogleDrive(File screenshot, boolean openFileManager) { - makeGoogleDriveDir(); - File googleDriveCopy = new File(System.getProperty("user.home") + "/Google Drive/mcScreenshots/", screenshot.getName()); - FileChannel source = null; - FileChannel destination = null; - FileInputStream inputStream = null; - FileOutputStream outputStream = null; - try { - inputStream = new FileInputStream(screenshot); - outputStream = new FileOutputStream(googleDriveCopy); - source = inputStream.getChannel(); - destination = outputStream.getChannel(); - destination.transferFrom(source, 0, source.size()); - if (openFileManager) { - EnumOS os = net.minecraft.util.Util.getOSType(); - if (os.equals(EnumOS.WINDOWS)) { - new ProcessBuilder("explorer.exe", "/select,", - googleDriveCopy.toString()).start(); - } else if (os.equals(EnumOS.OSX)) { - new ProcessBuilder("open", "-R", googleDriveCopy.toString()) - .start(); - } - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - // Close any memory leaks - if (inputStream != null) { - inputStream.close(); - } - if (outputStream != null) { - outputStream.close(); - } - if (source != null) { - source.close(); - } - if (destination != null) { - destination.close(); - } - } catch (IOException e) { - } - } - return googleDriveCopy; - } - - - - /** - * Creates the Dropbox folder /mcScreenshots/ - */ - private static void makeGoogleDriveDir() { - File t = new File(System.getProperty("user.home") + "/Google Drive/mcScreenshots/"); - if (!t.exists()) { - t.mkdirs(); - } - } -} +package com.thatapplefreak.voxelcam.upload.googleDrive; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.channels.FileChannel; + +import net.minecraft.util.Util.EnumOS; + +public abstract class GoogleDriveHandler { + /** + * Copies a file into the google drive folder /mcScreenshots/ and opens native + * file browser and highlights it + */ + public static File doGoogleDrive(File screenshot, boolean openFileManager) { + makeGoogleDriveDir(); + File googleDriveCopy = new File(System.getProperty("user.home") + "/Google Drive/mcScreenshots/", screenshot.getName()); + FileChannel source = null; + FileChannel destination = null; + FileInputStream inputStream = null; + FileOutputStream outputStream = null; + try { + inputStream = new FileInputStream(screenshot); + outputStream = new FileOutputStream(googleDriveCopy); + source = inputStream.getChannel(); + destination = outputStream.getChannel(); + destination.transferFrom(source, 0, source.size()); + if (openFileManager) { + EnumOS os = net.minecraft.util.Util.getOSType(); + if (os.equals(EnumOS.WINDOWS)) { + new ProcessBuilder("explorer.exe", "/select,", + googleDriveCopy.toString()).start(); + } else if (os.equals(EnumOS.OSX)) { + new ProcessBuilder("open", "-R", googleDriveCopy.toString()) + .start(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + // Close any memory leaks + if (inputStream != null) { + inputStream.close(); + } + if (outputStream != null) { + outputStream.close(); + } + if (source != null) { + source.close(); + } + if (destination != null) { + destination.close(); + } + } catch (IOException e) { + } + } + return googleDriveCopy; + } + + + + /** + * Creates the Dropbox folder /mcScreenshots/ + */ + private static void makeGoogleDriveDir() { + File t = new File(System.getProperty("user.home") + "/Google Drive/mcScreenshots/"); + if (!t.exists()) { + t.mkdirs(); + } + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java b/src/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java index 2dda8b0..327c20f 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/Imgur.java @@ -1,145 +1,145 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.thevoxelbox.common.util.upload.IUploadCompleteCallback; -import com.thevoxelbox.common.util.upload.ThreadMultipartPostUpload; - - -/** - * Base class for objects which perform manipulation actions against the imgur - * API - * - * @author Mumfrey - */ -public abstract class Imgur implements IUploadCompleteCallback { - /** - * Method for request - * - * @author Mumfrey - */ - protected enum Method { - GET, POST, PUT, DELETE - } - - /** - * Base url for the imgur API - */ - public static final String IMGUR_API_BASEURL = "https://api.imgur.com"; - - /** - * imgur API version to call - */ - public static final int IMGUR_API_VERSION = 3; - - /** - * Our client id - */ - public static final String IMGUR_API_CLIENTID = "b0118040d2b06e2"; - - /** - * Gson deserialiser - */ - private static Gson gson = new Gson(); - - /** - * True if this process was started - */ - private boolean started = false; - - /** - * URL to get/post to - */ - private final String url; - - /** - * HTTP method - */ - private final Method method; - - /** - * Upload thread - */ - protected ThreadMultipartPostUpload uploadThread; - - /** - * HTTP POST data - */ - protected Map postData = new HashMap(); - - /** - * True if the process completed - */ - private boolean isComplete; - - /** - * Object to call back - */ - private ImgurCallback callback; - - /** - * Class to wrap JSON responses in - */ - private Class responseClass; - - /** - * Parsed JSON response - */ - private ImgurResponse response; - - public Imgur(Method method, String route, Class responseClass) { - this(method, route, responseClass, null); - } - - public Imgur(Method method, String route, Class responseClass, String get) { - this.method = method; - this.url = String.format("%s/%d/%s%s%s", Imgur.IMGUR_API_BASEURL, Imgur.IMGUR_API_VERSION, route.toLowerCase(), get != null ? "/" : "", get != null ? get : ""); - this.responseClass = responseClass; - } - - protected abstract void assemble(); - - public void start(ImgurCallback callback) { - if (this.started) { - throw new IllegalStateException("Task already started"); - } - - this.started = true; - this.callback = callback; - - this.assemble(); - - String authorization = String.format("Client-ID %s", Imgur.IMGUR_API_CLIENTID); - this.uploadThread = new ThreadMultipartPostUpload(this.method.toString(), this.url, this.postData, authorization, this); - this.uploadThread.start(); - } - - @Override - public void onUploadComplete(String responseData) { - this.isComplete = true; - - if (this.uploadThread.httpResponseCode / 100 != 2) { - if (this.callback != null) { - this.callback.onHTTPFailure(this.uploadThread.httpResponseCode, this.uploadThread.httpResponse); - } - - return; - } - - this.response = Imgur.gson.fromJson(responseData, this.responseClass); - - if (this.callback != null) { - this.callback.onCompleted(this.response); - } - } - - public boolean isComplete() { - return this.isComplete; - } - - public ImgurResponse getResponse() { - return this.response; - } +package com.thatapplefreak.voxelcam.upload.imgur; + +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.thevoxelbox.common.util.upload.IUploadCompleteCallback; +import com.thevoxelbox.common.util.upload.ThreadMultipartPostUpload; + + +/** + * Base class for objects which perform manipulation actions against the imgur + * API + * + * @author Mumfrey + */ +public abstract class Imgur implements IUploadCompleteCallback { + /** + * Method for request + * + * @author Mumfrey + */ + protected enum Method { + GET, POST, PUT, DELETE + } + + /** + * Base url for the imgur API + */ + public static final String IMGUR_API_BASEURL = "https://api.imgur.com"; + + /** + * imgur API version to call + */ + public static final int IMGUR_API_VERSION = 3; + + /** + * Our client id + */ + public static final String IMGUR_API_CLIENTID = "b0118040d2b06e2"; + + /** + * Gson deserialiser + */ + private static Gson gson = new Gson(); + + /** + * True if this process was started + */ + private boolean started = false; + + /** + * URL to get/post to + */ + private final String url; + + /** + * HTTP method + */ + private final Method method; + + /** + * Upload thread + */ + protected ThreadMultipartPostUpload uploadThread; + + /** + * HTTP POST data + */ + protected Map postData = new HashMap(); + + /** + * True if the process completed + */ + private boolean isComplete; + + /** + * Object to call back + */ + private ImgurCallback callback; + + /** + * Class to wrap JSON responses in + */ + private Class responseClass; + + /** + * Parsed JSON response + */ + private ImgurResponse response; + + public Imgur(Method method, String route, Class responseClass) { + this(method, route, responseClass, null); + } + + public Imgur(Method method, String route, Class responseClass, String get) { + this.method = method; + this.url = String.format("%s/%d/%s%s%s", Imgur.IMGUR_API_BASEURL, Imgur.IMGUR_API_VERSION, route.toLowerCase(), get != null ? "/" : "", get != null ? get : ""); + this.responseClass = responseClass; + } + + protected abstract void assemble(); + + public void start(ImgurCallback callback) { + if (this.started) { + throw new IllegalStateException("Task already started"); + } + + this.started = true; + this.callback = callback; + + this.assemble(); + + String authorization = String.format("Client-ID %s", Imgur.IMGUR_API_CLIENTID); + this.uploadThread = new ThreadMultipartPostUpload(this.method.toString(), this.url, this.postData, authorization, this); + this.uploadThread.start(); + } + + @Override + public void onUploadComplete(String responseData) { + this.isComplete = true; + + if (this.uploadThread.httpResponseCode / 100 != 2) { + if (this.callback != null) { + this.callback.onHTTPFailure(this.uploadThread.httpResponseCode, this.uploadThread.httpResponse); + } + + return; + } + + this.response = Imgur.gson.fromJson(responseData, this.responseClass); + + if (this.callback != null) { + this.callback.onCompleted(this.response); + } + } + + public boolean isComplete() { + return this.isComplete; + } + + public ImgurResponse getResponse() { + return this.response; + } } \ No newline at end of file diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java index 45a2816..ec7b033 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurCallback.java @@ -1,7 +1,7 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -public interface ImgurCallback { - public abstract void onCompleted(ImgurResponse response); - - public abstract void onHTTPFailure(int responseCode, String responseMessage); -} +package com.thatapplefreak.voxelcam.upload.imgur; + +public interface ImgurCallback { + public abstract void onCompleted(ImgurResponse response); + + public abstract void onHTTPFailure(int responseCode, String responseMessage); +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java index 281098a..a11405a 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDelete.java @@ -1,22 +1,22 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -/** - * Imgur agent to delete an uploaded file - * - * @author Mumfrey - */ -public class ImgurDelete extends Imgur { - private static final String ROUTE = "image"; - - /** - * @param deleteHash - * Hash of the uploaded image to delete - */ - public ImgurDelete(String deleteHash) { - super(Method.DELETE, ImgurDelete.ROUTE, ImgurDeleteResponse.class, deleteHash); - } - - @Override - protected void assemble() { - } -} +package com.thatapplefreak.voxelcam.upload.imgur; + +/** + * Imgur agent to delete an uploaded file + * + * @author Mumfrey + */ +public class ImgurDelete extends Imgur { + private static final String ROUTE = "image"; + + /** + * @param deleteHash + * Hash of the uploaded image to delete + */ + public ImgurDelete(String deleteHash) { + super(Method.DELETE, ImgurDelete.ROUTE, ImgurDeleteResponse.class, deleteHash); + } + + @Override + protected void assemble() { + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java similarity index 94% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java index 9fa20cf..6a25fee 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurDeleteResponse.java @@ -1,34 +1,34 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -public class ImgurDeleteResponse implements ImgurResponse { - private boolean data; - - private boolean success; - - private int status; - - @Override - public int getStatus() { - return this.status; - } - - @Override - public boolean isSuccessful() { - return this.success; - } - - @Override - public String get(String key) { - if ("data".equalsIgnoreCase(key)) - return String.valueOf(this.data); - return null; - } - - @Override - public int getInt(String key) { - if ("data".equalsIgnoreCase(key)) - return this.data ? 1 : 0; - return 0; - } - -} +package com.thatapplefreak.voxelcam.upload.imgur; + +public class ImgurDeleteResponse implements ImgurResponse { + private boolean data; + + private boolean success; + + private int status; + + @Override + public int getStatus() { + return this.status; + } + + @Override + public boolean isSuccessful() { + return this.success; + } + + @Override + public String get(String key) { + if ("data".equalsIgnoreCase(key)) + return String.valueOf(this.data); + return null; + } + + @Override + public int getInt(String key) { + if ("data".equalsIgnoreCase(key)) + return this.data ? 1 : 0; + return 0; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java index 54ee89e..aed0466 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java @@ -1,32 +1,32 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -import java.io.File; - -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.gui.manager.PostPopup; - -public abstract class ImgurHandler { - - public static void doImgur(final PostPopup callbackGui, File screenshot) { - final ImgurUpload poster = new ImgurUpload(screenshot, screenshot.getName(), ""); - poster.start(new ImgurCallback() { - - @Override - public void onHTTPFailure(int responseCode, String responseMessage) { - callbackGui.onUploadCompleted(new ImgurUploadFailedPopup(callbackGui.getParentScreen(), String.format("HTTP Error: %d %s", responseCode, responseMessage))); - } - - @Override - public void onCompleted(ImgurResponse response) { - - ImgurUploadResponse uploadResponse = (ImgurUploadResponse) poster.getResponse(); - if (uploadResponse.isSuccessful()) { - callbackGui.onUploadCompleted(new ImgurUploadSuccessPopup(callbackGui.getParentScreen(), uploadResponse.getDeleteHash(), uploadResponse.getLink())); - } else { - callbackGui.onUploadCompleted(new ImgurUploadFailedPopup(callbackGui.getParentScreen(), uploadResponse.get("data"))); - } - } - }); - } - -} +package com.thatapplefreak.voxelcam.upload.imgur; + +import java.io.File; + +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thatapplefreak.voxelcam.gui.manager.PostPopup; + +public abstract class ImgurHandler { + + public static void doImgur(final PostPopup callbackGui, File screenshot) { + final ImgurUpload poster = new ImgurUpload(screenshot, screenshot.getName(), ""); + poster.start(new ImgurCallback() { + + @Override + public void onHTTPFailure(int responseCode, String responseMessage) { + callbackGui.onUploadCompleted(new ImgurUploadFailedPopup(callbackGui.getParentScreen(), String.format("HTTP Error: %d %s", responseCode, responseMessage))); + } + + @Override + public void onCompleted(ImgurResponse response) { + + ImgurUploadResponse uploadResponse = (ImgurUploadResponse) poster.getResponse(); + if (uploadResponse.isSuccessful()) { + callbackGui.onUploadCompleted(new ImgurUploadSuccessPopup(callbackGui.getParentScreen(), uploadResponse.getDeleteHash(), uploadResponse.getLink())); + } else { + callbackGui.onUploadCompleted(new ImgurUploadFailedPopup(callbackGui.getParentScreen(), uploadResponse.get("data"))); + } + } + }); + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java index 75c90dd..b4e62f1 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurResponse.java @@ -1,11 +1,11 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -public interface ImgurResponse { - public abstract int getStatus(); - - public abstract boolean isSuccessful(); - - public abstract String get(String key); - - public abstract int getInt(String key); -} +package com.thatapplefreak.voxelcam.upload.imgur; + +public interface ImgurResponse { + public abstract int getStatus(); + + public abstract boolean isSuccessful(); + + public abstract String get(String key); + + public abstract int getInt(String key); +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java similarity index 95% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java index ef9e568..d1dba3c 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUpload.java @@ -1,39 +1,39 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -import java.io.File; - - -/** - * Imgur agent to upload a file, callers should get the URL from the response - * data " - * - * @author Mumfrey - */ -public class ImgurUpload extends Imgur { - private static final String ROUTE = "image"; - - private final File file; - - private final String title; - - private final String description; - - public ImgurUpload(File imageFile, String imageTitle, String imageDescription) { - super(Method.POST, ImgurUpload.ROUTE, ImgurUploadResponse.class); - - this.title = imageTitle; - this.file = imageFile; - this.description = imageDescription; - } - - @Override - protected void assemble() { - this.postData.put("image", this.file); - this.postData.put("type", "file"); - - if (this.title != null) - this.postData.put("title", this.title); - if (this.description != null) - this.postData.put("description", this.description); - } -} +package com.thatapplefreak.voxelcam.upload.imgur; + +import java.io.File; + + +/** + * Imgur agent to upload a file, callers should get the URL from the response + * data " + * + * @author Mumfrey + */ +public class ImgurUpload extends Imgur { + private static final String ROUTE = "image"; + + private final File file; + + private final String title; + + private final String description; + + public ImgurUpload(File imageFile, String imageTitle, String imageDescription) { + super(Method.POST, ImgurUpload.ROUTE, ImgurUploadResponse.class); + + this.title = imageTitle; + this.file = imageFile; + this.description = imageDescription; + } + + @Override + protected void assemble() { + this.postData.put("image", this.file); + this.postData.put("type", "file"); + + if (this.title != null) + this.postData.put("title", this.title); + if (this.description != null) + this.postData.put("description", this.description); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java index 517e142..26b7956 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadFailedPopup.java @@ -1,38 +1,38 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thevoxelbox.common.util.gui.GuiDialogBox; - - -public class ImgurUploadFailedPopup extends GuiDialogBox { - - protected String errorMessage; - - public ImgurUploadFailedPopup(GuiScreen parentScreen, String errorMessage) { - super(parentScreen, 300, 80, I18n.format("imguruploadfail")); - this.errorMessage = errorMessage; - } - - @Override - protected void onInitDialog() { - btnOk.displayString = I18n.format("close"); - btnCancel.enabled = false; - } - - @Override - public void onSubmit() { - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - drawCenteredString(fontRendererObj, I18n.format("uploadfailed"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFF5555); - drawCenteredString(fontRendererObj, this.errorMessage, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFAA00); - } -} +package com.thatapplefreak.voxelcam.upload.imgur; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thevoxelbox.common.util.gui.GuiDialogBox; + + +public class ImgurUploadFailedPopup extends GuiDialogBox { + + protected String errorMessage; + + public ImgurUploadFailedPopup(GuiScreen parentScreen, String errorMessage) { + super(parentScreen, 300, 80, I18n.format("imguruploadfail")); + this.errorMessage = errorMessage; + } + + @Override + protected void onInitDialog() { + btnOk.displayString = I18n.format("close"); + btnCancel.enabled = false; + } + + @Override + public void onSubmit() { + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + drawCenteredString(fontRendererObj, I18n.format("uploadfailed"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFF5555); + drawCenteredString(fontRendererObj, this.errorMessage, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFAA00); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java similarity index 94% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java index 93d3b92..7af0743 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadResponse.java @@ -1,119 +1,119 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -import java.util.HashMap; -import java.util.Map; - - -/** - * - * @author Mumfrey - */ -public class ImgurUploadResponse implements ImgurResponse { - private Map data = new HashMap(); - - private boolean success; - - private int status; - - @Override - public String get(String key) { - return this.data.get(key); - } - - @Override - public int getInt(String key) { - try { - return Integer.parseInt(key); - } catch (Exception ex) { - } - - return 0; - } - - @Override - public boolean isSuccessful() { - return this.success; - } - - @Override - public int getStatus() { - return this.status; - } - - /** - * imgur ID of the uploaded image - */ - public String getID() { - return this.data.get("id"); - } - - /** - * When uploading anonymously, this hash can be used to delete the image by - * passing the hash to a delete task - */ - public String getDeleteHash() { - return this.data.get("deletehash"); - } - - /** - * URL to the uploaded image - */ - public String getLink() { - return this.data.get("link"); - } - - public String getTitle() { - return this.data.get("title"); - } - - public String getDescription() { - return this.data.get("description"); - } - - public int getTimestamp() { - return Integer.parseInt(this.data.get("datetime")); - } - - /** - * MIME type, eg. image/jpeg - */ - public String getMimeType() { - return this.data.get("type"); - } - - public boolean isAnimated() { - return "true".equalsIgnoreCase(this.data.get("animated")); - } - - public int getWidth() { - return Integer.parseInt(this.data.get("width")); - } - - public int getHeight() { - return Integer.parseInt(this.data.get("height")); - } - - public int getSize() { - return Integer.parseInt(this.data.get("size")); - } - - public int getViews() { - return Integer.parseInt(this.data.get("views")); - } - - public int getBandwidth() { - return Integer.parseInt(this.data.get("bandwidth")); - } - - public boolean isFavourite() { - return "true".equalsIgnoreCase(this.data.get("favorite")); - } - - public String getNSFW() { - return this.data.get("nsfw"); - } - - public String getSection() { - return this.data.get("section"); - } -} +package com.thatapplefreak.voxelcam.upload.imgur; + +import java.util.HashMap; +import java.util.Map; + + +/** + * + * @author Mumfrey + */ +public class ImgurUploadResponse implements ImgurResponse { + private Map data = new HashMap(); + + private boolean success; + + private int status; + + @Override + public String get(String key) { + return this.data.get(key); + } + + @Override + public int getInt(String key) { + try { + return Integer.parseInt(key); + } catch (Exception ex) { + } + + return 0; + } + + @Override + public boolean isSuccessful() { + return this.success; + } + + @Override + public int getStatus() { + return this.status; + } + + /** + * imgur ID of the uploaded image + */ + public String getID() { + return this.data.get("id"); + } + + /** + * When uploading anonymously, this hash can be used to delete the image by + * passing the hash to a delete task + */ + public String getDeleteHash() { + return this.data.get("deletehash"); + } + + /** + * URL to the uploaded image + */ + public String getLink() { + return this.data.get("link"); + } + + public String getTitle() { + return this.data.get("title"); + } + + public String getDescription() { + return this.data.get("description"); + } + + public int getTimestamp() { + return Integer.parseInt(this.data.get("datetime")); + } + + /** + * MIME type, eg. image/jpeg + */ + public String getMimeType() { + return this.data.get("type"); + } + + public boolean isAnimated() { + return "true".equalsIgnoreCase(this.data.get("animated")); + } + + public int getWidth() { + return Integer.parseInt(this.data.get("width")); + } + + public int getHeight() { + return Integer.parseInt(this.data.get("height")); + } + + public int getSize() { + return Integer.parseInt(this.data.get("size")); + } + + public int getViews() { + return Integer.parseInt(this.data.get("views")); + } + + public int getBandwidth() { + return Integer.parseInt(this.data.get("bandwidth")); + } + + public boolean isFavourite() { + return "true".equalsIgnoreCase(this.data.get("favorite")); + } + + public String getNSFW() { + return this.data.get("nsfw"); + } + + public String getSection() { + return this.data.get("section"); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java rename to src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java index 7bc8440..7ed9581 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurUploadSuccessPopup.java @@ -1,64 +1,64 @@ -package com.thatapplefreak.voxelcam.upload.imgur; - -import java.awt.Toolkit; -import java.awt.datatransfer.StringSelection; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thevoxelbox.common.util.BrowserOpener; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class ImgurUploadSuccessPopup extends GuiDialogBox { - - private final String deleteHash; - private final String url; - - private GuiButton btnView, btnClipboard; - - public ImgurUploadSuccessPopup(GuiScreen parentScreen, String deleteHash, String url) { - super(parentScreen, 300, 80, I18n.format("imguruploadsuccess")); - this.deleteHash = deleteHash; - this.url = url; - } - - @Override - protected void onInitDialog() { - btnCancel.displayString = I18n.format("undo"); - btnView = new GuiButton(100, dialogX + dialogWidth - 248, dialogY + dialogHeight - 22, 60, 20, I18n.format("open")); - buttonList.add(btnView); - btnClipboard = new GuiButton(200, dialogX + dialogWidth - 186, dialogY + dialogHeight - 22, 60, 20, I18n.format("copylink")); - buttonList.add(btnClipboard); - } - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == btnCancel.id) { - ImgurDelete deleter = new ImgurDelete(this.deleteHash); - deleter.start(null); - } else if (guibutton.id == btnView.id) { - BrowserOpener.openURLstringInBrowser(url); - } else if (guibutton.id == btnClipboard.id) { - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null); - } - - super.actionPerformed(guibutton); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - drawCenteredString(fontRendererObj, I18n.format("uploadsuccess"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFFAA00); - drawCenteredString(fontRendererObj, this.url, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFFF55); - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - public void onSubmit() { - } - -} +package com.thatapplefreak.voxelcam.upload.imgur; + +import java.awt.Toolkit; +import java.awt.datatransfer.StringSelection; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thevoxelbox.common.util.BrowserOpener; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class ImgurUploadSuccessPopup extends GuiDialogBox { + + private final String deleteHash; + private final String url; + + private GuiButton btnView, btnClipboard; + + public ImgurUploadSuccessPopup(GuiScreen parentScreen, String deleteHash, String url) { + super(parentScreen, 300, 80, I18n.format("imguruploadsuccess")); + this.deleteHash = deleteHash; + this.url = url; + } + + @Override + protected void onInitDialog() { + btnCancel.displayString = I18n.format("undo"); + btnView = new GuiButton(100, dialogX + dialogWidth - 248, dialogY + dialogHeight - 22, 60, 20, I18n.format("open")); + buttonList.add(btnView); + btnClipboard = new GuiButton(200, dialogX + dialogWidth - 186, dialogY + dialogHeight - 22, 60, 20, I18n.format("copylink")); + buttonList.add(btnClipboard); + } + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.id == btnCancel.id) { + ImgurDelete deleter = new ImgurDelete(this.deleteHash); + deleter.start(null); + } else if (guibutton.id == btnView.id) { + BrowserOpener.openURLstringInBrowser(url); + } else if (guibutton.id == btnClipboard.id) { + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null); + } + + super.actionPerformed(guibutton); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + drawCenteredString(fontRendererObj, I18n.format("uploadsuccess"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFFAA00); + drawCenteredString(fontRendererObj, this.url, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFFF55); + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + public void onSubmit() { + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java b/src/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java similarity index 94% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java rename to src/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java index d2ae5a8..ef16f06 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/ILoginCallback.java @@ -1,9 +1,9 @@ -package com.thatapplefreak.voxelcam.upload.reddit; - -public interface ILoginCallback { - - void onLoginSuccess(); - - void onLoginFailure(); - -} +package com.thatapplefreak.voxelcam.upload.reddit; + +public interface ILoginCallback { + + void onLoginSuccess(); + + void onLoginFailure(); + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java b/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java similarity index 94% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java rename to src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java index f3238b1..7d45092 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java @@ -1,11 +1,11 @@ -package com.thatapplefreak.voxelcam.upload.reddit; - -import java.net.URL; - -public interface IRedditPostCallback { - - void onPostSuccess(String string); - - void onPostFailure(); - -} +package com.thatapplefreak.voxelcam.upload.reddit; + +import java.net.URL; + +public interface IRedditPostCallback { + + void onPostSuccess(String string); + + void onPostFailure(); + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java rename to src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java index 2deeb7d..cb7f0b0 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java @@ -1,93 +1,93 @@ -package com.thatapplefreak.voxelcam.upload.reddit; - -import java.io.File; -import java.lang.reflect.Method; - -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; - -import com.github.jreddit.user.User; -import com.github.jreddit.utils.restclient.HttpRestClient; -import com.thatapplefreak.voxelcam.gui.manager.PostPopup; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadFailedPopup; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadSuccessPopup; - -public abstract class RedditHandler { - - private static User reddit; - - /** - * user is logged into reddit - */ - private static boolean loggedIn = false; - - /** - * Post image to reddit - * @param postTitle - * @param screenshot - */ - public static void doRedditPost(final String postTitle, final String subreddit, final File screenshot, final IRedditPostCallback callback) { - final ImgurUpload poster = new ImgurUpload(screenshot, screenshot.getName(), ""); - poster.start(new ImgurCallback() { - - @Override - public void onHTTPFailure(int responseCode, String responseMessage) { - callback.onPostFailure(); - } - - @Override - public void onCompleted(ImgurResponse response) { - - ImgurUploadResponse uploadResponse = (ImgurUploadResponse) poster.getResponse(); - if (uploadResponse.isSuccessful()) { - try { - Method m = User.class.getDeclaredMethod("submit", String.class, String.class, boolean.class, String.class); - m.setAccessible(true); - Object obj = m.invoke(reddit, postTitle, uploadResponse.getLink(), false, subreddit); - JSONObject jobj = (JSONObject) obj; - callback.onPostSuccess(((JSONArray) ((JSONArray) ((JSONArray) jobj.get("jquery")).get(16)).get(3)).get(0).toString()); - } catch (Exception e) { - e.printStackTrace(); - callback.onPostFailure(); - } - } else { - callback.onPostFailure(); - } - } - }); - } - - /** - * Log the user into reddit - * @param username - * @param password - * @return - */ - public static void login(final String username, final String password, final ILoginCallback logincallback) { - reddit = new User(new HttpRestClient(), username, password); - new Thread() { - @Override - public void run() { - try { - reddit.connect(); - logincallback.onLoginSuccess(); - loggedIn = true; - } catch (Exception e) { - logincallback.onLoginFailure(); - } - } - }.start(); - } - - /** - * @return True if the user is logged in - */ - public static boolean isLoggedIn() { - return loggedIn; - } - -} +package com.thatapplefreak.voxelcam.upload.reddit; + +import java.io.File; +import java.lang.reflect.Method; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; + +import com.github.jreddit.user.User; +import com.github.jreddit.utils.restclient.HttpRestClient; +import com.thatapplefreak.voxelcam.gui.manager.PostPopup; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadFailedPopup; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadSuccessPopup; + +public abstract class RedditHandler { + + private static User reddit; + + /** + * user is logged into reddit + */ + private static boolean loggedIn = false; + + /** + * Post image to reddit + * @param postTitle + * @param screenshot + */ + public static void doRedditPost(final String postTitle, final String subreddit, final File screenshot, final IRedditPostCallback callback) { + final ImgurUpload poster = new ImgurUpload(screenshot, screenshot.getName(), ""); + poster.start(new ImgurCallback() { + + @Override + public void onHTTPFailure(int responseCode, String responseMessage) { + callback.onPostFailure(); + } + + @Override + public void onCompleted(ImgurResponse response) { + + ImgurUploadResponse uploadResponse = (ImgurUploadResponse) poster.getResponse(); + if (uploadResponse.isSuccessful()) { + try { + Method m = User.class.getDeclaredMethod("submit", String.class, String.class, boolean.class, String.class); + m.setAccessible(true); + Object obj = m.invoke(reddit, postTitle, uploadResponse.getLink(), false, subreddit); + JSONObject jobj = (JSONObject) obj; + callback.onPostSuccess(((JSONArray) ((JSONArray) ((JSONArray) jobj.get("jquery")).get(16)).get(3)).get(0).toString()); + } catch (Exception e) { + e.printStackTrace(); + callback.onPostFailure(); + } + } else { + callback.onPostFailure(); + } + } + }); + } + + /** + * Log the user into reddit + * @param username + * @param password + * @return + */ + public static void login(final String username, final String password, final ILoginCallback logincallback) { + reddit = new User(new HttpRestClient(), username, password); + new Thread() { + @Override + public void run() { + try { + reddit.connect(); + logincallback.onLoginSuccess(); + loggedIn = true; + } catch (Exception e) { + logincallback.onLoginFailure(); + } + } + }.start(); + } + + /** + * @return True if the user is logged in + */ + public static boolean isLoggedIn() { + return loggedIn; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java rename to src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java index 788f44b..2983048 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java @@ -1,110 +1,110 @@ -package com.thatapplefreak.voxelcam.upload.reddit; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.gui.GuiDialogBox; -import com.thevoxelbox.common.util.gui.GuiTextFieldEx; -import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; - -public class RedditLoginPopup extends GuiDialogBox implements ILoginCallback, ScreenshotIncapable { - - private boolean failed = false; - private boolean loggingIn = false; - - private GuiTextFieldEx usernameField,passwordField; - - public RedditLoginPopup(GuiScreen parentScreen) { - super(parentScreen, 200, 100, I18n.format("pleaseloginto") + " Reddit"); //TODO Translate - } - - @Override - protected void onInitDialog() { - super.onInitDialog(); - btnOk.displayString = I18n.format("login"); //TODO Traslate - usernameField = new GuiTextFieldEx(fontRendererObj, dialogX + 65, dialogY + 18, 130, 15, VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.REDDITUSERNAME)); - passwordField = new GuiTextFieldEx(fontRendererObj, dialogX + 65, dialogY + 48, 130, 15, VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.REDDITPASSWORD)); - usernameField.setFocused(true); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - if (!loggingIn) { - usernameField.setVisible(true); - passwordField.setVisible(true); - if (failed) { - drawCenteredString(fontRendererObj, I18n.format("loginfailpleasetryagain"), dialogX + dialogWidth / 2, dialogY + 4, 0xFF0000); - } - drawString(fontRendererObj, I18n.format("username") + ":", dialogX + 5, dialogY + 20, 0xFFFFFF); - drawString(fontRendererObj, I18n.format("password") + ":", dialogX + 5, dialogY + 50, 0xFFFFFF); - } else { - usernameField.setVisible(false); - passwordField.setVisible(false); - drawCenteredString(fontRendererObj, I18n.format("loggingin") + "...", dialogX + dialogWidth / 2, dialogY + dialogHeight / 2 - 10, 0xFFFFFF); - } - usernameField.drawTextBox(); - passwordField.drawTextBox(); - } - - public void onLoginSuccess() { - VoxelCamCore.getConfig().setProperty(VoxelCamConfig.REDDITUSERNAME, usernameField.getText()); - VoxelCamCore.getConfig().setProperty(VoxelCamConfig.REDDITPASSWORD, passwordField.getText()); - AbstractionLayer.getMinecraft().displayGuiScreen(new RedditPostPopup(getParentScreen())); - } - - public void onLoginFailure() { - loggingIn = false; - failed = true; - } - - /** - * Handle a button event - * - * @param guibutton Button or control which sourced the event - */ - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == this.btnCancel.id) { - dialogResult = DialogResult.Cancel; - closeDialog(); - } - if (guibutton.id == this.btnOk.id) { - if (validateDialog()) { - dialogResult = DialogResult.OK; - onSubmit(); - } - } - } - - @Override - protected void onKeyTyped(char keyChar, int keyCode) { - super.onKeyTyped(keyChar, keyCode); - usernameField.textboxKeyTyped(keyChar, keyCode); - passwordField.textboxKeyTyped(keyChar, keyCode); - } - - @Override - protected void mouseClickedEx(int mouseX, int mouseY, int button) { - super.mouseClickedEx(mouseX, mouseY, button); - usernameField.mouseClicked(mouseX, mouseY, button); - passwordField.mouseClicked(mouseX, mouseY, button); - } - - @Override - public void onSubmit() { - loggingIn = true; - RedditHandler.login(usernameField.getText(), passwordField.getText(), this); - } - - @Override - public boolean validateDialog() { - return true; - } - -} +package com.thatapplefreak.voxelcam.upload.reddit; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thevoxelbox.common.util.AbstractionLayer; +import com.thevoxelbox.common.util.gui.GuiDialogBox; +import com.thevoxelbox.common.util.gui.GuiTextFieldEx; +import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; + +public class RedditLoginPopup extends GuiDialogBox implements ILoginCallback, ScreenshotIncapable { + + private boolean failed = false; + private boolean loggingIn = false; + + private GuiTextFieldEx usernameField,passwordField; + + public RedditLoginPopup(GuiScreen parentScreen) { + super(parentScreen, 200, 100, I18n.format("pleaseloginto") + " Reddit"); //TODO Translate + } + + @Override + protected void onInitDialog() { + super.onInitDialog(); + btnOk.displayString = I18n.format("login"); //TODO Traslate + usernameField = new GuiTextFieldEx(fontRendererObj, dialogX + 65, dialogY + 18, 130, 15, VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.REDDITUSERNAME)); + passwordField = new GuiTextFieldEx(fontRendererObj, dialogX + 65, dialogY + 48, 130, 15, VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.REDDITPASSWORD)); + usernameField.setFocused(true); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + if (!loggingIn) { + usernameField.setVisible(true); + passwordField.setVisible(true); + if (failed) { + drawCenteredString(fontRendererObj, I18n.format("loginfailpleasetryagain"), dialogX + dialogWidth / 2, dialogY + 4, 0xFF0000); + } + drawString(fontRendererObj, I18n.format("username") + ":", dialogX + 5, dialogY + 20, 0xFFFFFF); + drawString(fontRendererObj, I18n.format("password") + ":", dialogX + 5, dialogY + 50, 0xFFFFFF); + } else { + usernameField.setVisible(false); + passwordField.setVisible(false); + drawCenteredString(fontRendererObj, I18n.format("loggingin") + "...", dialogX + dialogWidth / 2, dialogY + dialogHeight / 2 - 10, 0xFFFFFF); + } + usernameField.drawTextBox(); + passwordField.drawTextBox(); + } + + public void onLoginSuccess() { + VoxelCamCore.getConfig().setProperty(VoxelCamConfig.REDDITUSERNAME, usernameField.getText()); + VoxelCamCore.getConfig().setProperty(VoxelCamConfig.REDDITPASSWORD, passwordField.getText()); + AbstractionLayer.getMinecraft().displayGuiScreen(new RedditPostPopup(getParentScreen())); + } + + public void onLoginFailure() { + loggingIn = false; + failed = true; + } + + /** + * Handle a button event + * + * @param guibutton Button or control which sourced the event + */ + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.id == this.btnCancel.id) { + dialogResult = DialogResult.Cancel; + closeDialog(); + } + if (guibutton.id == this.btnOk.id) { + if (validateDialog()) { + dialogResult = DialogResult.OK; + onSubmit(); + } + } + } + + @Override + protected void onKeyTyped(char keyChar, int keyCode) { + super.onKeyTyped(keyChar, keyCode); + usernameField.textboxKeyTyped(keyChar, keyCode); + passwordField.textboxKeyTyped(keyChar, keyCode); + } + + @Override + protected void mouseClickedEx(int mouseX, int mouseY, int button) { + super.mouseClickedEx(mouseX, mouseY, button); + usernameField.mouseClicked(mouseX, mouseY, button); + passwordField.mouseClicked(mouseX, mouseY, button); + } + + @Override + public void onSubmit() { + loggingIn = true; + RedditHandler.login(usernameField.getText(), passwordField.getText(), this); + } + + @Override + public boolean validateDialog() { + return true; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java rename to src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java index 6c160a0..bc35b3a 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java @@ -1,117 +1,117 @@ -package com.thatapplefreak.voxelcam.upload.reddit; - -import java.net.URL; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; -import net.minecraft.util.ResourceLocation; - -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.gui.GuiDialogBox; -import com.thevoxelbox.common.util.gui.GuiTextFieldEx; -import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; - -public class RedditPostPopup extends GuiDialogBox implements IRedditPostCallback, ScreenshotIncapable { - - private static final ResourceLocation karmapony = new ResourceLocation("voxelcam", "textures/karmapony.png"); - - private GuiTextFieldEx titleField, subredditField; - - private boolean failed = false; - - private boolean posting = false;; - - public RedditPostPopup(GuiScreen parentScreen) { - super(parentScreen, 250, 130, I18n.format("postto") + " Reddit"); //TODO Translate - } - - @Override - protected void onInitDialog() { - super.onInitDialog(); - btnOk.displayString = I18n.format("post"); - titleField = new GuiTextFieldEx(fontRendererObj, dialogX + 10, dialogY + 25, 230, 20, VoxelCamIO.getSelectedPhoto().getName().replaceAll(".png", "")); - subredditField = new GuiTextFieldEx(fontRendererObj, dialogX + 10, dialogY + 70, 230, 20, "minecraft"); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - titleField.setVisible(!posting); - subredditField.setVisible(!posting); - if (!posting) { - if (failed) { - drawCenteredString(fontRendererObj, I18n.format("failedtopost"), dialogX + dialogWidth / 2, dialogY + dialogHeight - 35, 0xFF0000); - } - drawString(fontRendererObj, I18n.format("posttitle") + ":", dialogX + 10, dialogY + 10, 0xFFFFFF); - titleField.drawTextBox(); - drawString(fontRendererObj, I18n.format("subreddit") + ":", dialogX + 10, dialogY + 55, 0xFFFFFF); - subredditField.drawTextBox(); - } else { - drawCenteredString(fontRendererObj, I18n.format("posting") + "...", dialogX + dialogWidth / 2, dialogY + dialogHeight / 2 - 10, 0xFFFFFF); - } - - if (subredditField.getText().equals("mylittlepony")) { //EE - setTexMapSize(180); - drawTexturedModalRect(karmapony, width - 150, height - 130, width, height, 0, 0, 180, 163); - } - } - - @Override - protected void mouseClickedEx(int mouseX, int mouseY, int button) { - super.mouseClickedEx(mouseX, mouseY, button); - titleField.mouseClicked(mouseX, mouseY, button); - subredditField.mouseClicked(mouseX, mouseY, button); - } - - @Override - protected void onKeyTyped(char keyChar, int keyCode) { - super.onKeyTyped(keyChar, keyCode); - titleField.textboxKeyTyped(keyChar, keyCode); - subredditField.textboxKeyTyped(keyChar, keyCode); - } - - /** - * Handle a button event - * - * @param guibutton Button or control which sourced the event - */ - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == this.btnCancel.id) { - this.dialogResult = DialogResult.Cancel; - this.closeDialog(); - } - if (guibutton.id == this.btnOk.id) { - if (this.validateDialog()) { - this.dialogResult = DialogResult.OK; - this.onSubmit(); - } - } - } - - @Override - public void onSubmit() { - posting = true; - RedditHandler.doRedditPost(titleField.getText(), subredditField.getText(), VoxelCamIO.getSelectedPhoto(), this); - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - public void onPostSuccess(String postUrl) { - AbstractionLayer.getMinecraft().displayGuiScreen(new RedditPostSuccessPopup(getParentScreen(), postUrl)); - } - - @Override - public void onPostFailure() { - posting = false; - failed = true; - } - -} +package com.thatapplefreak.voxelcam.upload.reddit; + +import java.net.URL; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; + +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; +import com.thevoxelbox.common.util.AbstractionLayer; +import com.thevoxelbox.common.util.gui.GuiDialogBox; +import com.thevoxelbox.common.util.gui.GuiTextFieldEx; +import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; + +public class RedditPostPopup extends GuiDialogBox implements IRedditPostCallback, ScreenshotIncapable { + + private static final ResourceLocation karmapony = new ResourceLocation("voxelcam", "textures/karmapony.png"); + + private GuiTextFieldEx titleField, subredditField; + + private boolean failed = false; + + private boolean posting = false;; + + public RedditPostPopup(GuiScreen parentScreen) { + super(parentScreen, 250, 130, I18n.format("postto") + " Reddit"); //TODO Translate + } + + @Override + protected void onInitDialog() { + super.onInitDialog(); + btnOk.displayString = I18n.format("post"); + titleField = new GuiTextFieldEx(fontRendererObj, dialogX + 10, dialogY + 25, 230, 20, VoxelCamIO.getSelectedPhoto().getName().replaceAll(".png", "")); + subredditField = new GuiTextFieldEx(fontRendererObj, dialogX + 10, dialogY + 70, 230, 20, "minecraft"); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + titleField.setVisible(!posting); + subredditField.setVisible(!posting); + if (!posting) { + if (failed) { + drawCenteredString(fontRendererObj, I18n.format("failedtopost"), dialogX + dialogWidth / 2, dialogY + dialogHeight - 35, 0xFF0000); + } + drawString(fontRendererObj, I18n.format("posttitle") + ":", dialogX + 10, dialogY + 10, 0xFFFFFF); + titleField.drawTextBox(); + drawString(fontRendererObj, I18n.format("subreddit") + ":", dialogX + 10, dialogY + 55, 0xFFFFFF); + subredditField.drawTextBox(); + } else { + drawCenteredString(fontRendererObj, I18n.format("posting") + "...", dialogX + dialogWidth / 2, dialogY + dialogHeight / 2 - 10, 0xFFFFFF); + } + + if (subredditField.getText().equals("mylittlepony")) { //EE + setTexMapSize(180); + drawTexturedModalRect(karmapony, width - 150, height - 130, width, height, 0, 0, 180, 163); + } + } + + @Override + protected void mouseClickedEx(int mouseX, int mouseY, int button) { + super.mouseClickedEx(mouseX, mouseY, button); + titleField.mouseClicked(mouseX, mouseY, button); + subredditField.mouseClicked(mouseX, mouseY, button); + } + + @Override + protected void onKeyTyped(char keyChar, int keyCode) { + super.onKeyTyped(keyChar, keyCode); + titleField.textboxKeyTyped(keyChar, keyCode); + subredditField.textboxKeyTyped(keyChar, keyCode); + } + + /** + * Handle a button event + * + * @param guibutton Button or control which sourced the event + */ + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.id == this.btnCancel.id) { + this.dialogResult = DialogResult.Cancel; + this.closeDialog(); + } + if (guibutton.id == this.btnOk.id) { + if (this.validateDialog()) { + this.dialogResult = DialogResult.OK; + this.onSubmit(); + } + } + } + + @Override + public void onSubmit() { + posting = true; + RedditHandler.doRedditPost(titleField.getText(), subredditField.getText(), VoxelCamIO.getSelectedPhoto(), this); + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + public void onPostSuccess(String postUrl) { + AbstractionLayer.getMinecraft().displayGuiScreen(new RedditPostSuccessPopup(getParentScreen(), postUrl)); + } + + @Override + public void onPostFailure() { + posting = false; + failed = true; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java rename to src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java index 02b62be..d936bc2 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java @@ -1,63 +1,63 @@ -package com.thatapplefreak.voxelcam.upload.reddit; - -import java.awt.Toolkit; -import java.awt.datatransfer.StringSelection; -import java.net.URL; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurDelete; -import com.thevoxelbox.common.util.BrowserOpener; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class RedditPostSuccessPopup extends GuiDialogBox implements ScreenshotIncapable { - - private final String url; - - private GuiButton btnView, btnClipboard; - - public RedditPostSuccessPopup(GuiScreen parentScreen, String postUrl) { - super(parentScreen, 365, 80, I18n.format("redditpostsuccess")); - this.url = postUrl; - } - - @Override - protected void onInitDialog() { - btnCancel.visible = false; - btnCancel.enabled = false; - btnView = new GuiButton(100, dialogX + dialogWidth - 186, dialogY + dialogHeight - 22, 60, 20, I18n.format("open")); - buttonList.add(btnView); - btnClipboard = new GuiButton(200, dialogX + dialogWidth - 124, dialogY + dialogHeight - 22, 60, 20, I18n.format("copylink")); - buttonList.add(btnClipboard); - } - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == btnView.id) { - BrowserOpener.openURLstringInBrowser(url); - } else if (guibutton.id == btnClipboard.id) { - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null); - } - - super.actionPerformed(guibutton); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - drawCenteredString(fontRendererObj, I18n.format("postsuccess"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFFAA00); - drawCenteredString(fontRendererObj, this.url, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFFF55); - } - - @Override - public void onSubmit() { - } - - @Override - public boolean validateDialog() { - return true; - } - -} +package com.thatapplefreak.voxelcam.upload.reddit; + +import java.awt.Toolkit; +import java.awt.datatransfer.StringSelection; +import java.net.URL; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurDelete; +import com.thevoxelbox.common.util.BrowserOpener; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class RedditPostSuccessPopup extends GuiDialogBox implements ScreenshotIncapable { + + private final String url; + + private GuiButton btnView, btnClipboard; + + public RedditPostSuccessPopup(GuiScreen parentScreen, String postUrl) { + super(parentScreen, 365, 80, I18n.format("redditpostsuccess")); + this.url = postUrl; + } + + @Override + protected void onInitDialog() { + btnCancel.visible = false; + btnCancel.enabled = false; + btnView = new GuiButton(100, dialogX + dialogWidth - 186, dialogY + dialogHeight - 22, 60, 20, I18n.format("open")); + buttonList.add(btnView); + btnClipboard = new GuiButton(200, dialogX + dialogWidth - 124, dialogY + dialogHeight - 22, 60, 20, I18n.format("copylink")); + buttonList.add(btnClipboard); + } + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.id == btnView.id) { + BrowserOpener.openURLstringInBrowser(url); + } else if (guibutton.id == btnClipboard.id) { + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null); + } + + super.actionPerformed(guibutton); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + drawCenteredString(fontRendererObj, I18n.format("postsuccess"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFFAA00); + drawCenteredString(fontRendererObj, this.url, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFFF55); + } + + @Override + public void onSubmit() { + } + + @Override + public boolean validateDialog() { + return true; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java rename to src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java index 38436cb..f2c0502 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java @@ -1,94 +1,94 @@ -package com.thatapplefreak.voxelcam.upload.twitter; - -import java.io.File; - -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; - -import twitter4j.Status; -import twitter4j.StatusUpdate; -import twitter4j.Twitter; -import twitter4j.TwitterException; -import twitter4j.TwitterFactory; -import twitter4j.auth.AccessToken; -import twitter4j.auth.RequestToken; - -public abstract class TwitterHandler { - - public static final String CONSUMER_KEY = "okIIDosE4TsrRP3JvXufw"; - public static final String CONSUMER_SECRET = "dFJIErDmYr61YwQfDdAGMAt79dCJGu1mpiflCAa2c"; - - public static Twitter twitter = TwitterFactory.getSingleton(); - public static RequestToken requestToken; - static { - twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); - try { - TwitterHandler.requestToken = twitter.getOAuthRequestToken(); - } catch (TwitterException e) { - e.printStackTrace(); - } - } - - public static void doTwitter(final TwitterPostPopup callbackGui, final File screenshot, final String text) { - Long twitterUserID = Long.parseLong(VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERUSERID)); - String userAuthToken = VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERAUTHTOKEN); - String userAuthTokenSecret = VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERAUTHTOKENSECRET); - twitter.setOAuthAccessToken(new AccessToken(userAuthToken, userAuthTokenSecret, twitterUserID)); - new Thread("Twitter_Post_Thread") { - @Override - public void run() { - StatusUpdate statusupdate = new StatusUpdate(text + " #VoxelCam"); - statusupdate.setMedia(screenshot); - try { - Status status = twitter.updateStatus(statusupdate); - String address = "http://twitter.com/" + status.getUser().getScreenName() + "/status/" + status.getId(); - callbackGui.onUploadComplete(new TwitterUploadSuccessPopup(callbackGui.getParentScreen(), status.getId(), address)); - } catch (TwitterException e) { - callbackGui.onUploadComplete(new TwitterUploadFailedPopup(callbackGui, statusupdate, I18n.format("errorcode") + ": " + Integer.toString(e.getErrorCode()))); - } - } - }.start(); - } - - public static TwitterOauthGrabber getAGrabber(String pin, TwitterPINPopup callbackGui) { - return new TwitterOauthGrabber(pin, callbackGui); - } - - public static class TwitterOauthGrabber implements Runnable { - - private String pin; - private TwitterPINPopup callbackGui; - - public TwitterOauthGrabber(String pin, TwitterPINPopup callbackGui) { - this.pin = pin; - this.callbackGui = callbackGui; - } - - @Override - public void run() { - AccessToken accessToken = null; - while (accessToken == null || accessToken.getToken() == null) { - try { - accessToken = twitter.getOAuthAccessToken(TwitterHandler.requestToken, pin); - } catch (TwitterException e) { - } - } - storeAccessToken(accessToken); - callbackGui.goToPostGUI(); - } - - private void storeAccessToken(AccessToken accessToken) { - System.out.println("[VoxelCam] Setting Twitter access token"); - VoxelCamCore.getConfig().setProperty(VoxelCamConfig.TWITTERAUTHTOKEN, accessToken.getToken()); - VoxelCamCore.getConfig().setProperty(VoxelCamConfig.TWITTERAUTHTOKENSECRET, accessToken.getTokenSecret()); - VoxelCamCore.getConfig().setProperty(VoxelCamConfig.TWITTERUSERID, String.valueOf(accessToken.getUserId())); - } - } -} +package com.thatapplefreak.voxelcam.upload.twitter; + +import java.io.File; + +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; + +import twitter4j.Status; +import twitter4j.StatusUpdate; +import twitter4j.Twitter; +import twitter4j.TwitterException; +import twitter4j.TwitterFactory; +import twitter4j.auth.AccessToken; +import twitter4j.auth.RequestToken; + +public abstract class TwitterHandler { + + public static final String CONSUMER_KEY = "okIIDosE4TsrRP3JvXufw"; + public static final String CONSUMER_SECRET = "dFJIErDmYr61YwQfDdAGMAt79dCJGu1mpiflCAa2c"; + + public static Twitter twitter = TwitterFactory.getSingleton(); + public static RequestToken requestToken; + static { + twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); + try { + TwitterHandler.requestToken = twitter.getOAuthRequestToken(); + } catch (TwitterException e) { + e.printStackTrace(); + } + } + + public static void doTwitter(final TwitterPostPopup callbackGui, final File screenshot, final String text) { + Long twitterUserID = Long.parseLong(VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERUSERID)); + String userAuthToken = VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERAUTHTOKEN); + String userAuthTokenSecret = VoxelCamCore.getConfig().getStringProperty(VoxelCamConfig.TWITTERAUTHTOKENSECRET); + twitter.setOAuthAccessToken(new AccessToken(userAuthToken, userAuthTokenSecret, twitterUserID)); + new Thread("Twitter_Post_Thread") { + @Override + public void run() { + StatusUpdate statusupdate = new StatusUpdate(text + " #VoxelCam"); + statusupdate.setMedia(screenshot); + try { + Status status = twitter.updateStatus(statusupdate); + String address = "http://twitter.com/" + status.getUser().getScreenName() + "/status/" + status.getId(); + callbackGui.onUploadComplete(new TwitterUploadSuccessPopup(callbackGui.getParentScreen(), status.getId(), address)); + } catch (TwitterException e) { + callbackGui.onUploadComplete(new TwitterUploadFailedPopup(callbackGui, statusupdate, I18n.format("errorcode") + ": " + Integer.toString(e.getErrorCode()))); + } + } + }.start(); + } + + public static TwitterOauthGrabber getAGrabber(String pin, TwitterPINPopup callbackGui) { + return new TwitterOauthGrabber(pin, callbackGui); + } + + public static class TwitterOauthGrabber implements Runnable { + + private String pin; + private TwitterPINPopup callbackGui; + + public TwitterOauthGrabber(String pin, TwitterPINPopup callbackGui) { + this.pin = pin; + this.callbackGui = callbackGui; + } + + @Override + public void run() { + AccessToken accessToken = null; + while (accessToken == null || accessToken.getToken() == null) { + try { + accessToken = twitter.getOAuthAccessToken(TwitterHandler.requestToken, pin); + } catch (TwitterException e) { + } + } + storeAccessToken(accessToken); + callbackGui.goToPostGUI(); + } + + private void storeAccessToken(AccessToken accessToken) { + System.out.println("[VoxelCam] Setting Twitter access token"); + VoxelCamCore.getConfig().setProperty(VoxelCamConfig.TWITTERAUTHTOKEN, accessToken.getToken()); + VoxelCamCore.getConfig().setProperty(VoxelCamConfig.TWITTERAUTHTOKENSECRET, accessToken.getTokenSecret()); + VoxelCamCore.getConfig().setProperty(VoxelCamConfig.TWITTERUSERID, String.valueOf(accessToken.getUserId())); + } + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java similarity index 97% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java rename to src/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java index 60d175b..d5aa0ac 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterLoginPopup.java @@ -1,40 +1,40 @@ -package com.thatapplefreak.voxelcam.upload.twitter; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thevoxelbox.common.util.gui.GuiDialogBox; - - -public class TwitterLoginPopup extends GuiDialogBox { - - public TwitterLoginPopup(GuiScreen parentScreen) { - super(parentScreen, 210, 90, "Log in to Twitter"); - } - - @Override - protected void onInitDialog() { - btnOk.displayString = "Ok"; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - drawString(fontRendererObj, I18n.format("twitauthline1"), width / 2 - (150 / 2), height / 2 - 37, 0xFFFFFF); - drawString(fontRendererObj, I18n.format("twitauthline2"), width / 2 - (150 / 2) - 25, height / 2 - 27, 0xFFFFFF); - drawString(fontRendererObj, I18n.format("twitauthline3"), width / 2 - (150 / 2) - 25, height / 2 - 17, 0xFFFFFF); - drawString(fontRendererObj, I18n.format("twitauthline4"), width / 2 - (150 / 2) - 25, height / 2 - 7, 0xFFFFFF); - drawString(fontRendererObj, I18n.format("twitauthline5"), width / 2 - (150 / 2) - 25, height / 2 + 3, 0xFFFFFF); - } - - @Override - public boolean validateDialog() { - mc.displayGuiScreen(new TwitterPINPopup(getParentScreen())); - return false; - } - - @Override - public void onSubmit() { - } - -} +package com.thatapplefreak.voxelcam.upload.twitter; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thevoxelbox.common.util.gui.GuiDialogBox; + + +public class TwitterLoginPopup extends GuiDialogBox { + + public TwitterLoginPopup(GuiScreen parentScreen) { + super(parentScreen, 210, 90, "Log in to Twitter"); + } + + @Override + protected void onInitDialog() { + btnOk.displayString = "Ok"; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + drawString(fontRendererObj, I18n.format("twitauthline1"), width / 2 - (150 / 2), height / 2 - 37, 0xFFFFFF); + drawString(fontRendererObj, I18n.format("twitauthline2"), width / 2 - (150 / 2) - 25, height / 2 - 27, 0xFFFFFF); + drawString(fontRendererObj, I18n.format("twitauthline3"), width / 2 - (150 / 2) - 25, height / 2 - 17, 0xFFFFFF); + drawString(fontRendererObj, I18n.format("twitauthline4"), width / 2 - (150 / 2) - 25, height / 2 - 7, 0xFFFFFF); + drawString(fontRendererObj, I18n.format("twitauthline5"), width / 2 - (150 / 2) - 25, height / 2 + 3, 0xFFFFFF); + } + + @Override + public boolean validateDialog() { + mc.displayGuiScreen(new TwitterPINPopup(getParentScreen())); + return false; + } + + @Override + public void onSubmit() { + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java rename to src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java index ce3e559..391bc19 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java @@ -1,78 +1,78 @@ -package com.thatapplefreak.voxelcam.upload.twitter; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.resources.I18n; -import twitter4j.TwitterException; -import twitter4j.auth.AccessToken; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterHandler.TwitterOauthGrabber; -import com.thevoxelbox.common.util.BrowserOpener; -import com.thevoxelbox.common.util.gui.GuiDialogBox; -import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; - -public class TwitterPINPopup extends GuiDialogBox { - - private GuiTextField pinBox; - - private boolean b = false; - - public TwitterPINPopup(GuiScreen parentScreen) { - super(parentScreen, 200, 75, I18n.format("pleaseenterpin")); - } - - @Override - protected void onInitDialog() { - pinBox = new GuiTextField(fontRendererObj, width / 2 - (150 / 2), height / 2 - (16 / 2) - 8, 150, 16); - BrowserOpener.openURLstringInBrowser(TwitterHandler.requestToken.getAuthorizationURL()); - } - - @Override - public void onSubmit() { - TwitterOauthGrabber grabber = TwitterHandler.getAGrabber(pinBox.getText(), this); - new Thread(grabber).start(); - } - - @Override - public boolean validateDialog() { - return pinBox.getText().length() == 7; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - pinBox.drawTextBox(); - } - - @Override - protected void mouseClickedEx(int mouseX, int mouseY, int button) { - super.mouseClickedEx(mouseX, mouseY, button); - pinBox.mouseClicked(mouseX, mouseY, button); - } - - @Override - protected void onKeyTyped(char keyChar, int keyCode) { - pinBox.textboxKeyTyped(keyChar, keyCode); - } - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == this.btnCancel.id) { - this.dialogResult = DialogResult.Cancel; - this.closeDialog(); - } - if (guibutton.id == this.btnOk.id) { - if (this.validateDialog()) { - this.dialogResult = DialogResult.OK; - this.onSubmit(); - } - } - } - - public void goToPostGUI() { - mc.displayGuiScreen(new TwitterPostPopup(getParentScreen())); - } -} +package com.thatapplefreak.voxelcam.upload.twitter; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import twitter4j.TwitterException; +import twitter4j.auth.AccessToken; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.upload.twitter.TwitterHandler.TwitterOauthGrabber; +import com.thevoxelbox.common.util.BrowserOpener; +import com.thevoxelbox.common.util.gui.GuiDialogBox; +import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; + +public class TwitterPINPopup extends GuiDialogBox { + + private GuiTextField pinBox; + + private boolean b = false; + + public TwitterPINPopup(GuiScreen parentScreen) { + super(parentScreen, 200, 75, I18n.format("pleaseenterpin")); + } + + @Override + protected void onInitDialog() { + pinBox = new GuiTextField(fontRendererObj, width / 2 - (150 / 2), height / 2 - (16 / 2) - 8, 150, 16); + BrowserOpener.openURLstringInBrowser(TwitterHandler.requestToken.getAuthorizationURL()); + } + + @Override + public void onSubmit() { + TwitterOauthGrabber grabber = TwitterHandler.getAGrabber(pinBox.getText(), this); + new Thread(grabber).start(); + } + + @Override + public boolean validateDialog() { + return pinBox.getText().length() == 7; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + pinBox.drawTextBox(); + } + + @Override + protected void mouseClickedEx(int mouseX, int mouseY, int button) { + super.mouseClickedEx(mouseX, mouseY, button); + pinBox.mouseClicked(mouseX, mouseY, button); + } + + @Override + protected void onKeyTyped(char keyChar, int keyCode) { + pinBox.textboxKeyTyped(keyChar, keyCode); + } + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.id == this.btnCancel.id) { + this.dialogResult = DialogResult.Cancel; + this.closeDialog(); + } + if (guibutton.id == this.btnOk.id) { + if (this.validateDialog()) { + this.dialogResult = DialogResult.OK; + this.onSubmit(); + } + } + } + + public void goToPostGUI() { + mc.displayGuiScreen(new TwitterPostPopup(getParentScreen())); + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java rename to src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java index c36db11..1f86343 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java @@ -1,90 +1,90 @@ -package com.thatapplefreak.voxelcam.upload.twitter; - -import java.io.File; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.resources.I18n; -import twitter4j.Status; -import twitter4j.TwitterException; -import twitter4j.auth.AccessToken; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class TwitterPostPopup extends GuiDialogBox { - - private boolean uploading = false; - - private volatile GuiScreen completeDialog; - - private GuiTextField textbox; - - private int tweetLengh = 100; - - public TwitterPostPopup(GuiScreen parentScreen) { - super(parentScreen, 210, 90, I18n.format("postto") + " Twitter"); - } - - @Override - protected void onInitDialog() { - btnOk.displayString = I18n.format("post"); - textbox = new GuiTextField(fontRendererObj, width / 2 - (200 / 2), height / 2 - (16 / 2) - 8, 200, 16); - textbox.setMaxStringLength(tweetLengh); - textbox.setFocused(true); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - super.drawDialog(mouseX, mouseY, f); - - if (uploading) { - buttonList.clear(); - drawCenteredString(fontRendererObj, I18n.format("uploading") + "...", width / 2, height / 2, 0xFFFFFF); - } else { - textbox.drawTextBox(); - drawString(fontRendererObj, I18n.format("composetweet") + ":", dialogX + 5, height / 2 - 28, 0xFFFFFF); - drawString(fontRendererObj, I18n.format("remainingletters") + ":", width / 2 - 5, height / 2 + 5, 0xFFFFFF); - drawString(fontRendererObj, Integer.toString(tweetLengh - textbox.getText().length()), width / 2 + 84, height / 2 + 5, 0xFFFFFF); - } - - if (this.completeDialog != null) { - this.mc.displayGuiScreen(this.completeDialog); - this.completeDialog = null; - } - } - - @Override - protected void mouseClickedEx(int mouseX, int mouseY, int button) { - super.mouseClickedEx(mouseX, mouseY, button); - textbox.mouseClicked(mouseX, mouseY, button); - } - - @Override - protected void onKeyTyped(char keyChar, int keyCode) { - textbox.textboxKeyTyped(keyChar, keyCode); - } - - @Override - public void onSubmit() { - } - - @Override - public boolean validateDialog() { - TwitterHandler.doTwitter(this, VoxelCamIO.getSelectedPhoto(), textbox.getText()); - uploading = true; - return false; - } - - public void onUploadComplete(GuiScreen result) { - this.completeDialog = result; - } - -} +package com.thatapplefreak.voxelcam.upload.twitter; + +import java.io.File; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import twitter4j.Status; +import twitter4j.TwitterException; +import twitter4j.auth.AccessToken; + +import com.thatapplefreak.voxelcam.VoxelCamCore; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; +import com.thatapplefreak.voxelcam.io.VoxelCamIO; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; +import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class TwitterPostPopup extends GuiDialogBox { + + private boolean uploading = false; + + private volatile GuiScreen completeDialog; + + private GuiTextField textbox; + + private int tweetLengh = 100; + + public TwitterPostPopup(GuiScreen parentScreen) { + super(parentScreen, 210, 90, I18n.format("postto") + " Twitter"); + } + + @Override + protected void onInitDialog() { + btnOk.displayString = I18n.format("post"); + textbox = new GuiTextField(fontRendererObj, width / 2 - (200 / 2), height / 2 - (16 / 2) - 8, 200, 16); + textbox.setMaxStringLength(tweetLengh); + textbox.setFocused(true); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + super.drawDialog(mouseX, mouseY, f); + + if (uploading) { + buttonList.clear(); + drawCenteredString(fontRendererObj, I18n.format("uploading") + "...", width / 2, height / 2, 0xFFFFFF); + } else { + textbox.drawTextBox(); + drawString(fontRendererObj, I18n.format("composetweet") + ":", dialogX + 5, height / 2 - 28, 0xFFFFFF); + drawString(fontRendererObj, I18n.format("remainingletters") + ":", width / 2 - 5, height / 2 + 5, 0xFFFFFF); + drawString(fontRendererObj, Integer.toString(tweetLengh - textbox.getText().length()), width / 2 + 84, height / 2 + 5, 0xFFFFFF); + } + + if (this.completeDialog != null) { + this.mc.displayGuiScreen(this.completeDialog); + this.completeDialog = null; + } + } + + @Override + protected void mouseClickedEx(int mouseX, int mouseY, int button) { + super.mouseClickedEx(mouseX, mouseY, button); + textbox.mouseClicked(mouseX, mouseY, button); + } + + @Override + protected void onKeyTyped(char keyChar, int keyCode) { + textbox.textboxKeyTyped(keyChar, keyCode); + } + + @Override + public void onSubmit() { + } + + @Override + public boolean validateDialog() { + TwitterHandler.doTwitter(this, VoxelCamIO.getSelectedPhoto(), textbox.getText()); + uploading = true; + return false; + } + + public void onUploadComplete(GuiScreen result) { + this.completeDialog = result; + } + +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java rename to src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java index e6864e0..59e9c16 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java @@ -1,76 +1,76 @@ -package com.thatapplefreak.voxelcam.upload.twitter; - -import twitter4j.Status; -import twitter4j.StatusUpdate; -import twitter4j.TwitterException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class TwitterUploadFailedPopup extends GuiDialogBox { - - private String errorMessage; - - private StatusUpdate failedUpdate; - - private boolean retrying = false; - - public TwitterUploadFailedPopup(TwitterPostPopup parentScreen, StatusUpdate failedUpdate, String errorMessage) { - super(parentScreen, 320, 80, I18n.format("twitterpostfailed")); - this.failedUpdate = failedUpdate; - this.errorMessage = errorMessage; - } - - @Override - protected void onInitDialog() { - btnOk.displayString = "Retry"; - } - - @Override - public void onSubmit() { - new Thread("Twitter_Post_Thread") { - @Override - public void run() { - try { - Status status = TwitterHandler.twitter.updateStatus(failedUpdate); - String address = "http://twitter.com/" + status.getUser().getScreenName() + "/status/" + status.getId(); - ((TwitterPostPopup)getParentScreen()).onUploadComplete(new TwitterUploadSuccessPopup(((TwitterPostPopup)getParentScreen()).getParentScreen(), status.getId(), address)); - } catch (TwitterException e) { - ((TwitterPostPopup)getParentScreen()).onUploadComplete(new TwitterUploadFailedPopup(((TwitterPostPopup)getParentScreen()), failedUpdate, I18n.format("errorcode") + ": " + Integer.toString(e.getErrorCode()))); - } - } - }.start(); - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - drawCenteredString(fontRendererObj, I18n.format("postfailed"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFF5555); - drawCenteredString(fontRendererObj, this.errorMessage, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFAA00); - } - - - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.equals(btnOk)) { - retrying = true; - } - super.actionPerformed(guibutton); - } - - @Override - protected void closeDialog() { - if (retrying) { - super.closeDialog(); - } else { - mc.displayGuiScreen(((TwitterPostPopup) getParentScreen()).getParentScreen()); - } - } -} +package com.thatapplefreak.voxelcam.upload.twitter; + +import twitter4j.Status; +import twitter4j.StatusUpdate; +import twitter4j.TwitterException; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class TwitterUploadFailedPopup extends GuiDialogBox { + + private String errorMessage; + + private StatusUpdate failedUpdate; + + private boolean retrying = false; + + public TwitterUploadFailedPopup(TwitterPostPopup parentScreen, StatusUpdate failedUpdate, String errorMessage) { + super(parentScreen, 320, 80, I18n.format("twitterpostfailed")); + this.failedUpdate = failedUpdate; + this.errorMessage = errorMessage; + } + + @Override + protected void onInitDialog() { + btnOk.displayString = "Retry"; + } + + @Override + public void onSubmit() { + new Thread("Twitter_Post_Thread") { + @Override + public void run() { + try { + Status status = TwitterHandler.twitter.updateStatus(failedUpdate); + String address = "http://twitter.com/" + status.getUser().getScreenName() + "/status/" + status.getId(); + ((TwitterPostPopup)getParentScreen()).onUploadComplete(new TwitterUploadSuccessPopup(((TwitterPostPopup)getParentScreen()).getParentScreen(), status.getId(), address)); + } catch (TwitterException e) { + ((TwitterPostPopup)getParentScreen()).onUploadComplete(new TwitterUploadFailedPopup(((TwitterPostPopup)getParentScreen()), failedUpdate, I18n.format("errorcode") + ": " + Integer.toString(e.getErrorCode()))); + } + } + }.start(); + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + drawCenteredString(fontRendererObj, I18n.format("postfailed"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFF5555); + drawCenteredString(fontRendererObj, this.errorMessage, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFAA00); + } + + + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.equals(btnOk)) { + retrying = true; + } + super.actionPerformed(guibutton); + } + + @Override + protected void closeDialog() { + if (retrying) { + super.closeDialog(); + } else { + mc.displayGuiScreen(((TwitterPostPopup) getParentScreen()).getParentScreen()); + } + } +} diff --git a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java similarity index 96% rename from VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java rename to src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java index 4123138..d42b1a1 100644 --- a/VoxelCam/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java @@ -1,73 +1,73 @@ -package com.thatapplefreak.voxelcam.upload.twitter; - -import java.awt.Toolkit; -import java.awt.datatransfer.StringSelection; - -import twitter4j.TwitterException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.upload.imgur.ImgurDelete; -import com.thevoxelbox.common.util.BrowserOpener; -import com.thevoxelbox.common.util.gui.GuiDialogBox; - -public class TwitterUploadSuccessPopup extends GuiDialogBox { - - private final String url; - private final long postID; - - private GuiButton btnView, btnClipboard; - - public TwitterUploadSuccessPopup(GuiScreen parentScreen, long postID, String url) { - super(parentScreen, 320, 80, I18n.format("twitterpostsuccess")); - this.postID = postID; - this.url = url; - } - - @Override - protected void onInitDialog() { - btnCancel.displayString = I18n.format("undo"); - btnView = new GuiButton(100, dialogX + dialogWidth - 248, dialogY + dialogHeight - 22, 60, 20, I18n.format("open")); - buttonList.add(btnView); - btnClipboard = new GuiButton(200, dialogX + dialogWidth - 186, dialogY + dialogHeight - 22, 60, 20, I18n.format("copylink")); - buttonList.add(btnClipboard); - } - - @Override - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == btnCancel.id) { - new Thread("Twitter Post Undo Thread") { - @Override - public void run() { - try { - TwitterHandler.twitter.destroyStatus(postID); - } catch (TwitterException e) { - e.printStackTrace(); - } - } - }.start(); - } else if (guibutton.id == btnView.id) { - BrowserOpener.openURLstringInBrowser(url); - } else if (guibutton.id == btnClipboard.id) { - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null); - } - - super.actionPerformed(guibutton); - } - - @Override - protected void drawDialog(int mouseX, int mouseY, float f) { - drawCenteredString(fontRendererObj, I18n.format("postcompletedsuccessfully"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFFAA00); - drawCenteredString(fontRendererObj, this.url, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFFF55); - } - - @Override - public boolean validateDialog() { - return true; - } - - @Override - public void onSubmit() { - } -} +package com.thatapplefreak.voxelcam.upload.twitter; + +import java.awt.Toolkit; +import java.awt.datatransfer.StringSelection; + +import twitter4j.TwitterException; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +import com.thatapplefreak.voxelcam.upload.imgur.ImgurDelete; +import com.thevoxelbox.common.util.BrowserOpener; +import com.thevoxelbox.common.util.gui.GuiDialogBox; + +public class TwitterUploadSuccessPopup extends GuiDialogBox { + + private final String url; + private final long postID; + + private GuiButton btnView, btnClipboard; + + public TwitterUploadSuccessPopup(GuiScreen parentScreen, long postID, String url) { + super(parentScreen, 320, 80, I18n.format("twitterpostsuccess")); + this.postID = postID; + this.url = url; + } + + @Override + protected void onInitDialog() { + btnCancel.displayString = I18n.format("undo"); + btnView = new GuiButton(100, dialogX + dialogWidth - 248, dialogY + dialogHeight - 22, 60, 20, I18n.format("open")); + buttonList.add(btnView); + btnClipboard = new GuiButton(200, dialogX + dialogWidth - 186, dialogY + dialogHeight - 22, 60, 20, I18n.format("copylink")); + buttonList.add(btnClipboard); + } + + @Override + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.id == btnCancel.id) { + new Thread("Twitter Post Undo Thread") { + @Override + public void run() { + try { + TwitterHandler.twitter.destroyStatus(postID); + } catch (TwitterException e) { + e.printStackTrace(); + } + } + }.start(); + } else if (guibutton.id == btnView.id) { + BrowserOpener.openURLstringInBrowser(url); + } else if (guibutton.id == btnClipboard.id) { + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null); + } + + super.actionPerformed(guibutton); + } + + @Override + protected void drawDialog(int mouseX, int mouseY, float f) { + drawCenteredString(fontRendererObj, I18n.format("postcompletedsuccessfully"), dialogX + (dialogWidth / 2), dialogY + 18, 0xFFFFAA00); + drawCenteredString(fontRendererObj, this.url, dialogX + (dialogWidth / 2), dialogY + 32, 0xFFFFFF55); + } + + @Override + public boolean validateDialog() { + return true; + } + + @Override + public void onSubmit() { + } +} From 5a5547fb14f681307af36de8cc77f16525daaf43 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:04:23 +0100 Subject: [PATCH 2/8] Add missing annotations --- src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java | 2 ++ .../thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java b/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java index 492920a..d20a75d 100644 --- a/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java +++ b/src/com/thatapplefreak/voxelcam/LiteModVoxelCam.java @@ -8,10 +8,12 @@ public LiteModVoxelCam() { super("com.thatapplefreak.voxelcam.VoxelCamCore"); } + @Override public String getVersion() { return "1.3.1"; } + @Override public String getName() { return "VoxelCam"; } diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java index 2983048..bbd3d83 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java @@ -52,12 +52,14 @@ protected void drawDialog(int mouseX, int mouseY, float f) { passwordField.drawTextBox(); } + @Override public void onLoginSuccess() { VoxelCamCore.getConfig().setProperty(VoxelCamConfig.REDDITUSERNAME, usernameField.getText()); VoxelCamCore.getConfig().setProperty(VoxelCamConfig.REDDITPASSWORD, passwordField.getText()); AbstractionLayer.getMinecraft().displayGuiScreen(new RedditPostPopup(getParentScreen())); } + @Override public void onLoginFailure() { loggingIn = false; failed = true; From 9b256648817c83fd1a031425bf2ac11d898b6998 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:17:04 +0100 Subject: [PATCH 3/8] Fix a bunch of synthetic accesses --- .../voxelcam/gui/editor/GuiEditScreenshot.java | 8 ++++---- .../voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java | 6 +++++- .../voxelcam/imagehandle/ScreenshotTaker.java | 6 +++--- .../voxelcam/upload/reddit/RedditHandler.java | 4 ++-- .../voxelcam/upload/twitter/TwitterUploadFailedPopup.java | 2 +- .../upload/twitter/TwitterUploadSuccessPopup.java | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java b/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java index 0c515a1..8c07260 100644 --- a/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java +++ b/src/com/thatapplefreak/voxelcam/gui/editor/GuiEditScreenshot.java @@ -22,19 +22,19 @@ public class GuiEditScreenshot extends AdvancedDrawGui { /** * File refrence of the Screenshot */ - private final File screenshotFile; + protected final File screenshotFile; /** * This is the raw data for the Screenshot before undergoing changes */ - private BufferedImage uneditedScreenshot; + protected BufferedImage uneditedScreenshot; /** * This is the image created by adding the users edits */ - private BufferedImage editedScreenshot; + protected BufferedImage editedScreenshot; - private boolean loading = true; + protected boolean loading = true; public GuiEditScreenshot(GuiScreen parent, final File screenshot) { this.parentScreen = parent; diff --git a/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java b/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java index 0f554af..3113e79 100644 --- a/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java +++ b/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java @@ -39,6 +39,7 @@ public void initGui() { properties.add(new VoxelPropertyAbstractButton(config, null, "720p", PANEL_LEFT + 70, PANEL_TOP + 24) { @Override protected void onClick() { + VoxelCamConfig config = VoxelCamCore.getConfig(); config.setProperty(VoxelCamConfig.PHOTOWIDTH, 1280); config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 720); updateFields(); @@ -47,6 +48,7 @@ protected void onClick() { properties.add(new VoxelPropertyAbstractButton(config, null, "1080p", PANEL_LEFT + 70, PANEL_TOP + 44) { @Override protected void onClick() { + VoxelCamConfig config = VoxelCamCore.getConfig(); config.setProperty(VoxelCamConfig.PHOTOWIDTH, 1920); config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 1080); updateFields(); @@ -55,6 +57,7 @@ protected void onClick() { properties.add(new VoxelPropertyAbstractButton(config, null, "4K (2160p)", PANEL_LEFT + 145, PANEL_TOP + 24) { @Override protected void onClick() { + VoxelCamConfig config = VoxelCamCore.getConfig(); config.setProperty(VoxelCamConfig.PHOTOWIDTH, 3840); config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 2160); updateFields(); @@ -63,6 +66,7 @@ protected void onClick() { properties.add(new VoxelPropertyAbstractButton(config, null, "IMAX", PANEL_LEFT + 145, PANEL_TOP + 44) { @Override protected void onClick() { + VoxelCamConfig config = VoxelCamCore.getConfig(); config.setProperty(VoxelCamConfig.PHOTOWIDTH, 10000); config.setProperty(VoxelCamConfig.PHOTOHEIGHT, 7000); updateFields(); @@ -77,7 +81,7 @@ protected void onClick() { properties.add(new VoxelPropertyCheckBox(config, VoxelCamConfig.AUTO_UPLOAD_GOOGLEDRIVE, I18n.format("to") + " Google Drive", PANEL_LEFT + 20, PANEL_TOP + 125)); } - private void updateFields() { + protected void updateFields() { widthField.update(); heightField.update(); } diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java index 27220fb..260a702 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java @@ -61,8 +61,8 @@ public static void capture(int width, int height) { save(pixelValues, width, height, screenshotName); } - private static int savepercent = 0; - private static boolean isWritingToFile = false; + protected static int savepercent = 0; + protected static boolean isWritingToFile = false; private static void save(final int[] pixelValues, final int width, final int height, final File saveTo) { Thread imageSaveThread = new Thread("ImageSaver") { @@ -119,7 +119,7 @@ public static int getSavePercent() { return savepercent; } - private static void upload(final File saveTo) { + protected static void upload(final File saveTo) { if (VoxelCamCore.getConfig().getBoolProperty(VoxelCamConfig.AUTO_UPLOAD)) { AutoUploader.upload(saveTo); } diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java index cb7f0b0..dccae78 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java @@ -18,12 +18,12 @@ public abstract class RedditHandler { - private static User reddit; + protected static User reddit; /** * user is logged into reddit */ - private static boolean loggedIn = false; + protected static boolean loggedIn = false; /** * Post image to reddit diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java index 59e9c16..8c016d8 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java @@ -13,7 +13,7 @@ public class TwitterUploadFailedPopup extends GuiDialogBox { private String errorMessage; - private StatusUpdate failedUpdate; + protected StatusUpdate failedUpdate; private boolean retrying = false; diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java index d42b1a1..ab3c35e 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java @@ -15,7 +15,7 @@ public class TwitterUploadSuccessPopup extends GuiDialogBox { private final String url; - private final long postID; + protected final long postID; private GuiButton btnView, btnClipboard; From ef88aef401d5a12eaaa5e10219544e00f079c95a Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:21:45 +0100 Subject: [PATCH 4/8] Organise imports --- src/com/thatapplefreak/voxelcam/VoxelCamCore.java | 2 -- .../voxelcam/VoxelCamTransformer.java | 11 ----------- .../voxelcam/gui/mainmenu/FirstRunPopup.java | 2 +- .../gui/mainmenu/GuiMainMenuWithPhotoButton.java | 9 ++------- .../voxelcam/gui/mainmenu/PhotoButton.java | 8 ++++---- .../gui/manager/GuiScreenShotManager.java | 10 ---------- .../voxelcam/gui/manager/PostPopup.java | 10 +--------- .../voxelcam/gui/manager/ScalePhotoFrame.java | 1 - .../gui/settings/GuiVoxelCamSettingsPanel.java | 11 ++++++----- .../voxelcam/imagehandle/BigScreenshotTaker.java | 15 +-------------- .../imagehandle/GLImageMemoryHandler.java | 5 +---- .../voxelcam/imagehandle/ImageDrawer.java | 10 +--------- .../voxelcam/imagehandle/ScreenshotNamer.java | 3 --- .../voxelcam/imagehandle/ScreenshotTaker.java | 9 +-------- .../imagehandle/metadata/MetaDataHandler.java | 8 -------- .../thatapplefreak/voxelcam/io/VoxelCamIO.java | 1 - .../voxelcam/upload/AutoUploader.java | 3 +-- .../voxelcam/upload/dropbox/DropboxHandler.java | 2 -- .../voxelcam/upload/facebook/FacebookHandler.java | 7 ------- .../voxelcam/upload/imgur/ImgurHandler.java | 1 - .../upload/reddit/IRedditPostCallback.java | 1 - .../voxelcam/upload/reddit/RedditHandler.java | 3 --- .../voxelcam/upload/reddit/RedditLoginPopup.java | 1 - .../voxelcam/upload/reddit/RedditPostPopup.java | 4 ---- .../upload/reddit/RedditPostSuccessPopup.java | 2 -- .../voxelcam/upload/twitter/TwitterHandler.java | 12 +++--------- .../voxelcam/upload/twitter/TwitterPINPopup.java | 5 ----- .../voxelcam/upload/twitter/TwitterPostPopup.java | 12 ------------ .../upload/twitter/TwitterUploadFailedPopup.java | 5 ++--- .../upload/twitter/TwitterUploadSuccessPopup.java | 3 +-- 30 files changed, 25 insertions(+), 151 deletions(-) diff --git a/src/com/thatapplefreak/voxelcam/VoxelCamCore.java b/src/com/thatapplefreak/voxelcam/VoxelCamCore.java index 4795d48..3047168 100644 --- a/src/com/thatapplefreak/voxelcam/VoxelCamCore.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamCore.java @@ -9,7 +9,6 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; import net.minecraft.client.shader.Framebuffer; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraft.util.ScreenShotHelper; @@ -24,7 +23,6 @@ import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.modconfig.ConfigPanel; import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; -import com.mumfrey.liteloader.util.ModUtilities; import com.thatapplefreak.voxelcam.gui.mainmenu.FirstRunPopup; import com.thatapplefreak.voxelcam.gui.mainmenu.GuiMainMenuWithPhotoButton; import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; diff --git a/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java b/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java index 4d6b0f3..e839220 100644 --- a/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java @@ -1,22 +1,11 @@ package com.thatapplefreak.voxelcam; import java.io.File; -import java.lang.annotation.Annotation; -import net.minecraft.client.Minecraft; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.util.ScreenShotHelper; - -import com.mumfrey.liteloader.ChatRenderListener; import com.mumfrey.liteloader.core.runtime.Obf; -import com.mumfrey.liteloader.transformers.Callback; -import com.mumfrey.liteloader.transformers.Obfuscated; -import com.mumfrey.liteloader.transformers.Callback.CallbackType; -import com.mumfrey.liteloader.transformers.CallbackInjectionTransformer; import com.mumfrey.liteloader.transformers.event.Event; import com.mumfrey.liteloader.transformers.event.EventInjectionTransformer; import com.mumfrey.liteloader.transformers.event.MethodInfo; -import com.mumfrey.liteloader.transformers.event.inject.BeforeInvoke; import com.mumfrey.liteloader.transformers.event.inject.MethodHead; public class VoxelCamTransformer extends EventInjectionTransformer { diff --git a/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java b/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java index 67afd65..e2d060a 100644 --- a/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java +++ b/src/com/thatapplefreak/voxelcam/gui/mainmenu/FirstRunPopup.java @@ -6,8 +6,8 @@ import net.minecraft.util.ResourceLocation; import com.mumfrey.liteloader.core.LiteLoader; -import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thevoxelbox.common.util.BrowserOpener; import com.thevoxelbox.common.util.gui.GuiDialogBox; diff --git a/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java b/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java index 7fc2e70..ceefb8a 100644 --- a/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java +++ b/src/com/thatapplefreak/voxelcam/gui/mainmenu/GuiMainMenuWithPhotoButton.java @@ -1,14 +1,9 @@ package com.thatapplefreak.voxelcam.gui.mainmenu; -import org.lwjgl.opengl.GL11; - -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thevoxelbox.common.util.AbstractionLayer; -import com.thevoxelbox.common.util.gui.AdvancedDrawGui; - import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiMainMenu; -import net.minecraft.util.ResourceLocation; + +import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; public class GuiMainMenuWithPhotoButton extends GuiMainMenu { diff --git a/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java b/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java index a7a640e..d004c7b 100644 --- a/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java +++ b/src/com/thatapplefreak/voxelcam/gui/mainmenu/PhotoButton.java @@ -1,13 +1,13 @@ package com.thatapplefreak.voxelcam.gui.mainmenu; -import org.lwjgl.opengl.GL11; - -import com.thevoxelbox.common.util.AbstractionLayer; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import com.thevoxelbox.common.util.AbstractionLayer; + public class PhotoButton extends GuiButton { static ResourceLocation photoBtnPic = new ResourceLocation("voxelcam", "textures/photo.png"); diff --git a/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java b/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java index 9bb3af9..56a19fd 100644 --- a/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/GuiScreenShotManager.java @@ -1,16 +1,8 @@ package com.thatapplefreak.voxelcam.gui.manager; import java.awt.Desktop; -import java.awt.image.BufferedImage; -import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import javax.imageio.ImageIO; - -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; @@ -20,9 +12,7 @@ import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.gui.editor.GuiEditScreenshot; import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; -import com.thatapplefreak.voxelcam.imagehandle.ImageDrawer; import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.imagehandle.metadata.MetaDataHandler; import com.thatapplefreak.voxelcam.io.VoxelCamIO; /** diff --git a/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java b/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java index 2c44294..74b33aa 100644 --- a/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/PostPopup.java @@ -1,26 +1,18 @@ package com.thatapplefreak.voxelcam.gui.manager; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.FileChannel; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; -import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; import com.thatapplefreak.voxelcam.io.VoxelCamIO; import com.thatapplefreak.voxelcam.upload.dropbox.DropboxHandler; import com.thatapplefreak.voxelcam.upload.googleDrive.GoogleDriveHandler; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; import com.thatapplefreak.voxelcam.upload.imgur.ImgurHandler; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; import com.thatapplefreak.voxelcam.upload.reddit.RedditHandler; import com.thatapplefreak.voxelcam.upload.reddit.RedditLoginPopup; import com.thatapplefreak.voxelcam.upload.reddit.RedditPostPopup; diff --git a/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java b/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java index 01c6d29..72b6369 100644 --- a/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java +++ b/src/com/thatapplefreak/voxelcam/gui/manager/ScalePhotoFrame.java @@ -2,7 +2,6 @@ import static org.lwjgl.opengl.GL11.*; -import java.awt.LinearGradientPaint; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; diff --git a/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java b/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java index 3113e79..379265e 100644 --- a/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java +++ b/src/com/thatapplefreak/voxelcam/gui/settings/GuiVoxelCamSettingsPanel.java @@ -2,9 +2,10 @@ import net.minecraft.client.resources.I18n; -import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thevoxelbox.common.gui.GuiVoxelBoxSettingsPanel; +import com.thevoxelbox.common.util.ModConfig; import com.thevoxelbox.common.util.properties.VoxelPropertyAbstractButton; import com.thevoxelbox.common.util.properties.VoxelPropertyCheckBox; import com.thevoxelbox.common.util.properties.VoxelPropertyIntField; @@ -36,7 +37,7 @@ public void initGui() { heightField.setMaxFieldValue(max); heightField.setMinFieldValue(min); properties.add(heightField); - properties.add(new VoxelPropertyAbstractButton(config, null, "720p", PANEL_LEFT + 70, PANEL_TOP + 24) { + properties.add(new VoxelPropertyAbstractButton(config, null, "720p", PANEL_LEFT + 70, PANEL_TOP + 24) { @Override protected void onClick() { VoxelCamConfig config = VoxelCamCore.getConfig(); @@ -45,7 +46,7 @@ protected void onClick() { updateFields(); } }); - properties.add(new VoxelPropertyAbstractButton(config, null, "1080p", PANEL_LEFT + 70, PANEL_TOP + 44) { + properties.add(new VoxelPropertyAbstractButton(config, null, "1080p", PANEL_LEFT + 70, PANEL_TOP + 44) { @Override protected void onClick() { VoxelCamConfig config = VoxelCamCore.getConfig(); @@ -54,7 +55,7 @@ protected void onClick() { updateFields(); } }); - properties.add(new VoxelPropertyAbstractButton(config, null, "4K (2160p)", PANEL_LEFT + 145, PANEL_TOP + 24) { + properties.add(new VoxelPropertyAbstractButton(config, null, "4K (2160p)", PANEL_LEFT + 145, PANEL_TOP + 24) { @Override protected void onClick() { VoxelCamConfig config = VoxelCamCore.getConfig(); @@ -63,7 +64,7 @@ protected void onClick() { updateFields(); } }); - properties.add(new VoxelPropertyAbstractButton(config, null, "IMAX", PANEL_LEFT + 145, PANEL_TOP + 44) { + properties.add(new VoxelPropertyAbstractButton(config, null, "IMAX", PANEL_LEFT + 145, PANEL_TOP + 44) { @Override protected void onClick() { VoxelCamConfig config = VoxelCamCore.getConfig(); diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java b/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java index 03266e5..5cb024a 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/BigScreenshotTaker.java @@ -1,23 +1,10 @@ package com.thatapplefreak.voxelcam.imagehandle; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.imageio.ImageIO; - import net.minecraft.client.Minecraft; -import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.GL11; - -import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thevoxelbox.common.gl.FBO; -import com.thevoxelbox.common.util.PrivateFields; import com.thevoxelbox.common.util.PrivateMethods; /** diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java b/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java index 9e2b2b8..6c645a6 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/GLImageMemoryHandler.java @@ -1,6 +1,6 @@ package com.thatapplefreak.voxelcam.imagehandle; -import static org.lwjgl.opengl.GL11.glDeleteTextures; +import static org.lwjgl.opengl.GL11.*; import java.awt.image.BufferedImage; import java.io.File; @@ -14,9 +14,6 @@ import net.minecraft.client.renderer.texture.TextureUtil; -import org.lwjgl.LWJGLException; -import org.lwjgl.opengl.Display; - public abstract class GLImageMemoryHandler { diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java b/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java index bf7e37e..613df94 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ImageDrawer.java @@ -1,15 +1,7 @@ package com.thatapplefreak.voxelcam.imagehandle; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.imageio.ImageIO; - -import net.minecraft.client.renderer.Tessellator; import static org.lwjgl.opengl.GL11.*; +import net.minecraft.client.renderer.Tessellator; /** * Utility Class that can take any File that is an image and draw it to a gui diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java index b22638f..2d5ff55 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotNamer.java @@ -4,10 +4,7 @@ import java.text.SimpleDateFormat; import java.util.Date; -import net.minecraft.client.Minecraft; - import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thevoxelbox.common.util.PrivateFields; public abstract class ScreenshotNamer { diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java index 260a702..c633a7d 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/ScreenshotTaker.java @@ -3,11 +3,7 @@ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.nio.ByteBuffer; import java.nio.IntBuffer; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; import javax.imageio.ImageIO; @@ -15,19 +11,16 @@ import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.client.resources.I18n; -import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.imagehandle.metadata.MetaDataHandler; import com.thatapplefreak.voxelcam.upload.AutoUploader; -import com.thevoxelbox.common.util.AbstractionLayer; import com.thevoxelbox.common.util.ChatMessageBuilder; public abstract class ScreenshotTaker { diff --git a/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java b/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java index 309cc27..9175e9a 100644 --- a/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java +++ b/src/com/thatapplefreak/voxelcam/imagehandle/metadata/MetaDataHandler.java @@ -1,18 +1,10 @@ package com.thatapplefreak.voxelcam.imagehandle.metadata; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; import java.util.HashMap; -import java.util.Map; -import java.util.Properties; import net.minecraft.client.Minecraft; -import com.mumfrey.liteloader.core.LiteLoader; - public abstract class MetaDataHandler { public static void writeMetaData(File screenshot) { diff --git a/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java b/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java index 855061a..b5fcdba 100644 --- a/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java +++ b/src/com/thatapplefreak/voxelcam/io/VoxelCamIO.java @@ -6,7 +6,6 @@ import java.util.Comparator; import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; import com.thatapplefreak.voxelcam.imagehandle.GLImageMemoryHandler; public abstract class VoxelCamIO { diff --git a/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java b/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java index fdab3d4..ee0fe72 100644 --- a/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java +++ b/src/com/thatapplefreak/voxelcam/upload/AutoUploader.java @@ -5,15 +5,14 @@ import net.minecraft.client.resources.I18n; import net.minecraft.util.EnumChatFormatting; -import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; import com.thatapplefreak.voxelcam.upload.dropbox.DropboxHandler; import com.thatapplefreak.voxelcam.upload.googleDrive.GoogleDriveHandler; import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; -import com.thevoxelbox.common.util.AbstractionLayer; import com.thevoxelbox.common.util.ChatMessageBuilder; public abstract class AutoUploader { diff --git a/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java b/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java index 6b03dd0..5b82602 100644 --- a/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/dropbox/DropboxHandler.java @@ -8,8 +8,6 @@ import net.minecraft.util.Util.EnumOS; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; - public abstract class DropboxHandler { /** diff --git a/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java b/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java index 532d6f5..c4085c6 100644 --- a/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/facebook/FacebookHandler.java @@ -1,14 +1,7 @@ package com.thatapplefreak.voxelcam.upload.facebook; -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterHandler; -import com.thatapplefreak.voxelcam.upload.twitter.TwitterPINPopup; - import facebook4j.Facebook; -import facebook4j.FacebookException; import facebook4j.FacebookFactory; -import facebook4j.auth.AccessToken; public abstract class FacebookHandler { diff --git a/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java index aed0466..219a21f 100644 --- a/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/imgur/ImgurHandler.java @@ -2,7 +2,6 @@ import java.io.File; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; import com.thatapplefreak.voxelcam.gui.manager.PostPopup; public abstract class ImgurHandler { diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java b/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java index 7d45092..cf89ded 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/IRedditPostCallback.java @@ -1,6 +1,5 @@ package com.thatapplefreak.voxelcam.upload.reddit; -import java.net.URL; public interface IRedditPostCallback { diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java index dccae78..9316b58 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditHandler.java @@ -8,13 +8,10 @@ import com.github.jreddit.user.User; import com.github.jreddit.utils.restclient.HttpRestClient; -import com.thatapplefreak.voxelcam.gui.manager.PostPopup; import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadFailedPopup; import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadSuccessPopup; public abstract class RedditHandler { diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java index bbd3d83..2db9dc1 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditLoginPopup.java @@ -10,7 +10,6 @@ import com.thevoxelbox.common.util.AbstractionLayer; import com.thevoxelbox.common.util.gui.GuiDialogBox; import com.thevoxelbox.common.util.gui.GuiTextFieldEx; -import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; public class RedditLoginPopup extends GuiDialogBox implements ILoginCallback, ScreenshotIncapable { diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java index bc35b3a..a3916b9 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostPopup.java @@ -1,19 +1,15 @@ package com.thatapplefreak.voxelcam.upload.reddit; -import java.net.URL; - import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; import net.minecraft.util.ResourceLocation; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; import com.thatapplefreak.voxelcam.io.VoxelCamIO; import com.thevoxelbox.common.util.AbstractionLayer; import com.thevoxelbox.common.util.gui.GuiDialogBox; import com.thevoxelbox.common.util.gui.GuiTextFieldEx; -import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; public class RedditPostPopup extends GuiDialogBox implements IRedditPostCallback, ScreenshotIncapable { diff --git a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java index d936bc2..9ae373b 100644 --- a/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/reddit/RedditPostSuccessPopup.java @@ -2,14 +2,12 @@ import java.awt.Toolkit; import java.awt.datatransfer.StringSelection; -import java.net.URL; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; import com.thatapplefreak.voxelcam.imagehandle.ScreenshotIncapable; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurDelete; import com.thevoxelbox.common.util.BrowserOpener; import com.thevoxelbox.common.util.gui.GuiDialogBox; diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java index f2c0502..e105524 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterHandler.java @@ -3,15 +3,6 @@ import java.io.File; import net.minecraft.client.resources.I18n; - -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; - import twitter4j.Status; import twitter4j.StatusUpdate; import twitter4j.Twitter; @@ -20,6 +11,9 @@ import twitter4j.auth.AccessToken; import twitter4j.auth.RequestToken; +import com.thatapplefreak.voxelcam.VoxelCamConfig; +import com.thatapplefreak.voxelcam.VoxelCamCore; + public abstract class TwitterHandler { public static final String CONSUMER_KEY = "okIIDosE4TsrRP3JvXufw"; diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java index 391bc19..a157e79 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPINPopup.java @@ -4,15 +4,10 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.resources.I18n; -import twitter4j.TwitterException; -import twitter4j.auth.AccessToken; -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; import com.thatapplefreak.voxelcam.upload.twitter.TwitterHandler.TwitterOauthGrabber; import com.thevoxelbox.common.util.BrowserOpener; import com.thevoxelbox.common.util.gui.GuiDialogBox; -import com.thevoxelbox.common.util.gui.GuiDialogBox.DialogResult; public class TwitterPINPopup extends GuiDialogBox { diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java index 1f86343..734b716 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterPostPopup.java @@ -1,22 +1,10 @@ package com.thatapplefreak.voxelcam.upload.twitter; -import java.io.File; - import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.resources.I18n; -import twitter4j.Status; -import twitter4j.TwitterException; -import twitter4j.auth.AccessToken; -import com.thatapplefreak.voxelcam.VoxelCamCore; -import com.thatapplefreak.voxelcam.VoxelCamConfig; -import com.thatapplefreak.voxelcam.gui.manager.GuiScreenShotManager; import com.thatapplefreak.voxelcam.io.VoxelCamIO; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurCallback; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurResponse; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUpload; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurUploadResponse; import com.thevoxelbox.common.util.gui.GuiDialogBox; public class TwitterPostPopup extends GuiDialogBox { diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java index 8c016d8..0e44b6a 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadFailedPopup.java @@ -1,11 +1,10 @@ package com.thatapplefreak.voxelcam.upload.twitter; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.resources.I18n; import twitter4j.Status; import twitter4j.StatusUpdate; import twitter4j.TwitterException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.I18n; import com.thevoxelbox.common.util.gui.GuiDialogBox; diff --git a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java index ab3c35e..50282d2 100644 --- a/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java +++ b/src/com/thatapplefreak/voxelcam/upload/twitter/TwitterUploadSuccessPopup.java @@ -3,12 +3,11 @@ import java.awt.Toolkit; import java.awt.datatransfer.StringSelection; -import twitter4j.TwitterException; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; +import twitter4j.TwitterException; -import com.thatapplefreak.voxelcam.upload.imgur.ImgurDelete; import com.thevoxelbox.common.util.BrowserOpener; import com.thevoxelbox.common.util.gui.GuiDialogBox; From 0619a733ac2ae238d73f0f821dc9e566f4d14372 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:24:16 +0100 Subject: [PATCH 5/8] Remove redundant declarations --- src/com/thatapplefreak/voxelcam/VoxelCamConfig.java | 3 +-- src/com/thatapplefreak/voxelcam/VoxelCamCore.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java b/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java index 6522c57..44fc1e0 100644 --- a/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamConfig.java @@ -4,11 +4,10 @@ import org.lwjgl.input.Keyboard; -import com.thevoxelbox.common.interfaces.IVoxelPropertyProvider; import com.thevoxelbox.common.util.ModConfig; -public class VoxelCamConfig extends ModConfig implements IVoxelPropertyProvider { +public class VoxelCamConfig extends ModConfig { // Keybinds that VoxelCam uses public static final KeyBinding KEY_OPENSCREENSHOTMANAGER = new KeyBinding("ScreenShot Manager", Keyboard.KEY_H, "VoxelCam"); diff --git a/src/com/thatapplefreak/voxelcam/VoxelCamCore.java b/src/com/thatapplefreak/voxelcam/VoxelCamCore.java index 3047168..1132f97 100644 --- a/src/com/thatapplefreak/voxelcam/VoxelCamCore.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamCore.java @@ -19,7 +19,6 @@ import com.mumfrey.liteloader.Configurable; import com.mumfrey.liteloader.InitCompleteListener; import com.mumfrey.liteloader.RenderListener; -import com.mumfrey.liteloader.Tickable; import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.modconfig.ConfigPanel; import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; @@ -43,7 +42,7 @@ * @author thatapplefreak * */ -public class VoxelCamCore implements Tickable, InitCompleteListener, RenderListener, Configurable { +public class VoxelCamCore implements InitCompleteListener, RenderListener, Configurable { /** * This is the configuration file for the mod From a7edff08071d38c353d51e627971257e822ff4a3 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:39:55 +0100 Subject: [PATCH 6/8] Stripping conflicting apache commons IO from jreddit --- lib/jreddit-1.0.1-SNAPSHOT.jar | Bin 1318912 -> 1238353 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/jreddit-1.0.1-SNAPSHOT.jar b/lib/jreddit-1.0.1-SNAPSHOT.jar index 7e17bf64eda90ede10b784dd9d076351e986288f..5cbb1a22082912741f7dc993454d9c19b8e895b5 100644 GIT binary patch delta 144 zcmZoT5ODF7cS8$f3sVbo3rh=Y3tJ0&3r7oQ3s(zw3r`Dg3ttO=i@+AaRgvw_YJ|2w zs}T}aw4wGw;&AZ>3+3B+|%{tMYNdpqrh@dp>?%F?9)3z;)|1! Z#qY?Ai1D$ru(MokU}Q*35oBOs0081QEZ6`5 delta 76462 zcmZ_#Rajk(k~NGHTo&%`?(XjH?(Xgq7P5dK!QEX0f#B}$65QQ2IDtReZ=de|dhc^F zZ{{3q18Sx2 zC#@`&Z31HF8Z1Lu%|y z4qP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zk~QlG<5$s9w-y`q(a3U1Eu~8J$Mor1K&Rr_0N!R(h>vz=Ug9J?EW?#=zp<;c9RVT zNA*|ifm2n;GfGfK#{E4d5caXV9S>Iw`tWuiTIl}n1&EK>E-C1KG>k!=?CQo*c;K$+lDIxbE@G!%ULKNhLavH$=8 From 19d303a78655f595f6111fe8866eb0da27b5e789 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:43:48 +0100 Subject: [PATCH 7/8] Remove unnecessary duplicate "FrameBuffer" --- src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java b/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java index e839220..8cec228 100644 --- a/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java +++ b/src/com/thatapplefreak/voxelcam/VoxelCamTransformer.java @@ -13,14 +13,13 @@ public class VoxelCamTransformer extends EventInjectionTransformer { private static final String voxelCamScreenshotMethod = "takeScreenshot"; private static final Obf classChatComponent = new Obf("net.minecraft.util.IChatComponent", "fj") {}; - private static final Obf classFrameBuffer = new Obf("net.minecraft.client.shader.Framebuffer","bmg") {}; private static final Obf classScreenShotHelper = new Obf("net.minecraft.util.ScreenShotHelper", "bbp") {}; private static final Obf methodSaveScreenshot = new Obf("func_148260_a", "a", "saveScreenshot") {}; @Override protected void addEvents() { Event onTakeScreenshot = Event.getOrCreate("onTakeScreenshot", true); - MethodInfo target = new MethodInfo(classScreenShotHelper, methodSaveScreenshot, classChatComponent, File.class, Integer.TYPE, Integer.TYPE, classFrameBuffer); + MethodInfo target = new MethodInfo(classScreenShotHelper, methodSaveScreenshot, classChatComponent, File.class, Integer.TYPE, Integer.TYPE, Obf.FrameBuffer); MethodInfo callback = new MethodInfo(coreClassName, voxelCamScreenshotMethod); this.addEvent(onTakeScreenshot, target, new MethodHead()).addListener(callback); From dd12719db337311b89f62b823a8a7e39738982bb Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 21 Jul 2014 16:56:38 +0100 Subject: [PATCH 8/8] Update build script --- build/build.xml | 71 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/build/build.xml b/build/build.xml index f017a07..650b68d 100644 --- a/build/build.xml +++ b/build/build.xml @@ -5,29 +5,34 @@ - - + + - + + + + - + - - - - - - + + + + + + + + - + @@ -49,7 +54,7 @@ - + @@ -57,18 +62,28 @@ - + + + + + + + + + + + - - - + + + @@ -84,9 +99,13 @@ + + + + @@ -101,23 +120,33 @@ + + + + + + - + + + + + - + - + @@ -127,7 +156,9 @@ - + + +