Skip to content

Commit

Permalink
Fixed touch bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Oct 15, 2016
1 parent 1bf6e88 commit 1e807ad
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ASFLAGS = $(CFLAGS)
all: $(TARGET).vpk

%.vpk: eboot.bin
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=01.30 -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=01.31 -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo
vita-pack-vpk -s param.sfo -b eboot.bin \
--add pkg/sce_sys/icon0.png=sce_sys/icon0.png \
--add pkg/sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png \
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Be sure you pull request your customized design or language file there.
* sakya for Lightmp3
* Everybody who contributed on vitasdk

### Changelog 1.31 ###
- Touching the screen on dialogs would abort the process, fixed.

### Changelog 1.3 ###
- Added ability to compress files and folders into a zip archive.
- Added scanning for unsafe fself's and imports.
Expand Down
2 changes: 1 addition & 1 deletion main.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

// VitaShell version major.minor
#define VITASHELL_VERSION_MAJOR 0x01
#define VITASHELL_VERSION_MINOR 0x30
#define VITASHELL_VERSION_MINOR 0x31

#define VITASHELL_VERSION ((VITASHELL_VERSION_MAJOR << 0x18) | (VITASHELL_VERSION_MINOR << 0x10))

Expand Down
2 changes: 1 addition & 1 deletion pkg/sce_sys/livearea/contents/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<frame id="frame4">
<liveitem>
<text align="left" text-align="left" word-wrap="off" ellipsis="on">
<str size="18" color="#ffffff" shadow="on">v1.3</str>
<str size="18" color="#ffffff" shadow="on">v1.31</str>
</text>
</liveitem>
</frame>
Expand Down
5 changes: 5 additions & 0 deletions resources/changeinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,9 @@
- Added 'Install folder' by soarqin.<br>
]]>
</changes>
<changes app_ver="01.31">
<![CDATA[
- Touching the screen on dialogs would abort the process, fixed.<br>
]]>
</changes>
</changeinfo>
44 changes: 7 additions & 37 deletions uncommon_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@
*/

#include "main.h"
#include "UI2.h"
#include "touch_shell.h"
#include "init.h"
#include "theme.h"
#include "language.h"
#include "utils.h"
#include "uncommon_dialog.h"

int type_touch = 0;
float x_d_start = 0;
float x_d_end = 0;
float y_d = 0;

typedef struct {
int animation_mode;
int status;
Expand Down Expand Up @@ -147,68 +140,51 @@ int sceMsgDialogInit(const SceMsgDialogParam *param) {

SceCommonDialogStatus sceMsgDialogGetStatus(void) {
if (uncommon_dialog.status == SCE_COMMON_DIALOG_STATUS_RUNNING) {
if (TOUCH_FRONT() == 1) {
State_Touch = -1;
float t_x = touch.report[0].x;
float t_y = touch.report[0].y;
if ((t_x < x_d_end) & (t_x > x_d_start) & (t_y < y_d + FONT_Y_SPACE2) & (t_y > y_d - FONT_Y_SPACE2)) {
type_touch = 1;
}
else {
type_touch = 2;
}
}
switch (uncommon_dialog.buttonType) {
switch (uncommon_dialog.buttonType) {
case SCE_MSG_DIALOG_BUTTON_TYPE_OK:
{
if ((pressed_buttons & SCE_CTRL_ENTER) || (type_touch == 1)) {
if (pressed_buttons & SCE_CTRL_ENTER) {
uncommon_dialog.animation_mode = UNCOMMON_DIALOG_CLOSING;
uncommon_dialog.buttonId = SCE_MSG_DIALOG_BUTTON_ID_OK;
type_touch = 0;
}

break;
}

case SCE_MSG_DIALOG_BUTTON_TYPE_YESNO:
{
if ((pressed_buttons & SCE_CTRL_ENTER) || (type_touch == 1)) {
if (pressed_buttons & SCE_CTRL_ENTER) {
uncommon_dialog.animation_mode = UNCOMMON_DIALOG_CLOSING;
uncommon_dialog.buttonId = SCE_MSG_DIALOG_BUTTON_ID_YES;
type_touch = 0;
}

if ((pressed_buttons & SCE_CTRL_CANCEL) || (type_touch == 2)) {
if (pressed_buttons & SCE_CTRL_CANCEL) {
uncommon_dialog.animation_mode = UNCOMMON_DIALOG_CLOSING;
uncommon_dialog.buttonId = SCE_MSG_DIALOG_BUTTON_ID_NO;
type_touch = 0;
}

break;
}

case SCE_MSG_DIALOG_BUTTON_TYPE_OK_CANCEL:
{
if ((pressed_buttons & SCE_CTRL_ENTER) || (type_touch == 1)) {
if (pressed_buttons & SCE_CTRL_ENTER) {
uncommon_dialog.animation_mode = UNCOMMON_DIALOG_CLOSING;
uncommon_dialog.buttonId = SCE_MSG_DIALOG_BUTTON_ID_YES;
type_touch = 0;
}

if ((pressed_buttons & SCE_CTRL_CANCEL) || (type_touch == 2)) {
if (pressed_buttons & SCE_CTRL_CANCEL) {
uncommon_dialog.animation_mode = UNCOMMON_DIALOG_CLOSING;
uncommon_dialog.buttonId = SCE_MSG_DIALOG_BUTTON_ID_NO;
type_touch = 0;
}

break;
}

case SCE_MSG_DIALOG_BUTTON_TYPE_CANCEL:
{
if ((pressed_buttons & SCE_CTRL_CANCEL) || (type_touch == 2)) {
if (pressed_buttons & SCE_CTRL_CANCEL) {
uncommon_dialog.animation_mode = UNCOMMON_DIALOG_CLOSING;
type_touch = 0;
}

break;
Expand Down Expand Up @@ -347,12 +323,6 @@ int drawUncommonDialog() {

string_y += 2.0f * FONT_Y_SPACE;
}
//////////////////////////////////////////////////////////
x_d_start = uncommon_dialog.x + uncommon_dialog.width;
x_d_end = uncommon_dialog.x + uncommon_dialog.width + CENTER(SCREEN_WIDTH, vita2d_pgf_text_width(font, FONT_SIZE, string));
y_d = uncommon_dialog.y + uncommon_dialog.height + string_y + FONT_Y_SPACE2;
//vita2d_draw_rectangle(CENTER(SCREEN_WIDTH, vita2d_pgf_text_width(font, FONT_SIZE, button_string)) - 10, string_y + FONT_Y_SPACE , (x_d_end - x_d_start) / 3 - 15, FONT_Y_SPACE + 5, COLOR_ALPHA(GRAY, 0xC8));
//////////////////////////////////////////////////////////

switch (uncommon_dialog.buttonType) {
case SCE_MSG_DIALOG_BUTTON_TYPE_OK:
Expand Down

0 comments on commit 1e807ad

Please sign in to comment.