Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added AE/Book.aep
Binary file not shown.
Binary file modified AE/MainNav.aep
Binary file not shown.
Binary file added AE/Notifications.aep
Binary file not shown.
Binary file added AE/assets/drawable/default/icon-heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AE/assets/drawable/default/white-horizontal-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AE/assets/layout/tablet/Book_Main.layout
Binary file not shown.
Binary file added AE/assets/layout/tablet/Book_Main.timeline
Binary file not shown.
Binary file added AE/assets/layout/tablet/Book_TabbedView.layout
Binary file not shown.
Binary file added AE/assets/layout/tablet/Book_TabbedView.timeline
Binary file not shown.
Binary file modified AE/assets/layout/tablet/MainNav_Main.layout
Binary file not shown.
Binary file modified AE/assets/layout/tablet/MainNav_Main.timeline
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added AE/assets/layout/tablet/Notifications_Main.layout
Binary file not shown.
Binary file added AE/assets/layout/tablet/Notifications_Main.timeline
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
90 changes: 90 additions & 0 deletions build/AndroidNative/assets/text/Notifications.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"QUEST_AVAILABLE" : {
"type": "Success",
"title": "New Quest Available",
"message": ""
},

"QUEST_ACCEPTED" : {
"type": "Success",
"title": "Quest Accepted",
"message": ""
},

"QUEST_COMPLETED" : {
"type": "Success",
"title": "Quest Completed",
"message": ""
},

"QUEST_OBJECTIVE_COMPLETED" : {
"type": "Success",
"title": "Quest Objective Completed",
"message": ""
},

"APP_CONFIGURATION_ERROR" : {
"type": "Dialog",
"title": "App configuration failed",
"message": "There was a problem when the app tried to reach the server",
"action": "",
"dismiss": ""
},

"VSTB_SERVER_ERROR" : {
"type": "Dialog",
"title": "Server Error",
"message": "Please check your network and restart the application (%1)",
"action": "",
"dismiss": ""
},

"VIDEO_PLAYBACK_ERROR" : {
"type": "Error",
"title": "Error",
"message": "Video Playback Error: %1",
"autodismiss": false
},

"VIDEO_PLAYBACK_CHANNEL_AUTH_ERROR" : {
"type": "Error",
"title": "Channel Access Denied",
"message": "The active account does not have access to this content channel",
"autodismiss": false
},

"VIDEO_CONTENT_AUTH_LEVEL_ERROR" : {
"type": "Error",
"title": "Premium Content - Please Log In",
"message": "Please log in to a premium account to view this content",
"autodismiss": false
},

"NETWORK_CONNECTION_ERROR" : {
"type": "Error",
"title": "Network Connection Error",
"message": "Unable to reach the server"
},

"LOGOUT_CONFIRMATION" : {
"type": "Dialog",
"title": "Logout",
"message": "Are you sure you would like to logout of FoxPlay?",
"action": "OK",
"dismiss": "Cancel"
},

"LOGOUT_SUCCESS" : {
"type": "Success",
"title": "Logout succeeded",
"message": "Logout succeeded"
},

"LOGOUT_FAIL" : {
"type": "Error",
"title": "Logout failed",
"message": "Logout failed"
}
}


2 changes: 2 additions & 0 deletions build/YouiEngineManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<layout filename="EmptySample_MainComp.layout"/>
<layout dir="tablet" filename="Activity_Main.layout"/>
<layout dir="tablet" filename="MainNav_Main.layout"/>
<layout dir="tablet" filename="Book_Main.layout"/>
<layout dir="tablet" filename="Notifications_Main.layout"/>
<drawable dir="default" filename="test_xml_level.tmx"/>
<drawable dir="default" filename="super_mario_one_tileset.png"/>
<drawable dir="default" filename="legend_of_zelda_one_overworld_tiles.png"/>
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ source_group("app" REGULAR_EXPRESSION "app/.*")
source_group("bridges" REGULAR_EXPRESSION "bridges/.*")
source_group("customviews" REGULAR_EXPRESSION "customviews/.*")
source_group("decoder" REGULAR_EXPRESSION "decoder/.*")
source_group("notification" REGULAR_EXPRESSION "notification/.*")
source_group("quest" REGULAR_EXPRESSION "quest/.*")
source_group("screen" REGULAR_EXPRESSION "screen/.*")
source_group("utilities" REGULAR_EXPRESSION "utilities/.*")
Expand Down
7 changes: 5 additions & 2 deletions src/app/AppController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const YI_UINT64 APP_INIT_RETRY_TIMER_MS = 5000;

AppController::AppController(CYIApp &rApp)
: m_rApp(rApp)
, m_NavigationController(m_rApp)
, m_navigationController(m_rApp)
, m_notificationController(m_rApp)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_NavigationController starts with a capital, but m_notificationController doesn't.

{
BuildStateMachine();
}
Expand Down Expand Up @@ -54,6 +55,8 @@ void AppController::ConfigInitStateEntered()
{
YI_LOGD(TAG, "ConfigInitStateEntered");

m_notificationController.Init();

TransitionFromConfigInitToRunning();
}

Expand All @@ -66,7 +69,7 @@ void AppController::RunningStateEntered()
{
YI_LOGD(TAG, "RunningStateEntered");

m_NavigationController.Start(NavigationController::SPLASH);
m_navigationController.Start(NavigationController::BOOK);
}

void AppController::RunningStateExited()
Expand Down
6 changes: 3 additions & 3 deletions src/app/AppController.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _APPCONTROLLER_H_
#define _APPCONTROLLER_H_

#include "notification/NotificationController.h"
#include "screen/NavigationController.h"

#include <signal/YiSignalHandler.h>
Expand All @@ -19,8 +20,6 @@ class AppController : public CYISignalHandler

private:
void BuildStateMachine();


void ConfigInitStateEntered();
void ConfigInitStateExited();
void RunningStateEntered();
Expand All @@ -34,7 +33,8 @@ class AppController : public CYISignalHandler
CYIStateMachine m_StateMachine;
CYISignal<> TransitionFromConfigInitToRunning;

NavigationController m_NavigationController;
NavigationController m_navigationController;
NotificationController m_notificationController;

YI_DISALLOW_COPY_AND_ASSIGN(AppController);
};
Expand Down
38 changes: 19 additions & 19 deletions src/app/LovecraftApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ bool LovecraftApp::UserInit()

AddTMXDecoder();

TestsQuests();

//TestLoadingTMX();

return true;
}

Expand Down Expand Up @@ -115,7 +111,14 @@ void LovecraftApp::SetApplicationPlatform(ApplicationConfiguration &applicationC

bool LovecraftApp::UserStart()
{
return m_pAppController->Start();
if (m_pAppController->Start())
{
TestsQuests();

//TestLoadingTMX();
}

return true;
}

void LovecraftApp::UserUpdate()
Expand All @@ -125,17 +128,8 @@ void LovecraftApp::UserUpdate()

void LovecraftApp::TestsQuests() const
{
//TMX loading test
tmxparser::TmxReturn error;
tmxparser::TmxMap map;

// test from file
CYIString assetPath = GetAssetsPath();

CYIString questsPath = assetPath + "resources/" + "Quests.json";
CYIString levelPath = assetPath + "resources/" + "test_xml_level.tmx";

error = tmxparser::parseFromFile(levelPath.GetData(), &map, assetPath.GetData());

QuestManager* questManager = new QuestManager(questsPath);

Expand All @@ -146,6 +140,17 @@ void LovecraftApp::TestsQuests() const

void LovecraftApp::TestLoadingTMX()
{
//TMX loading test
tmxparser::TmxReturn error;
tmxparser::TmxMap map;

// test from file
CYIString assetPath = GetAssetsPath();

CYIString levelPath = assetPath + "resources/" + "test_xml_level.tmx";

error = tmxparser::parseFromFile(levelPath.GetData(), &map, assetPath.GetData());

CYIAssetLoader *pAssetLoader = CYIFramework::GetInstance()->GetAssetLoader();

CYISharedPtr<CYIAsset> pAsset = pAssetLoader->Load(YiGetTypeId<AssetTMX>(), "drawable/default/test_xml_level.tmx", YI_NULL);
Expand Down Expand Up @@ -193,11 +198,6 @@ void LovecraftApp::TestQuestProgression(QuestManager* quest_manager)

YI_LOGI("LovecraftApp::TestQuestProgression", "After saving the advisor: \n%s", quest_manager->GetAllQuestsDisplayText().GetData());

//After saving the advisor
quest_manager->ActivateCondition(CYIString("rescue:maincharacter:chiefadvisor"));

YI_LOGI("LovecraftApp::TestQuestProgression", "After saving the advisor: \n%s", quest_manager->GetAllQuestsDisplayText().GetData());

//After the scientist transcends
quest_manager->ActivateCondition(CYIString("state:head_scientist:transcended"));

Expand Down
66 changes: 66 additions & 0 deletions src/customviews/FullScreenNotificationView.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include "customviews/FullScreenNotificationView.h"

#include "utilities/NodeUtilities.h"

#include <view/YiPushButtonView.h>
#include <scenetree/YiTextSceneNode.h>

const CYIString TAG("FullScreenNotificationView.h");

YI_RTTI_DEF1_INST(FullScreenNotificationView, "FullScreenNotificationView", CYISceneView)

FullScreenNotificationView::FullScreenNotificationView()
{
};

FullScreenNotificationView::~FullScreenNotificationView()
{
};

bool FullScreenNotificationView::Init()
{
return NotificationView::Init();
}


void FullScreenNotificationView::ConnectButtons()
{
Utility::GetNode<CYIPushButtonView>(this, "Btn-Action1")->ButtonReleased.Connect(*this, &FullScreenNotificationView::DoAction);
Utility::GetNode<CYIPushButtonView>(this, "Btn-Action2")->ButtonReleased.Connect(*this, &FullScreenNotificationView::DoDismiss);
}

void FullScreenNotificationView::DoAction()
{
Actioned(this);
}

void FullScreenNotificationView::DoDismiss()
{
NotificationView::DoDismiss();
}

void FullScreenNotificationView::SetActionButtonText(const CYIString &text)
{
SetButtonText("Btn-Action1", text);
}

void FullScreenNotificationView::SetDismissButtonText(const CYIString &text)
{
SetButtonText("Btn-Action2", text);
}

void FullScreenNotificationView::SetButtonText(const CYIString &button, const CYIString &text)
{
CYIPushButtonView *pButton = Utility::GetNode<CYIPushButtonView>(this, button);

if(text.IsNotEmpty())
{
pButton->Show();
pButton->SetText(text);
Utility::GetNode<CYITextSceneNode>(pButton, "Placeholder-Title")->SetText(text);
}
else
{
pButton->Hide();
}
}
44 changes: 44 additions & 0 deletions src/customviews/FullScreenNotificationView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef _FULLSCREEN_NOTIFICATION_VIEW_H_
#define _FULLSCREEN_NOTIFICATION_VIEW_H_

#include "customviews/NotificationView.h"

/*!
\Template for a After Effects composition representing a full screen notification.

<B>Full Screen Notification Template Specification </B>

| Type | Labels | Property | Description |
| :-------- | :----------------------- | :---------------: | :--------------------------------------------------------------- |
| Marker | In | <B>Required</B> | representing the animations to open the full screen notification |
| Marker | Out | <B>Required</B> | representing the animations to close the full screen notification |
| Node | Btn-Action1 | <B>Required</B> | When pressed, the signal Actioned() is emitted |
| Node | Btn-Action2 | <B>Required</B> | When pressed, the signal Dismissed() is emitted |
*/

class FullScreenNotificationView : public NotificationView
{
public:
FullScreenNotificationView();
virtual ~FullScreenNotificationView();

virtual bool Init();

void SetActionButtonText(const CYIString &text);
void SetDismissButtonText(const CYIString &text);

void ConnectButtons();

void DoAction();
void DoDismiss();

CYISignal<FullScreenNotificationView *> Actioned;

private:
void SetButtonText(const CYIString &button, const CYIString &text);

YI_DISALLOW_COPY_AND_ASSIGN(FullScreenNotificationView)
YI_TYPE_DATA
};

#endif // _FULLSCREEN_NOTIFICATION_VIEW_H_
Loading