mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-26 07:18:47 -04:00
b289dece80
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
511 lines
20 KiB
C++
511 lines
20 KiB
C++
/**
|
|
* d_menu_fishing.cpp
|
|
* Menu - Fishing Journal
|
|
*/
|
|
|
|
#include "d/dolzel.h" // IWYU pragma: keep
|
|
|
|
#include "d/d_menu_fishing.h"
|
|
#include "JSystem/J2DGraph/J2DTextBox.h"
|
|
#include "JSystem/JKernel/JKRMemArchive.h"
|
|
#include "d/d_menu_dmap.h"
|
|
#include "d/d_meter2_info.h"
|
|
#include "d/d_meter_HIO.h"
|
|
#include "d/d_msg_string.h"
|
|
#include "m_Do/m_Do_controller_pad.h"
|
|
#include "m_Do/m_Do_graphic.h"
|
|
#include <cstring>
|
|
|
|
typedef void (dMenu_Fishing_c::*initFunc)();
|
|
initFunc map_init_process[] = {
|
|
&dMenu_Fishing_c::wait_init,
|
|
};
|
|
|
|
typedef void (dMenu_Fishing_c::*moveFunc)();
|
|
moveFunc map_move_process[] = {
|
|
&dMenu_Fishing_c::wait_move,
|
|
};
|
|
|
|
dMenu_Fishing_c::dMenu_Fishing_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i_cStick) {
|
|
mpHeap = i_heap;
|
|
mpArchive = 0;
|
|
mpMount = 0;
|
|
mpStick = i_stick;
|
|
mpCStick = i_cStick;
|
|
mStatus = READY_OPEN;
|
|
mProcess = 0;
|
|
mFishListScreenFrames = 0;
|
|
}
|
|
|
|
dMenu_Fishing_c::~dMenu_Fishing_c() {
|
|
JKR_DELETE(mpString);
|
|
mpString = NULL;
|
|
|
|
JKR_DELETE(mpBlackTex);
|
|
mpBlackTex = NULL;
|
|
|
|
JKR_DELETE(mpScreen);
|
|
mpScreen = NULL;
|
|
|
|
JKR_DELETE(mpParent);
|
|
mpParent = NULL;
|
|
|
|
for (int i = 0; i < MAX_FINDABLE_FISHES; i++) {
|
|
JKR_DELETE(mpFishParent[i]);
|
|
mpFishParent[i] = NULL;
|
|
|
|
for (int j = 0; j < MAX_FINDABLE_FISHES; j++) {
|
|
JKR_DELETE(mpFishParts[j][i]);
|
|
mpFishParts[j][i] = NULL;
|
|
}
|
|
}
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
JKR_DELETE(mpFishInfoParent[i]);
|
|
mpFishInfoParent[i] = NULL;
|
|
}
|
|
|
|
JKR_DELETE(mpIconScreen);
|
|
mpIconScreen = NULL;
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
if (mpButtonAB[i]) {
|
|
JKR_DELETE(mpButtonAB[i]);
|
|
mpButtonAB[i] = NULL;
|
|
}
|
|
if (mpButtonText[i]) {
|
|
JKR_DELETE(mpButtonText[i]);
|
|
mpButtonText[i] = NULL;
|
|
}
|
|
}
|
|
|
|
if (mpMount) {
|
|
mpMount->getArchive()->unmount();
|
|
mpMount->destroy();
|
|
mpMount = NULL;
|
|
}
|
|
|
|
if (mpArchive) {
|
|
mpArchive->unmount();
|
|
mpArchive = NULL;
|
|
}
|
|
}
|
|
|
|
void dMenu_Fishing_c::_create() {
|
|
mpString = JKR_NEW dMsgString_c();
|
|
screenSetBase();
|
|
screenSetDoIcon();
|
|
setHIO(true);
|
|
init();
|
|
}
|
|
|
|
void dMenu_Fishing_c::_move() {
|
|
JKRHeap* heap = mDoExt_setCurrentHeap((JKRHeap*)mpHeap);
|
|
u8 old_process = mProcess;
|
|
(this->*map_move_process[mProcess])();
|
|
if (old_process != mProcess) {
|
|
(this->*map_init_process[mProcess])();
|
|
}
|
|
setHIO(false);
|
|
mDoExt_setCurrentHeap(heap);
|
|
}
|
|
|
|
void dMenu_Fishing_c::_draw() {
|
|
if (mpArchive) {
|
|
J2DGrafContext* grafPort = dComIfGp_getCurrentGrafPort();
|
|
mpBlackTex->setAlpha(0xff);
|
|
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
|
mpScreen->draw(0.0f, 0.0f, grafPort);
|
|
mpIconScreen->draw(0.0f, 0.0f, grafPort);
|
|
}
|
|
}
|
|
|
|
bool dMenu_Fishing_c::isSync() {
|
|
if (mpMount != NULL && !mpMount->sync()) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void dMenu_Fishing_c::init() {
|
|
#if VERSION == VERSION_GCN_PAL
|
|
BOOL isEnglish = FALSE;
|
|
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
|
|
isEnglish = TRUE;
|
|
}
|
|
#endif
|
|
|
|
for (int i = 0; i < MAX_FINDABLE_FISHES; i++) {
|
|
if (dComIfGs_getFishNum(i) != 0) {
|
|
// Fish has been caught once, display it along with it's params
|
|
#if VERSION == VERSION_GCN_PAL
|
|
if (isEnglish) {
|
|
setFishParam(i, dComIfGs_getFishNum(i), dComIfGs_getFishSize(i) / 2.54f);
|
|
} else {
|
|
setFishParam(i, dComIfGs_getFishNum(i), dComIfGs_getFishSize(i));
|
|
}
|
|
#else
|
|
setFishParam(i, dComIfGs_getFishNum(i), dComIfGs_getFishSize(i));
|
|
#endif
|
|
mpFishParent[i]->show();
|
|
} else {
|
|
// Fish hasn't been caught yet, don't display it and also hide params
|
|
mpFishParent[i]->hide();
|
|
}
|
|
}
|
|
(this->*map_init_process[mProcess])();
|
|
}
|
|
|
|
int dMenu_Fishing_c::_open() {
|
|
if (mpMount == NULL) {
|
|
mpMount = mDoDvdThd_mountArchive_c::create("/res/Layout/fishres.arc", 0, NULL);
|
|
}
|
|
if (mpArchive == NULL) {
|
|
if (mpMount->sync()) {
|
|
if (mpArchive == NULL) {
|
|
mpArchive = (JKRArchive*)mpMount->getArchive();
|
|
JKR_DELETE(mpMount);
|
|
mpMount = NULL;
|
|
_create();
|
|
}
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
s16 openFrames = g_drawHIO.mFishListScreen.mOpenFrames;
|
|
s16 closeFrames = g_drawHIO.mFishListScreen.mCloseFrames;
|
|
mFishListScreenFrames = g_drawHIO.mFishListScreen.mOpenFrames;
|
|
if (mFishListScreenFrames >= openFrames) {
|
|
mFishListScreenFrames = closeFrames;
|
|
mStatus = READY_MOVE;
|
|
mpParent->scale(1.0f, 1.0f);
|
|
mpParent->setAlphaRate(1.0f);
|
|
return 1;
|
|
} else {
|
|
f32 div = mFishListScreenFrames / (f32)openFrames;
|
|
mpParent->scale(div, div);
|
|
mpParent->setAlphaRate(div);
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
int dMenu_Fishing_c::_close() {
|
|
s16 closeFrames = g_drawHIO.mFishListScreen.mCloseFrames;
|
|
mFishListScreenFrames = 0;
|
|
if (mFishListScreenFrames <= 0) {
|
|
mFishListScreenFrames = 0;
|
|
mStatus = CLOSED;
|
|
mpParent->scale(0.0f, 0.0f);
|
|
mpParent->setAlphaRate(0.0f);
|
|
return 1;
|
|
} else {
|
|
f32 div = mFishListScreenFrames / (f32)closeFrames;
|
|
mpParent->scale(div, div);
|
|
mpParent->setAlphaRate(div);
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
// While the fishing menu is open,
|
|
void dMenu_Fishing_c::wait_init() {
|
|
setAButtonString(0);
|
|
setBButtonString(0x3F9); // "Back"
|
|
}
|
|
|
|
void dMenu_Fishing_c::wait_move() {
|
|
if (mDoGph_gInf_c::getFader()->getStatus() == 1 && mDoCPd_c::getTrigB(PAD_1)) {
|
|
mStatus = READY_CLOSE;
|
|
}
|
|
}
|
|
|
|
void dMenu_Fishing_c::screenSetBase() {
|
|
static const u64 fish_n[6] = {
|
|
MULTI_CHAR('fish_n_6'), MULTI_CHAR('fish_n_5'), MULTI_CHAR('fish_n_3'), MULTI_CHAR('fish_n_1'), MULTI_CHAR('fish_n_2'), MULTI_CHAR('fish_n_4'),
|
|
};
|
|
|
|
static const u64 fish_p0[6] = {
|
|
MULTI_CHAR('fi_pa_6n'), MULTI_CHAR('fi_pa_5n'), MULTI_CHAR('fi_pa_3n'), MULTI_CHAR('fi_pa_1n'), MULTI_CHAR('fi_pa_2n'), MULTI_CHAR('fi_pa_4n'),
|
|
};
|
|
|
|
static const u64 fish_p1[6] = {
|
|
MULTI_CHAR('fi_na_6n'), MULTI_CHAR('fi_na_5n'), MULTI_CHAR('fi_na_3n'), MULTI_CHAR('fi_na_1n'), MULTI_CHAR('fi_na_2n'), MULTI_CHAR('fi_na_4n'),
|
|
};
|
|
|
|
static const u64 fish_p2[6] = {MULTI_CHAR('fi_li_6n'), MULTI_CHAR('fi_li_5n'), MULTI_CHAR('fi_li_3n'),
|
|
MULTI_CHAR('fi_li_1n'), MULTI_CHAR('fi_li_2n'), MULTI_CHAR('fi_li_4n')};
|
|
|
|
static const u64 fish_p3[6] = {
|
|
MULTI_CHAR('b_box_6n'), MULTI_CHAR('b_box_5n'), MULTI_CHAR('b_box_3n'), MULTI_CHAR('b_box_1n'), MULTI_CHAR('b_box_2n'), MULTI_CHAR('b_box_4n'),
|
|
};
|
|
|
|
static const u64 fish_p4[6] = {
|
|
MULTI_CHAR('r_box_6n'), MULTI_CHAR('r_box_5n'), MULTI_CHAR('r_box_3n'), MULTI_CHAR('r_box_1n'), MULTI_CHAR('r_box_2n'), MULTI_CHAR('r_box_4n'),
|
|
};
|
|
|
|
static const u64 fish_p5[6] = {
|
|
MULTI_CHAR('info_6_n'), MULTI_CHAR('info_5_n'), MULTI_CHAR('info_3_n'), MULTI_CHAR('info_1_n'), MULTI_CHAR('info_2_n'), MULTI_CHAR('info_4_n'),
|
|
};
|
|
|
|
static const u64 size_1[6] = {
|
|
MULTI_CHAR('size_t_6'), MULTI_CHAR('size_t_5'), MULTI_CHAR('size_t_3'), MULTI_CHAR('size_t_1'), MULTI_CHAR('size_t_2'), MULTI_CHAR('size_t_4'),
|
|
};
|
|
|
|
static const u64 size_unit_1[6] = {
|
|
MULTI_CHAR('cm_t_6'), MULTI_CHAR('cm_t_5'), MULTI_CHAR('cm_t_3'), MULTI_CHAR('cm_t_1'), MULTI_CHAR('cm_t_2'), MULTI_CHAR('cm_t_4'),
|
|
};
|
|
|
|
static const u64 count_1[6] = {
|
|
MULTI_CHAR('count_t6'), MULTI_CHAR('count_t5'), MULTI_CHAR('count_t3'), MULTI_CHAR('count_t1'), MULTI_CHAR('count_t2'), MULTI_CHAR('count_t4'),
|
|
};
|
|
|
|
static const u64 count_unit_1[6] = {
|
|
MULTI_CHAR('cou_t_6'), MULTI_CHAR('cou_t_5'), MULTI_CHAR('cou_t_3'), MULTI_CHAR('cou_t_1'), MULTI_CHAR('cou_t_2'), MULTI_CHAR('cou_t_4'),
|
|
};
|
|
|
|
static const u64 name_0[6] = {
|
|
MULTI_CHAR('name_6'), MULTI_CHAR('name_5'), MULTI_CHAR('name_3'), MULTI_CHAR('name_1'), MULTI_CHAR('name_2'), MULTI_CHAR('name_4'),
|
|
};
|
|
|
|
static const u64 fname_0[6] = {
|
|
MULTI_CHAR('f_name_6'), MULTI_CHAR('f_name_5'), MULTI_CHAR('f_name_3'), MULTI_CHAR('f_name_1'), MULTI_CHAR('f_name_2'), MULTI_CHAR('f_name_4'),
|
|
};
|
|
|
|
static const u32 name_id[6] = {
|
|
0x59E, 0x59D, 0x59B, 0x599, 0x59A, 0x59C,
|
|
};
|
|
|
|
ResTIMG* TIMG = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', "tt_block8x8.bti");
|
|
mpBlackTex = JKR_NEW J2DPicture(TIMG);
|
|
|
|
mpBlackTex->setBlackWhite(JUtility::TColor(0, 0, 0, 0), JUtility::TColor(0, 0, 0, 0xFF));
|
|
mpScreen = JKR_NEW J2DScreen();
|
|
mpScreen->setPriority("zelda_fish_window.blo", 0x20000, mpArchive);
|
|
dPaneClass_showNullPane(mpScreen);
|
|
mpParent = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('n_all'), 2, NULL);
|
|
mpParent->setAlphaRate(0.0f);
|
|
for (int i = 0; i < MAX_FINDABLE_FISHES; i++) {
|
|
mpFishParent[i] = JKR_NEW CPaneMgr(mpScreen, fish_n[i], 0, NULL);
|
|
mpFishParts[0][i] = JKR_NEW CPaneMgr(mpScreen, fish_p0[i], 0, NULL);
|
|
mpFishParts[1][i] = JKR_NEW CPaneMgr(mpScreen, fish_p1[i], 0, NULL);
|
|
mpFishParts[2][i] = JKR_NEW CPaneMgr(mpScreen, fish_p2[i], 0, NULL);
|
|
mpFishParts[3][i] = JKR_NEW CPaneMgr(mpScreen, fish_p3[i], 0, NULL);
|
|
mpFishParts[4][i] = JKR_NEW CPaneMgr(mpScreen, fish_p4[i], 0, NULL);
|
|
mpFishParts[5][i] = JKR_NEW CPaneMgr(mpScreen, fish_p5[i], 0, NULL);
|
|
}
|
|
mpFishInfoParent[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('info_blu'), 0, NULL);
|
|
mpFishInfoParent[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('info_red'), 0, NULL);
|
|
|
|
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
|
|
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00'));
|
|
mpScreen->search(MULTI_CHAR('f_t00'))->hide();
|
|
#else
|
|
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('f_t00'));
|
|
mpScreen->search(MULTI_CHAR('t_t00'))->hide();
|
|
#endif
|
|
|
|
textBox->setFont(mDoExt_getSubFont());
|
|
textBox->setString(0x200, "");
|
|
mpString->getString(0x5a1, textBox, NULL, NULL, NULL, 0);
|
|
for (int i = 0; i < MAX_FINDABLE_FISHES; i++) {
|
|
field_0x10c[1][i] = (J2DTextBox*)mpScreen->search(size_1[i]);
|
|
field_0x10c[1][i]->setFont(mDoExt_getSubFont());
|
|
field_0x10c[1][i]->setString(0x20, "");
|
|
|
|
field_0x16c[1][i] = (J2DTextBox*)mpScreen->search(size_unit_1[i]);
|
|
field_0x16c[1][i]->setFont(mDoExt_getSubFont());
|
|
field_0x16c[1][i]->setString(0x20, "");
|
|
|
|
field_0x13c[1][i] = (J2DTextBox*)mpScreen->search(count_1[i]);
|
|
field_0x13c[1][i]->setFont(mDoExt_getSubFont());
|
|
field_0x13c[1][i]->setString(0x20, "");
|
|
|
|
field_0x19c[1][i] = (J2DTextBox*)mpScreen->search(count_unit_1[i]);
|
|
field_0x19c[1][i]->setFont(mDoExt_getSubFont());
|
|
field_0x19c[1][i]->setString(0x20, "");
|
|
|
|
mpFishNameString[i] = (J2DTextBox*)mpScreen->search(name_0[i]);
|
|
mpScreen->search(fname_0[i])->hide();
|
|
mpFishNameString[i]->setFont(mDoExt_getSubFont());
|
|
mpFishNameString[i]->setString(0x20, "");
|
|
dMeter2Info_getStringKanji(name_id[i], mpFishNameString[i]->getStringPtr(), NULL);
|
|
}
|
|
mpInfoLargestString = (J2DTextBox*)mpScreen->search(MULTI_CHAR('inf_size'));
|
|
mpInfoNumCaughtString = (J2DTextBox*)mpScreen->search(MULTI_CHAR('inf_cou'));
|
|
mpInfoLargestString->setFont(mDoExt_getMesgFont());
|
|
mpInfoNumCaughtString->setFont(mDoExt_getMesgFont());
|
|
mpInfoLargestString->setString(0x20, "");
|
|
dMeter2Info_getStringKanji(0x59f, mpInfoLargestString->getStringPtr(), NULL); // "Largest"
|
|
mpInfoNumCaughtString->setString(0x20, "");
|
|
dMeter2Info_getStringKanji(0x5a0, mpInfoNumCaughtString->getStringPtr(), NULL); // "No. Caught"
|
|
}
|
|
|
|
void dMenu_Fishing_c::screenSetDoIcon() {
|
|
static const u64 text_a_tag[5] = {MULTI_CHAR('atext1_1'), MULTI_CHAR('atext1_2'), MULTI_CHAR('atext1_3'), MULTI_CHAR('atext1_4'), MULTI_CHAR('atext1_5')};
|
|
static const u64 text_b_tag[5] = {MULTI_CHAR('btext1_1'), MULTI_CHAR('btext1_2'), MULTI_CHAR('btext1_3'), MULTI_CHAR('btext1_4'), MULTI_CHAR('btext1_5')};
|
|
|
|
mpIconScreen = JKR_NEW J2DScreen();
|
|
mpIconScreen->setPriority("zelda_collect_soubi_do_icon_parts.blo", 0x20000, mpArchive);
|
|
for (int i = 0; i < 2; i++) {
|
|
mpButtonAB[i] = NULL;
|
|
mpButtonText[i] = NULL;
|
|
}
|
|
dPaneClass_showNullPane(mpIconScreen);
|
|
for (int i = 0; i < 5; i++) {
|
|
mpAButtonString[i] = (J2DTextBox*)mpIconScreen->search(text_a_tag[i]);
|
|
mpBButtonString[i] = (J2DTextBox*)mpIconScreen->search(text_b_tag[i]);
|
|
mpAButtonString[i]->setFont(mDoExt_getMesgFont());
|
|
mpBButtonString[i]->setFont(mDoExt_getMesgFont());
|
|
mpAButtonString[i]->setString(0x20, "");
|
|
mpBButtonString[i]->setString(0x20, "");
|
|
}
|
|
}
|
|
|
|
void dMenu_Fishing_c::setAButtonString(u16 i_stringID) {
|
|
if (i_stringID == 0) {
|
|
for (int i = 0; i < 5; i++) {
|
|
strcpy(mpAButtonString[i]->getStringPtr(), "");
|
|
}
|
|
} else {
|
|
for (int i = 0; i < 5; i++) {
|
|
dMeter2Info_getStringKanji(i_stringID, mpAButtonString[i]->getStringPtr(), NULL);
|
|
}
|
|
}
|
|
}
|
|
|
|
void dMenu_Fishing_c::setBButtonString(u16 i_stringID) {
|
|
if (i_stringID == 0) {
|
|
for (int i = 0; i < 5; i++) {
|
|
strcpy(mpBButtonString[i]->getStringPtr(), "");
|
|
}
|
|
} else {
|
|
for (int i = 0; i < 5; i++) {
|
|
dMeter2Info_getStringKanji(i_stringID, mpBButtonString[i]->getStringPtr(), NULL);
|
|
}
|
|
}
|
|
}
|
|
|
|
u8 dMenu_Fishing_c::getFigure(int param_0) {
|
|
if (param_0 < 0) {
|
|
param_0 *= -1;
|
|
}
|
|
if (1000 <= param_0) {
|
|
param_0 = 999;
|
|
}
|
|
if (100 <= param_0) {
|
|
return 3;
|
|
}
|
|
if (param_0 >= 10) {
|
|
return 2;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
void dMenu_Fishing_c::setFishParam(int i_fishIdx, u16 i_fishCount, u8 i_fishSize) {
|
|
u8 fishCountFigure = getFigure(i_fishCount);
|
|
u8 fishSizeFigure = getFigure(i_fishSize);
|
|
char strBuff1[32];
|
|
char strBuff2[32];
|
|
for (int i = 1; i < 2; i++) {
|
|
// part one, i_fishSize
|
|
dComIfGp_setMessageCountNumber(i_fishSize);
|
|
mpString->getString(0x597, field_0x10c[i][i_fishIdx], NULL, NULL, NULL, 0); // "inches"
|
|
char* stringPtr = field_0x10c[i][i_fishIdx]->getStringPtr();
|
|
strcpy(strBuff1, stringPtr);
|
|
int j;
|
|
for (j = 0; strBuff1[j + fishSizeFigure] != 0; j++) {
|
|
strBuff2[j] = strBuff1[j + fishSizeFigure];
|
|
}
|
|
strBuff2[j] = 0;
|
|
strBuff1[fishSizeFigure] = 0;
|
|
strcpy(field_0x10c[i][i_fishIdx]->getStringPtr(), strBuff1);
|
|
strcpy(field_0x16c[i][i_fishIdx]->getStringPtr(), strBuff2);
|
|
|
|
// part two, i_fishCount
|
|
dComIfGp_setMessageCountNumber(i_fishCount);
|
|
mpString->getString(0x598, field_0x13c[i][i_fishIdx], NULL, NULL, NULL, 0); // "fish"
|
|
stringPtr = field_0x13c[i][i_fishIdx]->getStringPtr();
|
|
strcpy(strBuff1, stringPtr);
|
|
int k;
|
|
for (k = 0; strBuff1[k + fishCountFigure] != 0; k++) {
|
|
strBuff2[k] = strBuff1[k + fishCountFigure];
|
|
}
|
|
strBuff2[k] = 0;
|
|
strBuff1[fishCountFigure] = 0;
|
|
strcpy(field_0x13c[i][i_fishIdx]->getStringPtr(), strBuff1);
|
|
strcpy(field_0x19c[i][i_fishIdx]->getStringPtr(), strBuff2);
|
|
}
|
|
}
|
|
|
|
void dMenu_Fishing_c::setHIO(bool i_useHIO) {
|
|
if (i_useHIO || g_drawHIO.mFishListScreen.mDebug) {
|
|
for (int i = 0; i < MAX_FINDABLE_FISHES; i++) {
|
|
mpFishParent[i]->paneTrans(g_drawHIO.mFishListScreen.mFishInfoPosX[i],
|
|
g_drawHIO.mFishListScreen.mFishInfoPosY[i]);
|
|
mpFishParent[i]->scale(g_drawHIO.mFishListScreen.mFishInfoScale[i],
|
|
g_drawHIO.mFishListScreen.mFishInfoScale[i]);
|
|
|
|
mpFishParts[0][i]->paneTrans(g_drawHIO.mFishListScreen.mFishIconPosX[i],
|
|
g_drawHIO.mFishListScreen.mFishIconPosY[i]);
|
|
mpFishParts[0][i]->scale(g_drawHIO.mFishListScreen.mFishIconScale[i],
|
|
g_drawHIO.mFishListScreen.mFishIconScale[i]);
|
|
|
|
mpFishParts[1][i]->paneTrans(g_drawHIO.mFishListScreen.mFishNamePosX[i],
|
|
g_drawHIO.mFishListScreen.mFishNamePosY[i]);
|
|
mpFishParts[1][i]->scale(g_drawHIO.mFishListScreen.mFishNameScale[i],
|
|
g_drawHIO.mFishListScreen.mFishNameScale[i]);
|
|
|
|
mpFishParts[2][i]->paneTrans(g_drawHIO.mFishListScreen.mFishLinePosX[i],
|
|
g_drawHIO.mFishListScreen.mFishLinePosY[i]);
|
|
mpFishParts[2][i]->scale(g_drawHIO.mFishListScreen.mFishLineScale[i],
|
|
g_drawHIO.mFishListScreen.mFishLineScale[i]);
|
|
|
|
mpFishParts[3][i]->paneTrans(g_drawHIO.mFishListScreen.mFishSizePosX[i],
|
|
g_drawHIO.mFishListScreen.mFishSizePosY[i]);
|
|
mpFishParts[3][i]->scale(g_drawHIO.mFishListScreen.mFishSizeScale[i],
|
|
g_drawHIO.mFishListScreen.mFishSizeScale[i]);
|
|
|
|
mpFishParts[4][i]->paneTrans(g_drawHIO.mFishListScreen.mFishCountPosX[i],
|
|
g_drawHIO.mFishListScreen.mFishCountPosY[i]);
|
|
mpFishParts[4][i]->scale(g_drawHIO.mFishListScreen.mFishCountScale[i],
|
|
g_drawHIO.mFishListScreen.mFishCountScale[i]);
|
|
|
|
mpFishParts[5][i]->paneTrans(g_drawHIO.mFishListScreen.mFishCountSizePosX[i],
|
|
g_drawHIO.mFishListScreen.mFishCountSizePosY[i]);
|
|
mpFishParts[5][i]->scale(g_drawHIO.mFishListScreen.mFishCountSizeScale[i],
|
|
g_drawHIO.mFishListScreen.mFishCountSizeScale[i]);
|
|
}
|
|
for (int i = 0; i < 2; i++) {
|
|
mpFishInfoParent[i]->paneTrans(g_drawHIO.mFishListScreen.mPosX[i],
|
|
g_drawHIO.mFishListScreen.mPosY[i]);
|
|
mpFishInfoParent[i]->scale(g_drawHIO.mFishListScreen.mScale[i],
|
|
g_drawHIO.mFishListScreen.mScale[i]);
|
|
}
|
|
}
|
|
if (g_drawHIO.mCollectScreen.mButtonDebugON || i_useHIO) {
|
|
if (mpButtonAB[A_BUTTON] != NULL) {
|
|
mpButtonAB[A_BUTTON]->paneTrans(g_drawHIO.mCollectScreen.mButtonAPosX,
|
|
g_drawHIO.mCollectScreen.mButtonAPosY);
|
|
mpButtonAB[A_BUTTON]->scale(g_drawHIO.mCollectScreen.mButtonAScale,
|
|
g_drawHIO.mCollectScreen.mButtonAScale);
|
|
}
|
|
if (mpButtonAB[B_BUTTON] != NULL) {
|
|
mpButtonAB[B_BUTTON]->paneTrans(g_drawHIO.mCollectScreen.mButtonBPosX,
|
|
g_drawHIO.mCollectScreen.mButtonBPosY);
|
|
mpButtonAB[B_BUTTON]->scale(g_drawHIO.mCollectScreen.mButtonBScale,
|
|
g_drawHIO.mCollectScreen.mButtonBScale);
|
|
}
|
|
if (mpButtonText[A_BUTTON] != NULL) {
|
|
mpButtonText[A_BUTTON]->paneTrans(g_drawHIO.mCollectScreen.mButtonATextPosX,
|
|
g_drawHIO.mCollectScreen.mButtonATextPosY);
|
|
mpButtonText[A_BUTTON]->scale(g_drawHIO.mCollectScreen.mButtonATextScale,
|
|
g_drawHIO.mCollectScreen.mButtonATextScale);
|
|
}
|
|
if (mpButtonText[B_BUTTON] != NULL) {
|
|
mpButtonText[B_BUTTON]->paneTrans(g_drawHIO.mCollectScreen.mButtonBTextPosX,
|
|
g_drawHIO.mCollectScreen.mButtonBTextPosY);
|
|
mpButtonText[B_BUTTON]->scale(g_drawHIO.mCollectScreen.mButtonBTextScale,
|
|
g_drawHIO.mCollectScreen.mButtonBTextScale);
|
|
}
|
|
}
|
|
}
|